From 6dcd6cac0327aae391d5def2e8e9a77fb100c6f8 Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Mon, 20 Jun 2005 03:14:29 +0000 Subject: If the `utility' specified starts with a '/' character, then execute it without checking it for an equals-sign. If it starts with a slash, then it cannot be a request to set the value of a valid environment variable. Approved by: re (blanket `env') --- usr.bin/env/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin/env') diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c index ebfdc98f308f..a7eb5362ec22 100644 --- a/usr.bin/env/env.c +++ b/usr.bin/env/env.c @@ -89,7 +89,8 @@ main(int argc, char **argv) if (env_verbosity) fprintf(stderr, "#env clearing environ\n"); } - for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) { + for (argv += optind; *argv && (**argv != '/') && (p = strchr(*argv, + '=')); ++argv) { if (env_verbosity) fprintf(stderr, "#env setenv:\t%s\n", *argv); (void)setenv(*argv, ++p, 1); -- cgit v1.2.3