Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/AUTHORS coreutils-6.12/AUTHORS
Ondrej Vasik 893c38
--- coreutils-6.12-orig/AUTHORS	2008-10-21 14:58:31.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/AUTHORS	2008-10-21 15:00:05.000000000 +0200
Ondrej Vasik 893c38
@@ -63,6 +63,7 @@ pwd: Jim Meyering
Ondrej Vasik 893c38
 readlink: Dmitry V. Levin
Ondrej Vasik e18e41
 rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
Ondrej Vasik 893c38
 rmdir: David MacKenzie
Ondrej Vasik 893c38
+runuser: David MacKenzie, Dan Walsh
Ondrej Vasik 893c38
 runcon: Russell Coker
Ondrej Vasik 893c38
 seq: Ulrich Drepper
Ondrej Vasik 893c38
 sha1sum: Ulrich Drepper, Scott Miller, David Madore
Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/man/Makefile.am coreutils-6.12/man/Makefile.am
Ondrej Vasik 893c38
--- coreutils-6.12-orig/man/Makefile.am	2008-05-06 11:28:24.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/man/Makefile.am	2008-10-21 15:00:13.000000000 +0200
Ondrej Vasik 893c38
@@ -93,6 +93,7 @@ readlink.1:	$(common_dep)	$(srcdir)/read
Ondrej Vasik 893c38
 rm.1:		$(common_dep)	$(srcdir)/rm.x		../src/rm.c
Ondrej Vasik 893c38
 rmdir.1:	$(common_dep)	$(srcdir)/rmdir.x	../src/rmdir.c
Ondrej Vasik 893c38
 runcon.1:	$(common_dep)	$(srcdir)/runcon.x	../src/runcon.c
Ondrej Vasik 893c38
+runuser.1:	$(common_dep)	$(srcdir)/runuser.x	../src/su.c
Ondrej Vasik 893c38
 seq.1:		$(common_dep)	$(srcdir)/seq.x		../src/seq.c
Ondrej Vasik 893c38
 sha1sum.1:	$(common_dep)	$(srcdir)/sha1sum.x	../src/md5sum.c
Ondrej Vasik 893c38
 sha224sum.1:	$(common_dep)	$(srcdir)/sha224sum.x	../src/md5sum.c
Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/README coreutils-6.12/README
Ondrej Vasik 893c38
--- coreutils-6.12-orig/README	2008-05-15 20:44:37.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/README	2008-10-21 14:59:29.000000000 +0200
Ondrej Vasik e18e41
@@ -12,10 +12,10 @@ The programs that can be built with this
Ondrej Vasik 0363d6
   factor false fmt fold groups head hostid hostname id install join kill
Ondrej Vasik 0363d6
   link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
Ondrej Vasik 0363d6
   od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
Ondrej Vasik 0363d6
-  runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
Ondrej Vasik e18e41
-  sleep sort split stat stty su sum sync tac tail tee test timeout touch tr
Ondrej Vasik e18e41
-  true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who
Ondrej Vasik e18e41
-  whoami yes
Ondrej Vasik 0363d6
+  runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
Ondrej Vasik e18e41
+  shuf sleep sort split stat stty su sum sync tac tail tee test timeout touch
Ondrej Vasik e18e41
+  tr true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc
Ondrej Vasik e18e41
+  who whoami yes
Ondrej Vasik 893c38
 
Ondrej Vasik 0363d6
 See the file NEWS for a list of major changes in the current release.
Ondrej Vasik e18e41
 
Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/src/Makefile.am coreutils-6.12/src/Makefile.am
Ondrej Vasik 893c38
--- coreutils-6.12-orig/src/Makefile.am	2008-10-21 14:58:31.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/src/Makefile.am	2008-10-21 14:59:58.000000000 +0200
Ondrej Vasik 893c38
@@ -38,7 +38,7 @@ EXTRA_PROGRAMS = \
Ondrej Vasik 893c38
   shuf sort split sum tac tail tr tsort unexpand uniq wc \
