From: Todd C. Miller Date: Tue, 21 Jul 2015 21:02:56 +0000 (-0600) Subject: On AIX, only convert the tty device number from dev64_t to dev32_t X-Git-Tag: SUDO_1_8_14p3^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aeaa6a6111773bf1b7e1bd28c7fb9c414297fe0c;p=sudo On AIX, only convert the tty device number from dev64_t to dev32_t if dev_t is 32-bits. --- diff --git a/src/ttyname.c b/src/ttyname.c index 3e59af587..dffb6720d 100644 --- a/src/ttyname.c +++ b/src/ttyname.c @@ -446,7 +446,7 @@ get_process_ttyname(char *name, size_t namelen) if (nread == (ssize_t)sizeof(psinfo)) { dev_t rdev = (dev_t)psinfo.pr_ttydev; #if defined(_AIX) && defined(DEVNO64) - if (psinfo.pr_ttydev & DEVNO64) + if ((psinfo.pr_ttydev & DEVNO64) && sizeof(dev_t) == 4) rdev = makedev(major64(psinfo.pr_ttydev), minor64(psinfo.pr_ttydev)); #endif if (rdev != (dev_t)-1)