[issue1341] printenv(1): don't allow '=' in name

Stathis Kamperis (via DragonFly issue tracker) sinknull at crater.dragonflybsd.org
Mon Apr 20 08:11:12 PDT 2009


New submission from Stathis Kamperis <ekamperi at gmail.com>:

Salute.

After the recent libc changes, we no more allow environmental variables to have
an '=' character in their name. The printenv(1) utility isn't aware of that, so
it embarrasses itself, along with misleading the user:

$ env foo=bar=lala=123 printenv foo
bar=lala=123
$ env foo=bar=lala=123 printenv foo=bar
lala=123
$ env foo=bar=lala=123 printenv foo=bar=lala
123

In the above example, it gives the impression that there are 3 distinct
variables with names: foo, foo=bar, foo=bar=lala, which is wrong.

After the patch:

$ env foo=bar=lala=123 printenv foo
bar=lala=123
$ env foo=bar=lala=123 printenv foo=bar
printenv: variable name can't contain an '=' character
$ 

What do you think ? Ship it ?

Cheers,
Stathis

----------
assignedto: Beket
files: printenv.diff
messages: 6426
nosy: Beket
priority: bug
status: unread
title: printenv(1): don't allow '=' in name

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1341>
_____________________________________________________Attachment:
printenv.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00001.bin
Type: application/octet-stream
Size: 469 bytes
Desc: "Description: Binary data"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20090420/39f05acc/attachment-0021.bin>


More information about the Bugs mailing list