]> granicus.if.org Git - sudo/commitdiff
On AIX, only convert the tty device number from dev64_t to dev32_t
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 21 Jul 2015 21:02:56 +0000 (15:02 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 21 Jul 2015 21:02:56 +0000 (15:02 -0600)
if dev_t is 32-bits.

src/ttyname.c

index 3e59af587ce49160e3036fd2dc83ebf0e58d4d78..dffb6720d6962003518766dd3e55484256fd54a9 100644 (file)
@@ -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)