Package: screen
Version: 4.0.3-7
Severity: minor
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch hardy

Hello,

screen should check whether the target user has a password set before
locking the screen. This happens e. g. when root does not have a
password and administration is done with sudo. In this case, screen
locking should ask for and use a key.

in Ubuntu we applied the following patch for this a while ago:

 * 07_norootpassword.dpatch: When locking a screen, check that the user has a
   password set. If not, ask for an unlocking key. (LP#6760)

(details are at https://bugs.launchpad.net/bugs/6760).

Please consider applying this in Debian, since sudo is popular in
Debian, too.

Thank you,

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org
#! /bin/sh /usr/share/dpatch/dpatch-run
## 07_norootpassword.dpatch by Martin Pitt <[EMAIL PROTECTED]>
##
## DP: When locking a screen, check that the user has a
## DP: password set. If not, ask for an unlocking key.
## DP: See https://bugs.launchpad.net/bugs/6760

@DPATCH@
--- screen-4.0.3.orig/attacher.c
+++ screen-4.0.3/attacher.c
@@ -806,11 +806,15 @@
 #ifdef USE_PAM
   pam_handle_t *pamh = 0;
   int pam_error;
-#else
-  char *pass, mypass[16 + 1], salt[3];
 #endif
+  char *pass, mypass[16 + 1], salt[3];
+  int using_pam = 1;
 
-#ifndef USE_PAM
+#ifdef USE_PAM
+  if (!ppp->pw_uid)
+    {
+#endif
+  using_pam = 0;
   pass = ppp->pw_passwd;
   if (pass == 0 || *pass == 0)
     {
@@ -843,6 +847,8 @@
       pass = crypt(mypass, salt);
       pass = ppp->pw_passwd = SaveStr(pass);
     }
+#ifdef USE_PAM
+    }
 #endif
 
   debug("screen_builtin_lck looking in gcos field\n");
@@ -872,6 +878,8 @@
           AttacherFinit(SIGARG);
           /* NOTREACHED */
         }
+      if (using_pam)
+        {
 #ifdef USE_PAM
       PAM_conversation.appdata_ptr = cp1;
       pam_error = pam_start("screen", ppp->pw_name, &PAM_conversation, &pamh);
@@ -882,10 +890,13 @@
       PAM_conversation.appdata_ptr = 0;
       if (pam_error == PAM_SUCCESS)
        break;
-#else
-      if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
-       break;
 #endif
+        }
+      else
+       {
+          if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
+           break;
+       }
       debug("screen_builtin_lck: NO!!!!!\n");
       bzero(cp1, strlen(cp1));
     }

Attachment: signature.asc
Description: Digital signature

Reply via email to