[BusyBox] env.c

Jonas Holmberg jonas.holmberg at axis.com
Fri May 11 03:21:46 UTC 2001


I've found a couple of problems with env.c. The first char in optstring
is
'-' which has a special meaning to getopt which I assume wasn't
intended. "env A=1 /bin/sh" doesn't work (it just prints env usage).
When I fixed that problem I found that when running "env A=1 /bin/sh"
the value of A would be "A=1" and not "1". I solved that by overwriting
'=' with '\0' in argv (see patch).

The attached patch solves all of the problems above and it makes env
behave
like GNU env concerning '-' option (i.e. the '-' argument must be after
-iu,
not before, so in usage.h env_trivial_usage should be changed to:

	"[-iu] [-] [name=value ...] [command]"

I don't have commit access to the CVS so I hope someone can commit it
for me.

Best regards
/Jonas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: env.c.diff.gz
Type: application/x-gzip
Size: 477 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20010511/1bff0f32/attachment.bin 


More information about the busybox mailing list