File nottychmod.diff of Package screen.38894

--- attacher.c.orig	2025-05-28 10:57:40.899858935 +0000
+++ attacher.c	2025-05-28 10:58:13.883802615 +0000
@@ -66,7 +66,6 @@ extern int MasterPid, attach_fd;
 #ifdef MULTIUSER
 extern char *multi;
 extern int multiattach, multi_uid, own_uid;
-extern int tty_mode, tty_oldmode;
 # ifndef USE_SETEUID
 static int multipipe[2];
 # endif
@@ -152,9 +151,6 @@ int how;
 
       if (pipe(multipipe))
 	Panic(errno, "pipe");
-      if (chmod(attach_tty, 0666))
-	Panic(errno, "chmod %s", attach_tty);
-      tty_oldmode = tty_mode;
       eff_uid = -1;	/* make UserContext fork */
       real_uid = multi_uid;
       if ((ret = UserContext()) <= 0)
@@ -166,11 +162,6 @@ int how;
 	    Panic(errno, "UserContext");
 	  close(multipipe[1]);
 	  read(multipipe[0], &dummy, 1);
-	  if (tty_oldmode >= 0)
-	    {
-	      chmod(attach_tty, tty_oldmode);
-	      tty_oldmode = -1;
-	    }
 	  ret = UserStatus();
 #ifdef LOCK
 	  if (ret == SIG_LOCK)
@@ -216,9 +207,6 @@ int how;
       xseteuid(multi_uid);
       xseteuid(own_uid);
 #endif
-      if (chmod(attach_tty, 0666))
-	Panic(errno, "chmod %s", attach_tty);
-      tty_oldmode = tty_mode;
     }
 # endif /* USE_SETEUID */
 #endif /* MULTIUSER */
@@ -403,13 +391,6 @@ int how;
       ContinuePlease = 0;
 # ifndef USE_SETEUID
       close(multipipe[1]);
-# else
-      xseteuid(own_uid);
-      if (tty_oldmode >= 0)
-        if (chmod(attach_tty, tty_oldmode))
-          Panic(errno, "chmod %s", attach_tty);
-      tty_oldmode = -1;
-      xseteuid(real_uid);
 # endif
     }
 #endif
@@ -483,13 +464,6 @@ AttacherFinit SIGDEFARG
 	  close(s);
 	}
     }
-#ifdef MULTIUSER
-  if (tty_oldmode >= 0)
-    {
-      setuid(own_uid);
-      chmod(attach_tty, tty_oldmode);
-    }
-#endif
   exit(0);
   SIGRETURN;
 }
--- screen.c.orig	2025-05-28 10:57:40.895858942 +0000
+++ screen.c	2025-05-28 10:58:48.147744111 +0000
@@ -219,8 +219,6 @@ char *multi_home;
 int multi_uid;
 int own_uid;
 int multiattach;
-int tty_mode;
-int tty_oldmode = -1;
 #endif
 
 char HostName[MAXSTR];
@@ -1008,9 +1006,6 @@ char **av;
 
       /* ttyname implies isatty */
       SET_TTYNAME(1);
-#ifdef MULTIUSER
-      tty_mode = (int)st.st_mode & 0777;
-#endif
 
 #ifndef NAMEDPIPE
       fl = fcntl(0, F_GETFL, 0);
@@ -2196,19 +2191,6 @@ DEFINE_VARARGS_FN(Panic)
 	if (D_userpid)
 	  Kill(D_userpid, SIG_BYE);
       }
-#ifdef MULTIUSER
-  if (tty_oldmode >= 0)
-    {
-# ifdef USE_SETEUID
-      if (setuid(own_uid))
-        xseteuid(own_uid);	/* may be a loop. sigh. */
-# else
-      setuid(own_uid);
-# endif
-      debug1("Panic: changing back modes from %s\n", attach_tty);
-      chmod(attach_tty, tty_oldmode);
-    }
-#endif
   eexit(1);
 }
 
openSUSE Build Service is sponsored by