Util-Linux package development
 help / color / mirror / Atom feed
* su: calling setsid() for -c only if non-root user?
@ 2012-06-06 11:50 Bernhard Voelker
  2012-06-06 12:41 ` Ludwig Nussel
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Voelker @ 2012-06-06 11:50 UTC (permalink / raw)
  To: util-linux@vger.kernel.org

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

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

end of thread, other threads:[~2012-06-06 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 11:50 su: calling setsid() for -c only if non-root user? Bernhard Voelker
2012-06-06 12:41 ` Ludwig Nussel
2012-06-06 13:07   ` Bernhard Voelker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox