Prevent unintended file desriptor leak in grantpt.
commitf3a93a0820949f67c95eda882e4f4331ad26accd
authorAndreas Schwab <schwab@redhat.com>
Wed, 25 Nov 2009 13:04:18 +0000 (25 14:04 +0100)
committerAndreas Schwab <schwab@redhat.com>
Wed, 25 Nov 2009 13:04:18 +0000 (25 14:04 +0100)
treeac1945db69088fc86620e9d8264069a4c532925c
parent8757dec424e2fc887623104565243bdd66cd609b
Prevent unintended file desriptor leak in grantpt.

The pt_chown program is completely transparently called.  It might
not be able to live with the various file descriptors the program
has open at the time of the call (e.g., under SELinux).  Close all
but the needed descriptor and connect stdin, stdout, and stderr
with /dev/null.  pt_chown shouldn't print anything when called to
do real work.
(cherry picked from commit 139ee080b6b428240bf49f3e6361f3ac729f891a)
ChangeLog
login/programs/pt_chown.c
sysdeps/unix/grantpt.c
sysdeps/unix/sysv/linux/grantpt.c [new file with mode: 0644]