Created
August 20, 2012 05:40
-
-
Save pasela/3401354 to your computer and use it in GitHub Desktop.
GNU screen: A patch to avoid /tmp/uscreens permission check on Cygwin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/screen.c b/src/screen.c | |
index 6e19732..3a8ca3e 100644 | |
--- a/src/screen.c | |
+++ b/src/screen.c | |
@@ -1102,8 +1102,10 @@ char **av; | |
n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 : | |
(eff_gid == (int)st.st_gid && eff_gid != real_gid) ? 0775 : | |
0777; | |
+#if !defined(__CYGWIN__) | |
if (((int)st.st_mode & 0777) != n) | |
Panic(0, "Directory '%s' must have mode %03o.", SockDir, n); | |
+#endif | |
} | |
sprintf(SockPath, "%s/S-%s", SockDir, LoginName); | |
if (access(SockPath, F_OK)) | |
@@ -1133,8 +1135,10 @@ char **av; | |
if ((int)st.st_uid != real_uid) | |
Panic(0, "You are not the owner of %s.", SockPath); | |
} | |
+#if !defined(__CYGWIN__) | |
if ((st.st_mode & 0777) != 0700) | |
Panic(0, "Directory %s must have mode 700.", SockPath); | |
+#endif | |
if (SockMatch && index(SockMatch, '/')) | |
Panic(0, "Bad session name '%s'", SockMatch); | |
SockName = SockPath + strlen(SockPath) + 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love the idea. Two points I'd like to make.