Project

General

Profile

Actions

Bug #1341

closed

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

Added by Anonymous about 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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


Files

printenv.diff (563 Bytes) printenv.diff Anonymous, 04/20/2009 06:58 PM
Actions

Also available in: Atom PDF