Ondrej Vasik 0363d6
--- coreutils-6.10/tests/misc/help-version.runuser	
Ondrej Vasik 0363d6
+++ coreutils-6.10/tests/misc/help-version	
Tim Waugh d66c4d
@@ -168,6 +168,7 @@
Tim Waugh d66c4d
 seq_args=10
Tim Waugh d66c4d
 sleep_args=0
Tim Waugh d66c4d
 su_args=--version
Tim Waugh d66c4d
+runuser_args=--version
Tim Waugh d66c4d
 
Tim Waugh d66c4d
 # I'd rather not run sync, since it spins up disks that I've
Tim Waugh d66c4d
 # deliberately caused to spin down (but not unmounted).
Ondrej Vasik 0363d6
--- coreutils-6.10/README.runuser	
Ondrej Vasik 0363d6
+++ coreutils-6.10/README	
Ondrej Vasik 0363d6
@@ -11,8 +11,8 @@
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 0363d6
-  sleep sort split stat stty su sum sync tac tail tee test touch tr true
Ondrej Vasik 0363d6
+  runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
Ondrej Vasik 0363d6
+  shuf sleep sort split stat stty su sum sync tac tail tee test touch tr true
Ondrej Vasik 0363d6
   tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
Ondrej Vasik 0363d6
Ondrej Vasik 0363d6
 See the file NEWS for a list of major changes in the current release.
Tim Waugh d66c4d
--- coreutils-6.7/src/su.c.runuser	2007-01-09 17:27:56.000000000 +0000
Tim Waugh d66c4d
+++ coreutils-6.7/src/su.c	2007-01-09 17:30:12.000000000 +0000
Tim Waugh d66c4d
@@ -110,9 +110,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>
Tim Waugh d66c4d
@@ -150,6 +156,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 ();
Tim Waugh d66c4d
@@ -157,7 +167,11 @@
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
Tim Waugh d66c4d
@@ -187,6 +201,10 @@
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}
Tim Waugh d66c4d
@@ -288,10 +306,12 @@
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) {
Tim Waugh d66c4d
@@ -308,6 +328,11 @@
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);
Tim Waugh d66c4d
@@ -317,6 +342,7 @@
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 */
Tim Waugh d66c4d
@@ -398,11 +424,22 @@
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);
Tim Waugh d66c4d
@@ -449,7 +486,11 @@
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);
Tim Waugh d66c4d
@@ -480,7 +521,11 @@
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 ();
Tim Waugh d66c4d
@@ -657,6 +702,12 @@
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);
Tim Waugh dfdbf3
   program_name = argv[0];
Tim Waugh d66c4d
@@ -671,7 +722,11 @@
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
 	{
Tim Waugh d66c4d
@@ -701,6 +756,28 @@
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);
Tim Waugh d66c4d
@@ -739,7 +816,20 @@
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);
Tim Waugh d66c4d
@@ -771,8 +861,16 @@
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 0363d6
--- coreutils-6.10/src/Makefile.am.runuser	
Ondrej Vasik 0363d6
+++ coreutils-6.10/src/Makefile.am	
Ondrej Vasik 0363d6
@@ -38,7 +38,7 @@
Ondrej Vasik 0363d6
   shuf sort split sum tac tail tr tsort unexpand uniq wc \
Ondrej Vasik 0363d6
   basename date dirname echo env expr factor false \
Ondrej Vasik 0363d6
   id kill logname pathchk printenv printf pwd \
Ondrej Vasik 0363d6
-  runcon seq sleep tee \
Ondrej Vasik 0363d6
+  runcon runuser seq sleep tee \
Ondrej Vasik 0363d6
   test true tty whoami yes \
Ondrej Vasik 0363d6
   base64
Ondrej Vasik 0363d6
Tim Waugh d66c4d
@@ -112,6 +112,10 @@
Tim Waugh d66c4d
 mv_LDADD += $(LIB_ACL)
