d0583c4039
If the fd refers to a terminal device, but not a pty master, the TIOCGPTN ioctl returns with ENOTTY. This error is not caught, and the possibly undefined buffer passed to ptsname_r is sent directly to the stat64 syscall. Fix this by using a fallback to the old method only if the TIOCGPTN ioctl fails with EINVAL. This also fix the return value in that specific case (it return ENOENT without this patch). Also add tests to the ptsname_r function (and ptsname at the same time). Note: this is Debian bug#741482, reported by Jakub Wilk <jwilk@debian.org> |
||
---|---|---|
.. | ||
programs | ||
endutxent.c | ||
forkpty.c | ||
getlogin_r_chk.c | ||
getlogin_r.c | ||
getlogin.c | ||
getpt.c | ||
getutent_r.c | ||
getutent.c | ||
getutid_r.c | ||
getutid.c | ||
getutline_r.c | ||
getutline.c | ||
getutmp.c | ||
getutmpx.c | ||
getutxent.c | ||
getutxid.c | ||
getutxline.c | ||
grantpt.c | ||
lastlog.h | ||
login_tty.c | ||
login.c | ||
logout.c | ||
logwtmp.c | ||
Makefile | ||
openpty.c | ||
ptsname_r_chk.c | ||
ptsname.c | ||
pty.h | ||
pututxline.c | ||
setlogin.c | ||
setutxent.c | ||
tst-grantpt.c | ||
tst-ptsname.c | ||
tst-utmp.c | ||
tst-utmpx.c | ||
unlockpt.c | ||
updwtmp.c | ||
updwtmpx.c | ||
utmp_file.c | ||
utmp-private.h | ||
utmp.h | ||
utmpname.c | ||
utmpxname.c | ||
Versions |