NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/40813: bad ps/ptyfs interaction
The following reply was made to PR bin/40813; it has been noted by GNATS.
From: Julian Djamil Fagir <gnrp%komkon2.de@localhost>
To: gnats-bugs%gnats.netbsd.org@localhost
Cc:
Subject: Re: bin/40813: bad ps/ptyfs interaction
Date: Sat, 3 Mar 2012 02:19:14 +0100
Hi,
> Dunno. Why should ps need to access the pty anyway? To get its device
> number?
yep, see src/bin/ps.c:
305 if (stat(ttypath, &sb) == -1)
306 err(1, "%s", ttypath);
307 if (!S_ISCHR(sb.st_mode))
308 errx(1, "%s: not a terminal", ttypath);
309 flag = sb.st_rdev;
If you wouldn't fail now, you would fail later when you kvm_getproc2(3)
without the device number.
Regards, Julian
Home |
Main Index |
Thread Index |
Old Index