Tim Waugh d66c4d
 ginstall_LDADD += $(LIB_ACL)
Tim Waugh c3e4c8
 
Tim Waugh 2190ea
+runuser_SOURCES = su.c
Tim Waugh 2190ea
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
Tim Waugh 2190ea
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
Tim Waugh 2190ea
+
Tim Waugh c3e4c8
 $(PROGRAMS): ../lib/libcoreutils.a
Tim Waugh c3e4c8
 
Tim Waugh 7a87ac
 SUFFIXES = .sh
Tim Waugh d66c4d
@@ -126,7 +130,7 @@
Tim Waugh c3e4c8
 	chmod +x $@-t
Tim Waugh c3e4c8
 	mv $@-t $@
Tim Waugh c3e4c8
 
Tim Waugh c3e4c8
-all-local: su$(EXEEXT)
Tim Waugh c3e4c8
+all-local: su$(EXEEXT) runuser
Tim Waugh c3e4c8
 
Tim Waugh c3e4c8
 installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
Tim Waugh c3e4c8
 
Ondrej Vasik 0363d6
--- coreutils-6.10/AUTHORS.runuser
Ondrej Vasik 0363d6
+++ coreutils-6.10/AUTHORS	
Tim Waugh 7a87ac
@@ -60,6 +60,7 @@
Tim Waugh c3e4c8
 readlink: Dmitry V. Levin
Tim Waugh c3e4c8
 rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
Tim Waugh c3e4c8
 rmdir: David MacKenzie
Tim Waugh c3e4c8
+runuser: David MacKenzie, Dan Walsh
Ondrej Vasik 0363d6
 runcon: Russell Coker
Tim Waugh c3e4c8
 seq: Ulrich Drepper
Tim Waugh 7a87ac
 sha1sum: Ulrich Drepper, Scott Miller, David Madore
Ondrej Vasik 0363d6
--- coreutils-6.10/man/Makefile.am.runuser
Ondrej Vasik 0363d6
+++ coreutils-6.10/man/Makefile.am
Ondrej Vasik 0363d6
@@ -92,6 +92,7 @@
Ondrej Vasik 0363d6
 rm.1:		$(common_dep)	$(srcdir)/rm.x		../src/rm.c
Ondrej Vasik 0363d6
 rmdir.1:	$(common_dep)	$(srcdir)/rmdir.x	../src/rmdir.c
Ondrej Vasik 0363d6
 runcon.1:	$(common_dep)	$(srcdir)/runcon.x	../src/runcon.c
Ondrej Vasik 0363d6
+runuser.1:	$(common_dep)	$(srcdir)/runuser.x	../src/su.c
Ondrej Vasik 0363d6
 seq.1:		$(common_dep)	$(srcdir)/seq.x		../src/seq.c
Ondrej Vasik 0363d6
 sha1sum.1:	$(common_dep)	$(srcdir)/sha1sum.x	../src/md5sum.c
