]> git.ipfire.org Git - thirdparty/glibc.git/commit
Prevent unintended file desriptor leak in grantpt.
authorUlrich Drepper <drepper@redhat.com>
Wed, 25 Nov 2009 02:24:14 +0000 (18:24 -0800)
committerPetr Baudis <pasky@ucw.cz>
Fri, 4 Dec 2009 13:50:39 +0000 (14:50 +0100)
commit65a27b0b41a8ec07407ad0415fd0963917c59941
treee56304e1f744660741d50a9d54a1d777ca2ce20e
parent4f9d265e05056df279186d033af75352a679685f
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]