[Pkg-shadow-devel] Fix default path for root with "su"

Michel Hermier michel.hermier at gmail.com
Sun Nov 1 10:28:56 UTC 2009


Hi,

According to the manual:

    The current environment is passed to the new shell. The value of
$PATH is reset to /bin:/usr/bin for normal users, or
    /sbin:/bin:/usr/sbin:/usr/bin for the superuser. This may be
changed with the ENV_PATH and ENV_SUPATH definitions in
/etc/login.defs.

So for me when doing a simple "su" invocation the $PATH should be
"/sbin:/bin:/usr/sbin:/usr/bin" while "su foouser" should return
"/bin:/usr/bin" when /etc/login.defs is not modified. But it is not
the case, we unconditionally get "/bin:/usr/bin". Here is a patch that
correct this behavior.

Cheers,
    Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: su.patch
Type: application/octet-stream
Size: 448 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/attachments/20091101/a56622c6/attachment.obj>


More information about the Pkg-shadow-devel mailing list