diff options
author | Bryan Cantrill <bryan@joyent.com> | 2011-12-16 20:10:44 -0500 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2011-12-16 20:10:44 -0500 |
commit | fba40a479337f3eb612fb77d692257a45d282023 (patch) | |
tree | cec5bccba6ee5370ec9e5ca23deffe3414b66d06 /usr/src/cmd/ps/ucbps.c | |
parent | ee63a9c96aceb3724cf0ee9b2e586b0dce3908a2 (diff) | |
download | illumos-joyent-fba40a479337f3eb612fb77d692257a45d282023.tar.gz |
1894 ps goes walkabout through /dev in search of foreign ttys
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@nexenta.com>
Diffstat (limited to 'usr/src/cmd/ps/ucbps.c')
-rw-r--r-- | usr/src/cmd/ps/ucbps.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/cmd/ps/ucbps.c b/usr/src/cmd/ps/ucbps.c index 4731f260e9..60235e2ae9 100644 --- a/usr/src/cmd/ps/ucbps.c +++ b/usr/src/cmd/ps/ucbps.c @@ -65,6 +65,7 @@ #include <stdarg.h> #include <sys/proc.h> #include <priv_utils.h> +#include <zone.h> #define NTTYS 2 /* max ttys that can be specified with the -t option */ /* only one tty can be specified with SunOS ps */ @@ -803,10 +804,14 @@ static char * gettty(psinfo_t *psinfo) { extern char *_ttyname_dev(dev_t, char *, size_t); + static zoneid_t zid = -1; char devname[TTYNAME_MAX]; char *retval; - if (psinfo->pr_ttydev == PRNODEV) + if (zid == -1) + zid = getzoneid(); + + if (psinfo->pr_ttydev == PRNODEV || psinfo->pr_zoneid != zid) return ("?"); if ((retval = devlookup(psinfo->pr_ttydev)) != NULL) |