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')
This commit is contained in:
gad 2005-06-20 03:14:29 +00:00
parent 4e1c4de27a
commit b785b6343e

3
usr.bin/env/env.c vendored
View File

@ -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);