Ondrej Vasik 893c38
   basename date dirname echo env expr factor false \
Ondrej Vasik 893c38
   id kill logname pathchk printenv printf pwd \
Ondrej Vasik 893c38
-  runcon seq sleep tee \
Ondrej Vasik 893c38
+  runcon runuser seq sleep tee \
Ondrej Vasik e18e41
   test timeout true truncate tty whoami yes \
Ondrej Vasik 893c38
   base64
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
@@ -142,6 +142,10 @@ cp_LDADD += $(LIB_ACL)
Ondrej Vasik 893c38
 mv_LDADD += $(LIB_ACL)
Ondrej Vasik 893c38
 ginstall_LDADD += $(LIB_ACL)
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
+runuser_SOURCES = su.c
Ondrej Vasik 893c38
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
Ondrej Vasik 893c38
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
Ondrej Vasik 893c38
+
Ondrej Vasik 893c38
 stat_LDADD = $(LDADD) $(LIB_SELINUX)
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
 # Append $(LIBICONV) to each program that uses proper_name_utf8.
Ondrej Vasik 893c38
@@ -159,7 +163,7 @@ RELEASE_YEAR = \
Ondrej Vasik 893c38
   `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
Ondrej Vasik 893c38
     $(top_srcdir)/lib/version-etc.c`
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
-all-local: su$(EXEEXT)
Ondrej Vasik 893c38
+all-local: su$(EXEEXT) runuser
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
 installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
Ondrej Vasik 893c38
 
Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/src/su.c coreutils-6.12/src/su.c
Ondrej Vasik 893c38
--- coreutils-6.12-orig/src/su.c	2008-10-21 14:58:31.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/src/su.c	2008-10-21 15:07:05.000000000 +0200
Ondrej Vasik 893c38
@@ -109,9 +109,15 @@
Tim Waugh 2190ea
 #include "error.h"
Tim Waugh 2190ea
 
Tim Waugh c3e4c8
 /* The official name of this program (e.g., no `g' prefix).  */
Tim Waugh 2190ea
+#ifndef RUNUSER
Tim Waugh c3e4c8
 #define PROGRAM_NAME "su"
Tim Waugh 2190ea
+#else
Tim Waugh 2190ea
+#define PROGRAM_NAME "runuser"
Tim Waugh 2190ea
+#endif
Tim Waugh c3e4c8
 
Tim Waugh c3e4c8
+#ifndef AUTHORS
Ondrej Vasik 5f9af7
 #define AUTHORS proper_name ("David MacKenzie")
Tim Waugh c3e4c8
+#endif
Tim Waugh c3e4c8
 
Tim Waugh c3e4c8
 #if HAVE_PATHS_H
Tim Waugh c3e4c8
 # include <paths.h>
Ondrej Vasik 893c38
@@ -149,6 +155,10 @@
Tim Waugh c3e4c8
 #ifndef USE_PAM
Tim Waugh c3e4c8
 char *crypt ();
Tim Waugh c3e4c8
 #endif
Tim Waugh c3e4c8
+#ifndef CHECKPASSWD
Tim Waugh c3e4c8
+#define CHECKPASSWD 1
Tim Waugh c3e4c8
+#endif
Tim Waugh c3e4c8
+
Tim Waugh c3e4c8
 char *getusershell ();
Tim Waugh c3e4c8
 void endusershell ();
Tim Waugh d66c4d
 void setusershell ();
Ondrej Vasik 893c38
@@ -156,7 +166,11 @@ void setusershell ();
Tim Waugh dfdbf3
 extern char **environ;
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
 static void run_shell (char const *, char const *, char **, size_t,
Tim Waugh dfdbf3
-	const struct passwd *)
Tim Waugh dfdbf3
+	const struct passwd *
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+		       , gid_t *groups, int num_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+	)
Tim Waugh dfdbf3
 #ifdef USE_PAM
Tim Waugh dfdbf3
 	;
Tim Waugh dfdbf3
 #else
Ondrej Vasik 893c38
@@ -186,6 +200,10 @@ static struct option const longopts[] =
Tim Waugh dfdbf3
   {"login", no_argument, NULL, 'l'},
Tim Waugh dfdbf3
   {"preserve-environment", no_argument, NULL, 'p'},
Tim Waugh dfdbf3
   {"shell", required_argument, NULL, 's'},
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+  {"group", required_argument, NULL, 'g'},
Tim Waugh dfdbf3
+  {"supp-group", required_argument, NULL, 'G'},
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
   {GETOPT_HELP_OPTION_DECL},
Tim Waugh dfdbf3
   {GETOPT_VERSION_OPTION_DECL},
Tim Waugh dfdbf3
   {NULL, 0, NULL, 0}
Ondrej Vasik 893c38
@@ -287,10 +305,12 @@ correct_password (const struct passwd *p
Tim Waugh 2190ea
   retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
Tim Waugh 2190ea
   PAM_BAIL_P;
Tim Waugh 2190ea
 
Tim Waugh 2190ea
+#ifndef RUNUSER
Tim Waugh 2190ea
   if (getuid() != 0 && !isatty(0)) {
Tim Waugh 2190ea
 	fprintf(stderr, "standard in must be a tty\n");
Tim Waugh 2190ea
 	exit(1);
Tim Waugh 2190ea
   }
Tim Waugh 2190ea
+#endif
Tim Waugh 2190ea
 
Tim Waugh 2190ea
   caller = getpwuid(getuid());
Tim Waugh 2190ea
   if(caller != NULL && caller->pw_name != NULL) {
Ondrej Vasik 893c38
@@ -307,6 +327,11 @@ correct_password (const struct passwd *p
Tim Waugh 2190ea
     retval = pam_set_item(pamh, PAM_TTY, tty_name);
Tim Waugh 2190ea
     PAM_BAIL_P;
Tim Waugh 2190ea
   }
Tim Waugh 2190ea
+#ifdef RUNUSER
Tim Waugh 2190ea
+  if (getuid() != geteuid())
Tim Waugh 2190ea
+    /* safety net: deny operation if we are suid by accident */
Ondrej Vasik 0363d6
+    error(EXIT_FAILURE, 1, "runuser may not be setuid");
Tim Waugh 2190ea
+#else
Tim Waugh 2190ea
   retval = pam_authenticate(pamh, 0);
Tim Waugh 2190ea
   PAM_BAIL_P;
Tim Waugh 2190ea
   retval = pam_acct_mgmt(pamh, 0);
Ondrej Vasik 893c38
@@ -316,6 +341,7 @@ correct_password (const struct passwd *p
Tim Waugh 2190ea
     PAM_BAIL_P;
Tim Waugh 2190ea
   }
Tim Waugh 2190ea
   PAM_BAIL_P;
Tim Waugh 2190ea
+#endif
Tim Waugh 2190ea
   /* must be authenticated if this point was reached */
Tim Waugh 2190ea
   return 1;
Tim Waugh 2190ea
 #else /* !USE_PAM */
Ondrej Vasik 893c38
@@ -397,11 +423,22 @@ modify_environment (const struct passwd 
Tim Waugh dfdbf3
 /* Become the user and group(s) specified by PW.  */
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
 static void
Tim Waugh dfdbf3
-change_identity (const struct passwd *pw)
Tim Waugh dfdbf3
+change_identity (const struct passwd *pw
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+		 , gid_t *groups, int num_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+	)
Tim Waugh dfdbf3
 {
Tim Waugh dfdbf3
 #ifdef HAVE_INITGROUPS
Tim Waugh dfdbf3
+  int rc = 0;
Tim Waugh dfdbf3
   errno = 0;
Tim Waugh dfdbf3
-  if (initgroups (pw->pw_name, pw->pw_gid) == -1) {
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+  if (num_groups)
Tim Waugh dfdbf3
+    rc = setgroups(num_groups, groups);
Tim Waugh dfdbf3
+  else
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+    rc = initgroups(pw->pw_name, pw->pw_gid);
Tim Waugh dfdbf3
+  if (rc == -1) {
Tim Waugh dfdbf3
 #ifdef USE_PAM
Tim Waugh dfdbf3
     pam_close_session(pamh, 0);
Tim Waugh dfdbf3
     pam_end(pamh, PAM_ABORT);
Ondrej Vasik 893c38
@@ -448,7 +485,11 @@ pam_copyenv (pam_handle_t *pamh)
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
 static void
Tim Waugh dfdbf3
 run_shell (char const *shell, char const *command, char **additional_args,
Tim Waugh dfdbf3
-	   size_t n_additional_args, const struct passwd *pw)
Tim Waugh dfdbf3
+	   size_t n_additional_args, const struct passwd *pw
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+	   , gid_t *groups, int num_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+	)
Tim Waugh dfdbf3
 {
Tim Waugh dfdbf3
   size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
Tim Waugh dfdbf3
   char const **args = xnmalloc (n_args, sizeof *args);
Ondrej Vasik 893c38
@@ -479,7 +520,11 @@ run_shell (char const *shell, char const
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
   child = fork();
Tim Waugh dfdbf3
   if (child == 0) {  /* child shell */
Tim Waugh dfdbf3
-  change_identity (pw);
Tim Waugh dfdbf3
+  change_identity (pw
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+		   , groups, num_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+	  );
Tim Waugh dfdbf3
   pam_end(pamh, 0);
Tim Waugh dfdbf3
   if (!same_session)
Tim Waugh dfdbf3
     setsid ();
Ondrej Vasik 893c38
@@ -623,6 +668,26 @@ usage (int status)
Ondrej Vasik 893c38
   else
Ondrej Vasik 893c38
     {
Ondrej Vasik 893c38
       printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
Ondrej Vasik 893c38
+#ifdef RUNUSER
Ondrej Vasik 893c38
+      fputs (_("\
Ondrej Vasik 893c38
+Change the effective user id and group id to that of USER.  No PAM hooks\n\
Ondrej Vasik 893c38
+are run, and there will be no password prompt.  This command is useful\n\
Ondrej Vasik 893c38
+when run as the root user.  If run as a non-root user without privilege\n\
Ondrej Vasik 893c38
+to set user ID, the command will fail.\n\
Ondrej Vasik 893c38
+\n\
Ondrej Vasik 893c38
+  -, -l, --login               make the shell a login shell, uses runuser-l\n\
Ondrej Vasik 893c38
+                               PAM file instead of default one\n\
Ondrej Vasik 893c38
+  -g --group=group             specify the primary group\n\
Ondrej Vasik 893c38
+  -G --supp-group=group        specify a supplemental group\n\
Ondrej Vasik 893c38
+  -c, --command=COMMAND        pass a single COMMAND to the shell with -c\n\
Ondrej Vasik 893c38
+  --session-command=COMMAND    pass a single COMMAND to the shell with -c\n\
Ondrej Vasik 893c38
+                               and do not create a new session\n\
Ondrej Vasik 893c38
+  -f, --fast                   pass -f to the shell (for csh or tcsh)\n\
Ondrej Vasik 893c38
+  -m, --preserve-environment   do not reset environment variables\n\
Ondrej Vasik 893c38
+  -p                           same as -m\n\
Ondrej Vasik 893c38
+  -s, --shell=SHELL            run SHELL if /etc/shells allows it\n\
Ondrej Vasik 893c38
+"), stdout);
Ondrej Vasik 893c38
+#else
Ondrej Vasik 893c38
       fputs (_("\
Ondrej Vasik 893c38
 Change the effective user id and group id to that of USER.\n\
Ondrej Vasik 893c38
 \n\
Ondrej Vasik 893c38
@@ -635,6 +700,7 @@ Change the effective user id and group i
Ondrej Vasik 893c38
   -p                           same as -m\n\
Ondrej Vasik 893c38
   -s, --shell=SHELL            run SHELL if /etc/shells allows it\n\
Ondrej Vasik 893c38
 "), stdout);
Ondrej Vasik 893c38
+#endif
Ondrej Vasik 893c38
       fputs (HELP_OPTION_DESCRIPTION, stdout);
Ondrej Vasik 893c38
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
Ondrej Vasik 893c38
       fputs (_("\
Ondrej Vasik 893c38
@@ -656,6 +722,12 @@ main (int argc, char **argv)
Tim Waugh dfdbf3
   char *shell = NULL;
Tim Waugh dfdbf3
   struct passwd *pw;
Tim Waugh dfdbf3
   struct passwd pw_copy;
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+  struct group *gr;
Tim Waugh dfdbf3
+  gid_t groups[NGROUPS_MAX];
Tim Waugh dfdbf3
+  int num_supp_groups = 0;
Tim Waugh dfdbf3
+  int use_gid = 0;
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
   initialize_main (&argc, &argv);
Ondrej Vasik e18e41
   set_program_name (argv[0]);
Ondrej Vasik 893c38
@@ -670,7 +742,11 @@ main (int argc, char **argv)
Tim Waugh dfdbf3
   simulate_login = false;
Tim Waugh dfdbf3
   change_environment = true;
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
-  while ((optc = getopt_long (argc, argv, "c:flmps:", longopts, NULL)) != -1)
Tim Waugh dfdbf3
+  while ((optc = getopt_long (argc, argv, "c:flmps:"
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+			      "g:G:"
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+			      , longopts, NULL)) != -1)
Tim Waugh dfdbf3
     {
Tim Waugh dfdbf3
       switch (optc)
Tim Waugh dfdbf3
 	{
Ondrej Vasik 893c38
@@ -700,6 +776,28 @@ main (int argc, char **argv)
Tim Waugh dfdbf3
 	  shell = optarg;
Tim Waugh dfdbf3
 	  break;
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+	case 'g':
Tim Waugh dfdbf3
+	  gr = getgrnam(optarg);
Tim Waugh dfdbf3
+	  if (!gr)
Ondrej Vasik 0363d6
+	    error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
Tim Waugh dfdbf3
+	  use_gid = 1;
Tim Waugh dfdbf3
+	  groups[0] = gr->gr_gid;
Tim Waugh dfdbf3
+	  break;
Tim Waugh dfdbf3
+
Tim Waugh dfdbf3
+	case 'G':
Tim Waugh dfdbf3
+	  num_supp_groups++;
Tim Waugh dfdbf3
+	  if (num_supp_groups >= NGROUPS_MAX)
Ondrej Vasik 0363d6
+	    error (EXIT_FAILURE, 0,
Tim Waugh dfdbf3
+		   _("Can't specify more than %d supplemental groups"),
Tim Waugh dfdbf3
+		   NGROUPS_MAX - 1);
Tim Waugh dfdbf3
+	  gr = getgrnam(optarg);
Tim Waugh dfdbf3
+	  if (!gr)
Ondrej Vasik 0363d6
+	    error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
Tim Waugh dfdbf3
+	  groups[num_supp_groups] = gr->gr_gid;
Tim Waugh dfdbf3
+	  break;
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+
Tim Waugh dfdbf3
 	case_GETOPT_HELP_CHAR;
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
 	case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
Ondrej Vasik 893c38
@@ -738,7 +836,20 @@ main (int argc, char **argv)
Tim Waugh c3e4c8
 			  : DEFAULT_SHELL);
Tim Waugh c3e4c8
   endpwent ();
Tim Waugh c3e4c8
 
Tim Waugh c3e4c8
-  if (!correct_password (pw))
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+  if (num_supp_groups && !use_gid)
Tim Waugh dfdbf3
+  {
Tim Waugh dfdbf3
+    pw->pw_gid = groups[1];
Tim Waugh dfdbf3
+    memmove (groups, groups + 1, sizeof(gid_t) * num_supp_groups);
Tim Waugh dfdbf3
+  }
Tim Waugh dfdbf3
+  else if (use_gid)
Tim Waugh dfdbf3
+  {
Tim Waugh dfdbf3
+    pw->pw_gid = groups[0];
Tim Waugh dfdbf3
+    num_supp_groups++;
Tim Waugh dfdbf3
+  }
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+
Tim Waugh c3e4c8
+  if (CHECKPASSWD && !correct_password (pw))
Tim Waugh c3e4c8
     {
Tim Waugh c3e4c8
 #ifdef SYSLOG_FAILURE
Tim Waugh c3e4c8
       log_su (pw, false);
Ondrej Vasik 893c38
@@ -770,8 +881,16 @@ main (int argc, char **argv)
Tim Waugh dfdbf3
   modify_environment (pw, shell);
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
 #ifndef USE_PAM
Tim Waugh dfdbf3
-  change_identity (pw);
Tim Waugh dfdbf3
+  change_identity (pw
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+		   , groups, num_supp_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+		   );
Tim Waugh dfdbf3
 #endif
Tim Waugh dfdbf3
 
Tim Waugh dfdbf3
-  run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
Tim Waugh dfdbf3
+  run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw
Tim Waugh dfdbf3
+#ifdef RUNUSER
Tim Waugh dfdbf3
+	     , groups, num_supp_groups
Tim Waugh dfdbf3
+#endif
Tim Waugh dfdbf3
+	     );
Tim Waugh dfdbf3
 }
Ondrej Vasik 893c38
diff -urNp coreutils-6.12-orig/tests/misc/help-version coreutils-6.12/tests/misc/help-version
Ondrej Vasik 893c38
--- coreutils-6.12-orig/tests/misc/help-version	2008-05-27 13:39:18.000000000 +0200
Ondrej Vasik 893c38
+++ coreutils-6.12/tests/misc/help-version	2008-10-21 14:59:16.000000000 +0200
Ondrej Vasik 893c38
@@ -146,6 +146,7 @@ printf_args=foo
Ondrej Vasik 893c38
 seq_args=10
Ondrej Vasik 893c38
 sleep_args=0
Ondrej Vasik 893c38
 su_args=--version
Ondrej Vasik 893c38
+runuser_args=--version
Ondrej Vasik e18e41
 timeout_args=--version
Tim Waugh c3e4c8
 
Ondrej Vasik 893c38
 # I'd rather not run sync, since it spins up disks that I've
Tim Waugh d66c4d
--- /dev/null	2007-01-09 09:38:07.860075128 +0000
Tim Waugh d66c4d
+++ coreutils-6.7/man/runuser.x	2007-01-09 17:27:56.000000000 +0000
Ondrej Vasik 893c38
@@ -0,0 +1,12 @@
Tim Waugh 7a87ac
+[NAME]
Tim Waugh 7a87ac
+runuser \- run a shell with substitute user and group IDs
Tim Waugh 7a87ac
+[DESCRIPTION]
Tim Waugh 7a87ac
+.\" Add any additional description here
Ondrej Vasik 893c38
+[SEE ALSO]
Tim Waugh 7a87ac
+.TP
Ondrej Vasik 893c38
+More detailed Texinfo documentation could be found by command
Tim Waugh 7a87ac
+.TP
Ondrej Vasik 893c38
+\t\fBinfo su invocation\fR\t
Tim Waugh 7a87ac
+.TP
Ondrej Vasik 893c38
+since the command \fBrunuser\fR is trimmed down version of command \fBrunuser\fR.
Tim Waugh 7a87ac
+.br