Did I break anything?
Too paranoid?

Index: screen/tty.sh
===================================================================
--- screen.orig/tty.sh  2013-01-26 07:55:33.092171499 +0000
+++ screen/tty.sh       2013-01-26 08:56:34.254462991 +0000
@@ -1505,12 +1505,29 @@
 CheckTtyname (tty)
 char *tty;
 {
+  char real[MAX_PATH];
   struct stat st;
-
-  if (lstat(tty, &st) || !S_ISCHR(st.st_mode) ||
-     (st.st_nlink > 1 && strncmp(tty, "/dev/", 5)))
-    return -1;
-  return 0;
+  if (0 == lstat(tty, &st)) {
+    if (S_ISCHR(st.st_mode)) {
+      if ((1 == st.st_nlink) || (0 == strncmp(tty, "/dev/", 5)))
+          return 0;
+    } else if (S_ISLNK(st.st_mode)) {
+      if (0 == stat(tty, &st) && S_ISCHR(st.st_mode)) {
+        if (1 == st.st_nlink) {
+           return 0;
+        } else if (realpath(tty, real)) {
+#if defined(__sun__)
+            if (!strncmp(real, "/devices/", 9))
+              return 0;
+#else
+            if (!strncmp(real, "/dev/", 5))
+              return 0;
+#endif
+        }
+      }
+    }
+  }
+  return -1;
 }


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CALL-Q8y8W8dPX45cXFEhLHrNVtNvuTv=v1ka2zjzyhlytfn...@mail.gmail.com

Reply via email to