Ondrej Vasik 0363d6
 sha224sum.1:	$(common_dep)	$(srcdir)/sha224sum.x	../src/md5sum.c
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
Tim Waugh 7a87ac
@@ -0,0 +1,4 @@
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
Tim Waugh d66c4d
--- /dev/null	2007-01-09 09:38:07.860075128 +0000
Ondrej Vasik 0363d6
+++ coreutils-6.10/man/runuser.1	2007-01-09 17:27:56.000000000 +0000
Tim Waugh 0c6929
@@ -0,0 +1,68 @@
Tim Waugh 7a87ac
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33.
Tim Waugh 7a87ac
+.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
Tim Waugh 7a87ac
+.SH NAME
Tim Waugh ee5475
+runuser \- run a shell with substitute user and group IDs, similar to su, but will not run PAM hooks
Tim Waugh 7a87ac
+.SH SYNOPSIS
Tim Waugh 7a87ac
+.B runuser
Tim Waugh 7a87ac
+[\fIOPTION\fR]... [\fI-\fR] [\fIUSER \fR[\fIARG\fR]...]
Tim Waugh 7a87ac
+.SH DESCRIPTION
Tim Waugh 7a87ac
+.\" Add any additional description here
Tim Waugh 7a87ac
+.PP
Tim Waugh ee5475
+Change the effective user id and group id to that of USER.  No PAM hooks
Tim Waugh ee5475
+are run, and there will be no password prompt.  This command is useful
Tim Waugh ee5475
+when run as the root user.  If run as a non-root user without privilege
Tim Waugh ee5475
+to set user ID, the command will fail.
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+-, \fB\-l\fR, \fB\-\-login\fR
Ondrej Vasik 0363d6
+make the shell a login shell, uses runuser-l PAM file instead of default one.
Tim Waugh 7a87ac
+.TP
Ondrej Vasik d47655
+\fB\-c\fR, \fB\-\-command\fR=\fICOMMAND\fR
Tim Waugh 7a87ac
+pass a single COMMAND to the shell with \fB\-c\fR
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+\fB\-f\fR, \fB\-\-fast\fR
Tim Waugh 7a87ac
+pass \fB\-f\fR to the shell (for csh or tcsh)
Tim Waugh 7a87ac
+.TP
Tim Waugh 0c6929
+\fB\-g\fR, \fB\-\-group\fR=\fIGROUP\fR
Tim Waugh 0c6929
+specify the primary group
Tim Waugh 0c6929
+.TP
Tim Waugh 0c6929
+\fB\-G\fR, \fB\-\-supp-group\fR=\fIGROUP\fR
Tim Waugh 0c6929
+specify a supplemental group
Tim Waugh 0c6929
+.TP
Tim Waugh 7a87ac
+\fB\-m\fR, \fB\-\-preserve\-environment\fR
Tim Waugh 7a87ac
+do not reset environment variables
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+\fB\-p\fR
Tim Waugh 7a87ac
+same as \fB\-m\fR
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+\fB\-s\fR, \fB\-\-shell\fR=\fISHELL\fR
Tim Waugh 7a87ac
+run SHELL if /etc/shells allows it
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+\fB\-\-help\fR
Tim Waugh 7a87ac
+display this help and exit
Tim Waugh 7a87ac
+.TP
Tim Waugh 7a87ac
+\fB\-\-version\fR
Tim Waugh 7a87ac
+output version information and exit
Tim Waugh 7a87ac
+.PP
Tim Waugh 7a87ac
+A mere - implies \fB\-l\fR.   If USER not given, assume root.
Tim Waugh 7a87ac
+.SH AUTHOR
Tim Waugh 7a87ac
+Written by David MacKenzie, Dan Walsh.
Tim Waugh 7a87ac
+.SH "REPORTING BUGS"
Tim Waugh 7a87ac
+Report bugs to <bug-coreutils@gnu.org>.
Tim Waugh 7a87ac
+.SH COPYRIGHT
Tim Waugh 7a87ac
+Copyright \(co 2004 Free Software Foundation, Inc.
Tim Waugh 7a87ac
+.br
Tim Waugh 7a87ac
+This is free software; see the source for copying conditions.  There is NO
Tim Waugh 7a87ac
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Tim Waugh 7a87ac
+.SH "SEE ALSO"
Tim Waugh 7a87ac
+Since this command is trimmed down version of su use you can use the su manual.
Tim Waugh 7a87ac
+The full documentation for
Tim Waugh 7a87ac
+.B su
Tim Waugh 7a87ac
+is maintained as a Texinfo manual.  If the
Tim Waugh 7a87ac
+.B info
Tim Waugh 7a87ac
+and
Tim Waugh 7a87ac
+.B su
Tim Waugh 7a87ac
+programs are properly installed at your site, the command
Tim Waugh 7a87ac
+.IP
Tim Waugh 7a87ac
+.B info coreutils su
Tim Waugh 7a87ac
+.PP
Tim Waugh 7a87ac
+should give you access to the complete manual.