Blob Blame History Raw
--- xscreensaver-5.00/config.h.in.rootpasswd	2006-05-18 08:36:52.000000000 +0900
+++ xscreensaver-5.00/config.h.in	2006-05-31 00:09:40.000000000 +0900
@@ -398,6 +398,11 @@
 /* Define this to remove the option of locking the screen at all. */
 #undef NO_LOCKING
 
+/* Define this if allowing root passwd to unlock screen
+   Default is YES!!
+*/
+#undef ALLOW_ROOT_PASSWD
+
 /* This is the same as GETTEXT_PACKAGE, but for the glade generated code. */
 #undef PACKAGE
 
--- xscreensaver-5.00/configure.in.rootpasswd	2006-05-24 07:07:00.000000000 +0900
+++ xscreensaver-5.00/configure.in	2006-05-31 00:31:29.000000000 +0900
@@ -1793,6 +1793,23 @@
 
 ###############################################################################
 #
+#       Whether to allow root password to unblank.
+#
+###############################################################################
+AC_ARG_ENABLE(root-passwd, [
+  --enable-root-passwd	      Allow root passwd to unlock screen.
+  --disable-root-passwd       Do not allow that.],
+  [enable_root_passwd="$enableval"],[enable_root_passwd=yes])
+if test "$enable_root_passwd" = yes; then
+  AC_DEFINE(ALLOW_ROOT_PASSWD)
+  true
+elif test "$enable_root_passwd" != no; then
+  echo "error: something wrong with root-passwd option. Check configure.in ."
+  exit 1
+fi
+
+###############################################################################
+#
 #       Check for PAM.
 #
 ###############################################################################
--- xscreensaver-5.00/driver/passwd-pam.c.rootpasswd	2006-05-17 11:14:58.000000000 +0900
+++ xscreensaver-5.00/driver/passwd-pam.c	2006-05-31 00:09:40.000000000 +0900
@@ -288,6 +288,7 @@
       goto DONE;
     }
 
+#ifdef ALLOW_ROOT_PASSWD
   /* If that didn't work, set the user to root, and try to authenticate again.
    */
   if (user) free (user);
@@ -300,6 +301,7 @@
   if (status != PAM_SUCCESS) goto DONE;
 
   PAM_NO_DELAY(pamh);
+#endif
 
   set = block_sigchld();
   status = pam_authenticate (pamh, 0);