diff options
author | gad <gad@FreeBSD.org> | 2005-06-20 03:14:29 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2005-06-20 03:14:29 +0000 |
commit | b785b6343ef380b2072604d84d7dacc05e51a7c6 (patch) | |
tree | e81817c80c46083f0d721d6db6a712e0230fc353 /usr.bin/env | |
parent | 4e1c4de27a0ad5eb26df6fc78a2305992d15de4e (diff) | |
download | FreeBSD-src-b785b6343ef380b2072604d84d7dacc05e51a7c6.zip FreeBSD-src-b785b6343ef380b2072604d84d7dacc05e51a7c6.tar.gz |
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')
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 ebfdc98..a7eb536 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); |