Tim Waugh d66c4d
--- coreutils-6.7/src/Makefile.am.pam	2006-11-24 21:28:10.000000000 +0000
Tim Waugh d66c4d
+++ coreutils-6.7/src/Makefile.am	2007-01-09 17:00:01.000000000 +0000
Tim Waugh d66c4d
@@ -103,7 +103,7 @@
Tim Waugh d66c4d
 # If necessary, add -lm to resolve use of pow in lib/strtod.c.
Tim Waugh d66c4d
 uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS)
cvsdist 5adf0d
 
Tim Waugh d66c4d
-su_LDADD = $(LDADD) $(LIB_CRYPT)
Tim Waugh d66c4d
+su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
cvsdist 5adf0d
 
Tim Waugh d66c4d
 dir_LDADD += $(LIB_ACL)
Tim Waugh d66c4d
 ls_LDADD += $(LIB_ACL)
Tim Waugh d66c4d
--- coreutils-6.7/src/su.c.pam	2007-01-09 17:00:01.000000000 +0000
Tim Waugh d66c4d
+++ coreutils-6.7/src/su.c	2007-01-09 17:16:43.000000000 +0000
cvsdist 5adf0d
@@ -38,6 +38,16 @@
cvsdist 5adf0d
    restricts who can su to UID 0 accounts.  RMS considers that to
cvsdist 5adf0d
    be fascist.
cvsdist 5adf0d
 
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+
cvsdist 5adf0d
+   Actually, with PAM, su has nothing to do with whether or not a
cvsdist 5adf0d
+   wheel group is enforced by su.  RMS tries to restrict your access
cvsdist 5adf0d
+   to a su which implements the wheel group, but PAM considers that
cvsdist 5adf0d
+   to be fascist, and gives the user/sysadmin the opportunity to
cvsdist 5adf0d
+   enforce a wheel group by proper editing of /etc/pam.conf
cvsdist 5adf0d
+
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
+
Tim Waugh d66c4d
    Compile-time options:
Tim Waugh d66c4d
    -DSYSLOG_SUCCESS	Log successful su's (by default, to root) with syslog.
Tim Waugh d66c4d
    -DSYSLOG_FAILURE	Log failed su's (by default, to root) with syslog.
Tim Waugh d66c4d
@@ -59,6 +69,15 @@
cvsdist 5adf0d
    prototype (returning `int') in <unistd.h>.  */
cvsdist 5adf0d
 #define getusershell _getusershell_sys_proto_
cvsdist 5adf0d
 
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+# include <signal.h>
cvsdist 5adf0d
+# include <sys/wait.h>
cvsdist 5adf0d
+# include <sys/fsuid.h>
Tim Waugh e87740
+# include <unistd.h>
Tim Waugh 3dd4af
+# include <security/pam_appl.h>
Tim Waugh 3dd4af
+# include <security/pam_misc.h>
cvsdist 5adf0d
+#endif /* USE_PAM */
cvsdist 5adf0d
+
cvsdist 5adf0d
 #include "system.h"
Tim Waugh d66c4d
 #include "getpass.h"
cvsdist 5adf0d
 
Tim Waugh d66c4d
@@ -128,15 +147,22 @@
cvsdist 5adf0d
 /* The user to become if none is specified.  */
cvsdist 5adf0d
 #define DEFAULT_USER "root"
cvsdist 5adf0d
 
cvsdist 5adf0d
+#ifndef USE_PAM
Ondrej Vasik c4b1fe
 char *crypt (char const *key, char const *salt);
cvsdist 5adf0d
+#endif
Ondrej Vasik c4b1fe
 char *getusershell (void);
Ondrej Vasik c4b1fe
 void endusershell (void);
Ondrej Vasik c4b1fe
 void setusershell (void);
cvsdist 5adf0d
 
cvsdist 5adf0d
 extern char **environ;
cvsdist 5adf0d
 
Tim Waugh c3e4c8
-static void run_shell (char const *, char const *, char **, size_t)
Tim Waugh c3e4c8
+static void run_shell (char const *, char const *, char **, size_t,
Tim Waugh c3e4c8
+	const struct passwd *)
cvsdist 5adf0d
+#ifdef USE_PAM
Tim Waugh c3e4c8
+	;
cvsdist 5adf0d
+#else
cvsdist 5adf0d
      ATTRIBUTE_NORETURN;
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
 
Ondrej Vasik e18e41
 /* If true, pass the `-f' option to the subshell.  */
Ondrej Vasik e18e41
 static bool fast_startup;
Tim Waugh d66c4d
@@ -225,7 +251,26 @@
cvsdist 5adf0d
 }
