diff options
author | Garance A Drosehn <gad@FreeBSD.org> | 2005-06-20 03:14:29 +0000 |
---|---|---|
committer | Garance A Drosehn <gad@FreeBSD.org> | 2005-06-20 03:14:29 +0000 |
commit | 6dcd6cac0327aae391d5def2e8e9a77fb100c6f8 (patch) | |
tree | e81817c80c46083f0d721d6db6a712e0230fc353 /usr.bin/env | |
parent | 212274c3b6152dacfd9ce8e0925e0ffe8377bb01 (diff) | |
download | src-6dcd6cac0327aae391d5def2e8e9a77fb100c6f8.tar.gz src-6dcd6cac0327aae391d5def2e8e9a77fb100c6f8.zip |
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')
Notes
Notes:
svn path=/head/; revision=147492
Diffstat (limited to 'usr.bin/env')
-rw-r--r-- | usr.bin/env/env.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |