From: Bernhard Voelker <mail@bernhard-voelker.de>
To: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: su: calling setsid() for -c only if non-root user?
Date: Wed, 06 Jun 2012 13:50:52 +0200 [thread overview]
Message-ID: <4FCF441C.1090400@bernhard-voelker.de> (raw)
I am playing around with the --command and --session-command options of su,
and I noticed that setsid() is only called iff a non-root new_user is given:
if (request_same_session || !command || !pw->pw_uid)
same_session = 1;
...
if (!same_session)
setsid ();
Why is the setsid() call dependent on the user?
The commit and the bug behind it don't give an answer
(c6a1746b5f5247b2fccaf5c7f68da3852a02e4fc):
call setsid() when called with -c
Prevents command injection via TIOCSTI
https://bugzilla.redhat.com/show_bug.cgi?id=173008
Have a nice day,
Berny
next reply other threads:[~2012-06-06 11:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 11:50 Bernhard Voelker [this message]
2012-06-06 12:41 ` su: calling setsid() for -c only if non-root user? Ludwig Nussel
2012-06-06 13:07 ` Bernhard Voelker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FCF441C.1090400@bernhard-voelker.de \
--to=mail@bernhard-voelker.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.