cvsdist 5adf0d
 #endif
cvsdist 5adf0d
 
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+static pam_handle_t *pamh = NULL;
cvsdist 5adf0d
+static int retval;
cvsdist 5adf0d
+static struct pam_conv conv = {
cvsdist 5adf0d
+  misc_conv,
cvsdist 5adf0d
+  NULL
cvsdist 5adf0d
+};
cvsdist 5adf0d
+
cvsdist 5adf0d
+#define PAM_BAIL_P if (retval) { \
cvsdist 5adf0d
+  pam_end(pamh, PAM_SUCCESS); \
cvsdist 5adf0d
+  return 0; \
cvsdist 5adf0d
+}
Tim Waugh ee719b
+#define PAM_BAIL_P_VOID if (retval) {		\
Tim Waugh ee719b
+  pam_end(pamh, PAM_SUCCESS);			\
Tim Waugh ee719b
+return;						\
Tim Waugh ee719b
+}
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
+
cvsdist 5adf0d
 /* Ask the user for a password.
cvsdist 5adf0d
+   If PAM is in use, let PAM ask for the password if necessary.
Tim Waugh c3e4c8
    Return true if the user gives the correct password for entry PW,
Tim Waugh c3e4c8
    false if not.  Return true without asking for a password if run by UID 0
cvsdist 5adf0d
    or if PW has an empty password.  */
Tim Waugh d66c4d
@@ -233,6 +278,44 @@
Tim Waugh c3e4c8
 static bool
cvsdist 5adf0d
 correct_password (const struct passwd *pw)
