util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [su] New su utility messes with my PATH
@ 2012-09-15 13:17 Thomas Bächler
  2012-09-15 14:43 ` Pádraig Brady
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Bächler @ 2012-09-15 13:17 UTC (permalink / raw)
  To: util-linux; +Cc: Dave Reisner, Tobias Powalowski

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

I found what I think is absolutely unexpected behaviour in the new su
utility. It seems to have been introduced by commit a6fdd3f8.

It is about /sbin and /usr/sbin being in the path: Whenever you switch
to a non-root user, they are removed from the path, and when you switch
to root, they are added. I find it completely unexpected that su (when
not running with -l) messes with my environment at all.

Commands like
 PATH=... su -c "cmd" user
do not work as expected.

In my opinion, when you wish your path (or anything in the environment)
to change you should a) use -l to start a login shell or b) configure
your scripts to take care of it.

I propose to revert the mentioned patch. Opinions?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-02  8:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15 13:17 [su] New su utility messes with my PATH Thomas Bächler
2012-09-15 14:43 ` Pádraig Brady
2012-09-20  9:47   ` Karel Zak
2012-09-21  7:54     ` Ludwig Nussel
2012-10-02  8:17     ` Karel Zak
2012-10-02  8:23       ` Thomas Bächler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).