Bug#490134: "preserve-env" option does not preserve environment

Chris Lamb chris at chris-lamb.co.uk
Thu Jul 10 05:55:57 UTC 2008


Package: gksu
Severity: normal
Version: 2.0.0-5

The "preserve-env" option does not work as advertised:

  """
     --preserve-env, -k
           Preserve the current environments, does not set $HOME nor
           $PATH, for example.
  """

As a testcase:

 % export FOO="bar"
 % gksu -- /bin/sh -c "echo FOO=\$FOO"
 FOO=
 % gksu -k -- /bin/sh -c "echo FOO=\$FOO"
 FOO=

I would have expected that, when specifying "-k", gksu would preserve the FOO
environment variable for the target program.

At least in gksudo mode, specifying "--preserve-env" seems to just toggle
passing "-H" to sudo, which toggles whether HOME is preserved:

 % gksu -- /bin/sh -c "echo HOME=\$HOME"
 HOME=/root
 % gksu -k -- /bin/sh -c "echo HOME=\$HOME"
 HOME=/home/lamby

To really have "Preserve the current environments" semantics, shouldn't -H
be replaced with -E?


Regards,

-- 
Chris Lamb, UK                                       chris at chris-lamb.co.uk
                                                            GPG: 0x634F9A20
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20080710/70880fef/attachment.pgp 


More information about the pkg-gnome-maintainers mailing list