cvsdist 5adf0d
 {
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+  struct passwd *caller;
Tim Waugh e87740
+  char *tty_name, *ttyn;
cvsdist 5adf0d
+  retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
cvsdist 5adf0d
+  PAM_BAIL_P;
cvsdist 5adf0d
+
cvsdist 5adf0d
+  if (getuid() != 0 && !isatty(0)) {
cvsdist 5adf0d
+	fprintf(stderr, "standard in must be a tty\n");
cvsdist 5adf0d
+	exit(1);
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+
cvsdist 5adf0d
+  caller = getpwuid(getuid());
cvsdist 5adf0d
+  if(caller != NULL && caller->pw_name != NULL) {
cvsdist 5adf0d
+	  retval = pam_set_item(pamh, PAM_RUSER, caller->pw_name);
cvsdist 5adf0d
+	  PAM_BAIL_P;
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+
Tim Waugh e87740
+  ttyn = ttyname(0);
Tim Waugh f1ce78
+  if (ttyn) {
Tim Waugh f1ce78
+    if (strncmp(ttyn, "/dev/", 5) == 0)
Tim Waugh e87740
+       tty_name = ttyn+5;
Tim Waugh f1ce78
+    else
Tim Waugh e87740
+       tty_name = ttyn;
Tim Waugh f1ce78
+    retval = pam_set_item(pamh, PAM_TTY, tty_name);
Tim Waugh f1ce78
+    PAM_BAIL_P;
Tim Waugh f1ce78
+  }
cvsdist 5adf0d
+  retval = pam_authenticate(pamh, 0);
cvsdist 5adf0d
+  PAM_BAIL_P;
cvsdist 5adf0d
+  retval = pam_acct_mgmt(pamh, 0);
cvsdist 5adf0d
+  if (retval == PAM_NEW_AUTHTOK_REQD) {
cvsdist 5adf0d
+    /* password has expired.  Offer option to change it. */
cvsdist 5adf0d
+    retval = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
cvsdist 5adf0d
+    PAM_BAIL_P;
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  PAM_BAIL_P;
cvsdist 5adf0d
+  /* must be authenticated if this point was reached */
cvsdist 5adf0d
+  return 1;
cvsdist 5adf0d
+#else /* !USE_PAM */
cvsdist 5adf0d
   char *unencrypted, *encrypted, *correct;
cvsdist 5adf0d
 #if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
cvsdist 5adf0d
   /* Shadow passwd stuff for SVR3 and maybe other systems.  */
Tim Waugh d66c4d
@@ -257,6 +340,7 @@
cvsdist 5adf0d
   encrypted = crypt (unencrypted, correct);
cvsdist 5adf0d
   memset (unencrypted, 0, strlen (unencrypted));
Tim Waugh c3e4c8
   return STREQ (encrypted, correct);
cvsdist 5adf0d
+#endif /* !USE_PAM */
cvsdist 5adf0d
 }
cvsdist 5adf0d
 
cvsdist 5adf0d
 /* Update `environ' for the new shell based on PW, with SHELL being
Tim Waugh d66c4d
@@ -270,12 +354,18 @@
Tim Waugh c3e4c8
       /* Leave TERM unchanged.  Set HOME, SHELL, USER, LOGNAME, PATH.
cvsdist 5adf0d
          Unset all other environment variables.  */
Tim Waugh c3e4c8
       char const *term = getenv ("TERM");
Tim Waugh c3e4c8
+      char const *display = getenv ("DISPLAY");
Tim Waugh c3e4c8
+      char const *xauthority = getenv ("XAUTHORITY");
Tim Waugh c3e4c8
       if (term)
Ondrej Vasik 250517
         term = xstrdup (term);
Tim Waugh c3e4c8
       environ = xmalloc ((6 + !!term) * sizeof (char *));
Tim Waugh c3e4c8
       environ[0] = NULL;
cvsdist 5adf0d
       if (term)
Ondrej Vasik 250517
         xsetenv ("TERM", term);
cvsdist 5adf0d
+      if (display)
Ondrej Vasik 250517
+        xsetenv ("DISPLAY", display);
cvsdist 5adf0d
+      if (xauthority)
Ondrej Vasik 250517
+        xsetenv ("XAUTHORITY", xauthority);
Tim Waugh c3e4c8
       xsetenv ("HOME", pw->pw_dir);
Tim Waugh c3e4c8
       xsetenv ("SHELL", shell);
Tim Waugh c3e4c8
       xsetenv ("USER", pw->pw_name);
Tim Waugh d66c4d
@@ -308,8 +398,13 @@
Tim Waugh e87740
 {
Tim Waugh e87740
 #ifdef HAVE_INITGROUPS
Tim Waugh e87740
   errno = 0;
Tim Waugh e87740
-  if (initgroups (pw->pw_name, pw->pw_gid) == -1)
Tim Waugh e87740
+  if (initgroups (pw->pw_name, pw->pw_gid) == -1) {
Tim Waugh e87740
+#ifdef USE_PAM
Tim Waugh e87740
+    pam_close_session(pamh, 0);
Tim Waugh e87740
+    pam_end(pamh, PAM_ABORT);
Tim Waugh e87740
+#endif
Ondrej Vasik 0363d6
     error (EXIT_FAILURE, errno, _("cannot set groups"));
Tim Waugh e87740
+  }
cvsdist 5adf0d
   endgrent ();
cvsdist 5adf0d
 #endif
cvsdist 5adf0d
   if (setgid (pw->pw_gid))
Tim Waugh d66c4d
@@ -318,6 +413,31 @@
Ondrej Vasik 0363d6
     error (EXIT_FAILURE, errno, _("cannot set user id"));
cvsdist 5adf0d
 }
cvsdist 5adf0d
 
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+static int caught=0;
cvsdist 5adf0d
+/* Signal handler for parent process later */
cvsdist 5adf0d
+static void su_catch_sig(int sig)
cvsdist 5adf0d
+{
cvsdist 5adf0d
+  ++caught;
cvsdist 5adf0d
+}
cvsdist 5adf0d
+
cvsdist 5adf0d
+int
cvsdist 5adf0d
+pam_copyenv (pam_handle_t *pamh)
cvsdist 5adf0d
+{
cvsdist 5adf0d
+  char **env;
cvsdist 5adf0d
+
cvsdist 5adf0d
+  env = pam_getenvlist(pamh);
cvsdist 5adf0d
+  if(env) {
cvsdist 5adf0d
+    while(*env) {
Tim Waugh c3e4c8
+	if (putenv (*env))
Tim Waugh c3e4c8
+	  xalloc_die ();
cvsdist 5adf0d
+	env++;
cvsdist 5adf0d
+    }
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  return(0);
cvsdist 5adf0d
+}
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
+
cvsdist 5adf0d
 /* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
cvsdist 5adf0d
    If COMMAND is nonzero, pass it to the shell with the -c option.
Tim Waugh c3e4c8
    Pass ADDITIONAL_ARGS to the shell as more arguments; there
Tim Waugh d66c4d
@@ -325,17 +445,49 @@
cvsdist 5adf0d
 
cvsdist 5adf0d
 static void
Tim Waugh c3e4c8
 run_shell (char const *shell, char const *command, char **additional_args,
Ondrej Vasik 250517
-           size_t n_additional_args)
Ondrej Vasik 250517
+           size_t n_additional_args, const struct passwd *pw)
cvsdist 5adf0d
 {
Tim Waugh c3e4c8
   size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
Tim Waugh c3e4c8
   char const **args = xnmalloc (n_args, sizeof *args);
Tim Waugh c3e4c8
   size_t argno = 1;
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+  int child;
cvsdist 5adf0d
+  sigset_t ourset;
cvsdist 5adf0d
+  int status;
cvsdist 5adf0d
+
cvsdist 5adf0d
+  retval = pam_open_session(pamh,0);
cvsdist 5adf0d
+  if (retval != PAM_SUCCESS) {
cvsdist 5adf0d
+    fprintf (stderr, "could not open session\n");
cvsdist 5adf0d
+    exit (1);
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+
cvsdist 5adf0d
+/* do this at the last possible moment, because environment variables may
cvsdist 5adf0d
+   be passed even in the session phase
cvsdist 5adf0d
+*/
cvsdist 5adf0d
+  if(pam_copyenv(pamh) != PAM_SUCCESS)
cvsdist 5adf0d
+     fprintf (stderr, "error copying PAM environment\n");
cvsdist 5adf0d
+  
Tim Waugh e87740
+  /* Credentials should be set in the parent */ 
Tim Waugh e87740
+  if (pam_setcred(pamh, PAM_ESTABLISH_CRED) != PAM_SUCCESS) {
Tim Waugh e87740
+    pam_close_session(pamh, 0);
Tim Waugh e87740
+    fprintf(stderr, "could not set PAM credentials\n");
Tim Waugh e87740
+    exit(1);
Tim Waugh e87740
+  }
Tim Waugh e87740
+
cvsdist 5adf0d
+  child = fork();
cvsdist 5adf0d
+  if (child == 0) {  /* child shell */
cvsdist 5adf0d
+  change_identity (pw);
cvsdist 5adf0d
+  pam_end(pamh, 0);
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
 
Tim Waugh c3e4c8
   if (simulate_login)
Tim Waugh c3e4c8
     {
cvsdist 5adf0d
       char *arg0;
cvsdist 5adf0d
       char *shell_basename;
cvsdist 5adf0d
 
cvsdist 5adf0d
+      if(chdir(pw->pw_dir))
cvsdist 5adf0d
+	      error(0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
cvsdist 5adf0d
+
Tim Waugh d66c4d
       shell_basename = last_component (shell);
cvsdist 5adf0d
       arg0 = xmalloc (strlen (shell_basename) + 2);
cvsdist 5adf0d
       arg0[0] = '-';
Tim Waugh d66c4d
@@ -360,6 +512,66 @@
cvsdist 5adf0d
     error (0, errno, "%s", shell);
cvsdist 5adf0d
     exit (exit_status);
cvsdist 5adf0d
   }
cvsdist 5adf0d
+#ifdef USE_PAM
cvsdist 5adf0d
+  } else if (child == -1) {
cvsdist 5adf0d
+      fprintf(stderr, "can not fork user shell: %s", strerror(errno));
Tim Waugh e87740
+      pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT);
Tim Waugh e87740
+      pam_close_session(pamh, 0);
Tim Waugh e87740
+      pam_end(pamh, PAM_ABORT);
cvsdist 5adf0d
+      exit(1);
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  /* parent only */
cvsdist 5adf0d
+  sigfillset(&ourset);
cvsdist 5adf0d
+  if (sigprocmask(SIG_BLOCK, &ourset, NULL)) {
cvsdist 5adf0d
+    fprintf(stderr, "%s: signal malfunction\n", PROGRAM_NAME);
cvsdist 5adf0d
+    caught = 1;
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  if (!caught) {
cvsdist 5adf0d
+    struct sigaction action;
cvsdist 5adf0d
+    action.sa_handler = su_catch_sig;
cvsdist 5adf0d
+    sigemptyset(&action.sa_mask);
cvsdist 5adf0d
+    action.sa_flags = 0;
cvsdist 5adf0d
+    sigemptyset(&ourset);
cvsdist 5adf0d
+    if (sigaddset(&ourset, SIGTERM)
cvsdist 5adf0d
+        || sigaddset(&ourset, SIGALRM)
cvsdist 5adf0d
+        || sigaction(SIGTERM, &action, NULL)
cvsdist 5adf0d
+        || sigprocmask(SIG_UNBLOCK, &ourset, NULL)) {
cvsdist 5adf0d
+      fprintf(stderr, "%s: signal masking malfunction\n", PROGRAM_NAME);
cvsdist 5adf0d
+      caught = 1;
cvsdist 5adf0d
+    }
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  if (!caught) {
cvsdist 5adf0d
+    do {
cvsdist 5adf0d
+      int pid;
cvsdist 5adf0d
+
cvsdist 5adf0d
+      pid = waitpid(-1, &status, WUNTRACED);
cvsdist 5adf0d
+
cvsdist 5adf0d
+      if (WIFSTOPPED(status)) {
cvsdist 5adf0d
+          kill(getpid(), SIGSTOP);
cvsdist 5adf0d
+          /* once we get here, we must have resumed */
cvsdist 5adf0d
+          kill(pid, SIGCONT);
cvsdist 5adf0d
+      }
cvsdist 5adf0d
+    } while (WIFSTOPPED(status));
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+
cvsdist 5adf0d
+  if (caught) {
cvsdist 5adf0d
+    fprintf(stderr, "\nSession terminated, killing shell...");
cvsdist 5adf0d
+    kill (child, SIGTERM);
cvsdist 5adf0d
+  }
Tim Waugh e87740
+  /* Not checking retval on this because we need to call close session */
Tim Waugh e87740
+  pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT);
cvsdist 5adf0d
+  retval = pam_close_session(pamh, 0);
Tim Waugh ee719b
+  PAM_BAIL_P_VOID;
cvsdist 5adf0d
+  retval = pam_end(pamh, PAM_SUCCESS);
Tim Waugh ee719b
+  PAM_BAIL_P_VOID;
cvsdist 5adf0d
+  if (caught) {
cvsdist 5adf0d
+    sleep(2);
cvsdist 5adf0d
+    kill(child, SIGKILL);
cvsdist 5adf0d
+    fprintf(stderr, " ...killed.\n");
cvsdist 5adf0d
+    exit(-1);
cvsdist 5adf0d
+  }
cvsdist 5adf0d
+  exit (WEXITSTATUS(status));
cvsdist 5adf0d
+#endif /* USE_PAM */
cvsdist 5adf0d
 }
cvsdist 5adf0d
 
Tim Waugh c3e4c8
 /* Return true if SHELL is a restricted shell (one not returned by
Tim Waugh d66c4d
@@ -527,9 +739,9 @@
Tim Waugh d66c4d
   shell = xstrdup (shell ? shell : pw->pw_shell);
Tim Waugh d66c4d
   modify_environment (pw, shell);
cvsdist 5adf0d
 
Tim Waugh a2135b
+#ifndef USE_PAM
cvsdist 5adf0d
   change_identity (pw);
Tim Waugh e6a660
-  if (simulate_login && chdir (pw->pw_dir) != 0)
Tim Waugh e6a660
-    error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
cvsdist 5adf0d
+#endif
cvsdist 5adf0d
 
Tim Waugh c3e4c8
-  run_shell (shell, command, argv + optind, MAX (0, argc - optind));
Tim Waugh c3e4c8
+  run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
cvsdist 5adf0d
 }
Tim Waugh d66c4d
--- coreutils-6.7/doc/coreutils.texi.pam	2006-10-27 15:30:48.000000000 +0100
Tim Waugh d66c4d
+++ coreutils-6.7/doc/coreutils.texi	2007-01-09 17:00:01.000000000 +0000
Tim Waugh d66c4d
@@ -13395,8 +13395,11 @@
Tim Waugh d66c4d
 @findex syslog
Tim Waugh d66c4d
 @command{su} can optionally be compiled to use @code{syslog} to report
Tim Waugh d66c4d
 failed, and optionally successful, @command{su} attempts.  (If the system
Tim Waugh d66c4d
-supports @code{syslog}.)  However, GNU @command{su} does not check if the
Tim Waugh d66c4d
-user is a member of the @code{wheel} group; see below.
Tim Waugh d66c4d
+supports @code{syslog}.)
Tim Waugh d66c4d
+
Tim Waugh d66c4d
+This version of @command{su} has support for using PAM for
Tim Waugh d66c4d
+authentication.  You can edit @file{/etc/pam.d/su} to customize its
Tim Waugh d66c4d
+behaviour.
cvsdist 460c93
 
Tim Waugh d66c4d
 The program accepts the following options.  Also see @ref{Common options}.
cvsdist 460c93
 
Ondrej Vasik a7cab6
@@ -12815,6 +12815,8 @@
Ondrej Vasik a7cab6
 @env{PATH} to a compiled-in default value.  Change to @var{user}'s home
Ondrej Vasik a7cab6
 directory.  Prepend @samp{-} to the shell's name, intended to make it
Ondrej Vasik a7cab6
 read its login startup file(s).
Ondrej Vasik a7cab6
+Additionaly @env{DISPLAY} and @env{XAUTHORITY} environment variables 
Ondrej Vasik a7cab6
+are preserved as well for PAM functionality.
Ondrej Vasik a7cab6
Ondrej Vasik a7cab6
 @item -m
Ondrej Vasik a7cab6
 @itemx -p
Tim Waugh d66c4d
@@ -13477,33 +13480,6 @@
Tim Waugh d66c4d
 the exit status of the subshell otherwise
Tim Waugh d66c4d
 @end display
cvsdist 460c93
 
Tim Waugh d66c4d
-@cindex wheel group, not supported
Tim Waugh d66c4d
-@cindex group wheel, not supported
Tim Waugh d66c4d
-@cindex fascism
Tim Waugh d66c4d
-@subsection Why GNU @command{su} does not support the @samp{wheel} group
Tim Waugh d66c4d
-
Tim Waugh d66c4d
-(This section is by Richard Stallman.)
Tim Waugh d66c4d
-
Tim Waugh d66c4d
-@cindex Twenex
Tim Waugh d66c4d
-@cindex MIT AI lab
Tim Waugh d66c4d
-Sometimes a few of the users try to hold total power over all the
Tim Waugh d66c4d
-rest.  For example, in 1984, a few users at the MIT AI lab decided to
Tim Waugh d66c4d
-seize power by changing the operator password on the Twenex system and
Tim Waugh d66c4d
-keeping it secret from everyone else.  (I was able to thwart this coup
Tim Waugh d66c4d
-and give power back to the users by patching the kernel, but I
Tim Waugh d66c4d
-wouldn't know how to do that in Unix.)
Tim Waugh d66c4d
-
Tim Waugh d66c4d
-However, occasionally the rulers do tell someone.  Under the usual
Tim Waugh d66c4d
-@command{su} mechanism, once someone learns the root password who
Tim Waugh d66c4d
-sympathizes with the ordinary users, he or she can tell the rest.  The
Tim Waugh d66c4d
-``wheel group'' feature would make this impossible, and thus cement the
Tim Waugh d66c4d
-power of the rulers.
Tim Waugh d66c4d
-
Tim Waugh d66c4d
-I'm on the side of the masses, not that of the rulers.  If you are
Tim Waugh d66c4d
-used to supporting the bosses and sysadmins in whatever they do, you
Tim Waugh d66c4d
-might find this idea strange at first.
Tim Waugh d66c4d
-
Tim Waugh d66c4d
-
Ondrej Vasik e18e41
 @node timeout invocation
Ondrej Vasik e18e41
 @section @command{timeout}: Run a command with a time limit
cvsdist 460c93
 
Ondrej Vasik 4de88f
--- coreutils-7.1/configure.ac.pam
Ondrej Vasik 4de88f
+++ coreutils-7.1/configure.ac
Ondrej Vasik 0363d6
@@ -44,6 +44,13 @@
Ondrej Vasik 1ef0ec
   AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
Ondrej Vasik 4de88f
 fi
Tim Waugh e87740
 
Tim Waugh e87740
+dnl Give the chance to enable PAM
Tim Waugh e87740
+AC_ARG_ENABLE(pam, dnl
Tim Waugh e87740
+[  --enable-pam              Enable use of the PAM libraries],
Tim Waugh e87740
+[AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM])
Tim Waugh e87740
+LIB_PAM="-ldl -lpam -lpam_misc"
Tim Waugh e87740
+AC_SUBST(LIB_PAM)])
Tim Waugh e87740
+
Ondrej Vasik 0363d6
 AC_FUNC_FORK
Ondrej Vasik 0363d6
Ondrej Vasik 0363d6
 optional_bin_progs=