]> granicus.if.org Git - sudo/commitdiff
In Solaris 11, /dev/pts under the "dev" filesystem, not "devices".
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Apr 2012 17:21:22 +0000 (13:21 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Apr 2012 17:21:22 +0000 (13:21 -0400)
Update tty_is_devpts() to match so we can determine when the tty
has been reused.

plugins/sudoers/check.c

index ddb61d9d72480cab55dc9b6929b9f40284dc18c1..d66445ce0ccb0ace1368b129b47be6290cc14ee5 100644 (file)
@@ -699,9 +699,9 @@ remove_timestamp(bool remove)
 }
 
 /*
- * Returns true if tty lives on a devpts or /devices filesystem, else false.
- * Unlike most filesystems, the ctime of devpts nodes is not updated when
- * the device node is written to, only when the inode's status changes,
+ * Returns true if tty lives on a devpts, /dev or /devices filesystem, else
+ * false.  Unlike most filesystems, the ctime of devpts nodes is not updated
+ * when the device node is written to, only when the inode's status changes,
  * typically via the chmod, chown, link, rename, or utimes system calls.
  * Since the ctime is "stable" in this case, we can stash it the tty ticket
  * file and use it to determine whether the tty ticket file is stale.
@@ -727,7 +727,7 @@ tty_is_devpts(const char *tty)
     debug_decl(tty_is_devpts, SUDO_DEBUG_PTY)
 
     if (statvfs(tty, &sfs) == 0) {
-       if (strcmp(sfs.f_fstr, "devices") == 0)
+       if (strcmp(sfs.f_fstr, "dev") == 0 || strcmp(sfs.f_fstr, "devices") == 0)
            retval = true;
     }
 #else