1ba26ca
--- /dev/null	2004-09-30 04:21:43.103661032 -0400
1ba26ca
+++ coreutils-5.2.1/man/runuser.1	2004-10-05 09:56:25.919169327 -0400
8d758e5
@@ -0,0 +1,59 @@
8d758e5
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33.
8d758e5
+.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
8d758e5
+.SH NAME
8d758e5
+runuser \- run a shell with substitute user and group IDs, similar to su, but will not prompt for password.
8d758e5
+.SH SYNOPSIS
8d758e5
+.B runuser
8d758e5
+[\fIOPTION\fR]... [\fI-\fR] [\fIUSER \fR[\fIARG\fR]...]
8d758e5
+.SH DESCRIPTION
8d758e5
+.\" Add any additional description here
8d758e5
+.PP
8d758e5
+Change the effective user id and group id to that of USER.
8d758e5
+.TP
8d758e5
+-, \fB\-l\fR, \fB\-\-login\fR
8d758e5
+make the shell a login shell
8d758e5
+.TP
8d758e5
+\fB\-c\fR, \fB\-\-commmand\fR=\fICOMMAND\fR
8d758e5
+pass a single COMMAND to the shell with \fB\-c\fR
8d758e5
+.TP
8d758e5
+\fB\-f\fR, \fB\-\-fast\fR
8d758e5
+pass \fB\-f\fR to the shell (for csh or tcsh)
8d758e5
+.TP
8d758e5
+\fB\-m\fR, \fB\-\-preserve\-environment\fR
8d758e5
+do not reset environment variables
8d758e5
+.TP
8d758e5
+\fB\-p\fR
8d758e5
+same as \fB\-m\fR
8d758e5
+.TP
8d758e5
+\fB\-s\fR, \fB\-\-shell\fR=\fISHELL\fR
8d758e5
+run SHELL if /etc/shells allows it
8d758e5
+.TP
8d758e5
+\fB\-\-help\fR
8d758e5
+display this help and exit
8d758e5
+.TP
8d758e5
+\fB\-\-version\fR
8d758e5
+output version information and exit
8d758e5
+.PP
8d758e5
+A mere - implies \fB\-l\fR.   If USER not given, assume root.
8d758e5
+.SH AUTHOR
8d758e5
+Written by David MacKenzie, Dan Walsh.
8d758e5
+.SH "REPORTING BUGS"
8d758e5
+Report bugs to <bug-coreutils@gnu.org>.
8d758e5
+.SH COPYRIGHT
8d758e5
+Copyright \(co 2004 Free Software Foundation, Inc.
8d758e5
+.br
8d758e5
+This is free software; see the source for copying conditions.  There is NO
8d758e5
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8d758e5
+.SH "SEE ALSO"
8d758e5
+Since this command is trimmed down version of su use you can use the su manual.
8d758e5
+The full documentation for
8d758e5
+.B su
8d758e5
+is maintained as a Texinfo manual.  If the
8d758e5
+.B info
8d758e5
+and
8d758e5
+.B su
8d758e5
+programs are properly installed at your site, the command
8d758e5
+.IP
8d758e5
+.B info coreutils su
8d758e5
+.PP
8d758e5
+should give you access to the complete manual.
1ba26ca
--- coreutils-5.2.1/man/Makefile.am.runuser	2004-01-23 10:54:23.000000000 -0500
1ba26ca
+++ coreutils-5.2.1/man/Makefile.am	2004-10-05 09:56:25.921169102 -0400
8d758e5
@@ -7,7 +7,7 @@
8d758e5
   link.1 ln.1 logname.1 \
8d758e5
   ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
8d758e5
   paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
8d758e5
-  rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \
8d758e5
+  rm.1 rmdir.1 runuser.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \
8d758e5
   su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
8d758e5
   tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \
8d758e5
   who.1 whoami.1 yes.1
8d758e5
@@ -81,6 +81,7 @@
8d758e5
 readlink.1:	$(common_dep)	$(srcdir)/readlink.x	../src/readlink.c
8d758e5
 rm.1:		$(common_dep)	$(srcdir)/rm.x		../src/rm.c
8d758e5
 rmdir.1:	$(common_dep)	$(srcdir)/rmdir.x	../src/rmdir.c
8d758e5
+runuser.1:	$(common_dep)	$(srcdir)/runuser.x	../src/runuser.c
8d758e5
 seq.1:		$(common_dep)	$(srcdir)/seq.x		../src/seq.c
8d758e5
 sha1sum.1:	$(common_dep)	$(srcdir)/sha1sum.x	../src/md5sum.c
8d758e5
 shred.1:	$(common_dep)	$(srcdir)/shred.x	../src/shred.c
1ba26ca
--- /dev/null	2004-09-30 04:21:43.103661032 -0400
1ba26ca
+++ coreutils-5.2.1/man/runuser.x	2004-10-05 09:56:25.922168989 -0400
8d758e5
@@ -0,0 +1,4 @@
8d758e5
+[NAME]
8d758e5
+runuser \- run a shell with substitute user and group IDs
8d758e5
+[DESCRIPTION]
8d758e5
+.\" Add any additional description here
1ba26ca
--- coreutils-5.2.1/README.runuser	2004-01-18 02:59:41.000000000 -0500
1ba26ca
+++ coreutils-5.2.1/README	2004-10-05 09:56:25.925168651 -0400
8d758e5
@@ -11,7 +11,7 @@
8d758e5
   df dir dircolors dirname du echo env expand expr factor false fmt fold
8d758e5
   ginstall groups head hostid hostname id join kill link ln logname ls
8d758e5
   md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
8d758e5
-  printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort
8d758e5
+  printenv printf ptx pwd readlink rm rmdir runuser seq sha1sum shred sleep sort
8d758e5
   split stat stty su sum sync tac tail tee test touch tr true tsort tty
8d758e5
   uname unexpand uniq unlink uptime users vdir wc who whoami yes
8d758e5
 
1ba26ca
--- coreutils-5.2.1/tests/help-version.runuser	2004-02-17 11:04:23.000000000 -0500
1ba26ca
+++ coreutils-5.2.1/tests/help-version	2004-10-05 09:56:25.924168764 -0400
1ba26ca
@@ -130,6 +130,7 @@
1ba26ca
 seq_args=10
1ba26ca
 sleep_args=0
1ba26ca
 su_args=--version
1ba26ca
+runuser_args=--version
1ba26ca
 test_args=foo
1ba26ca
 
1ba26ca
 # This is necessary in the unusual event that there is
1ba26ca
--- coreutils-5.2.1/src/su.c.runuser	2004-10-05 09:56:25.680196251 -0400
1ba26ca
+++ coreutils-5.2.1/src/su.c	2004-10-05 09:56:25.915169778 -0400
1ba26ca
@@ -171,6 +171,10 @@
1ba26ca
 #ifndef USE_PAM
1ba26ca
 char *crypt ();
1ba26ca
 #endif
1ba26ca
+#ifndef CHECKPASSWD
1ba26ca
+#define CHECKPASSWD 1
1ba26ca
+#endif
1ba26ca
+
1ba26ca
 char *getpass ();
1ba26ca
 char *getusershell ();
1ba26ca
 void endusershell ();
1ba26ca
@@ -740,7 +744,7 @@
1ba26ca
   pw->pw_dir = xstrdup (pw->pw_dir);
1ba26ca
   pw->pw_shell = xstrdup (pw->pw_shell);
1ba26ca
 
1ba26ca
-  if (!correct_password (pw))
1ba26ca
+  if (CHECKPASSWD && !correct_password (pw))
1ba26ca
     {
1ba26ca
 #ifdef SYSLOG_FAILURE
1ba26ca
       log_su (pw, 0);
1ba26ca
--- coreutils-5.2.1/src/Makefile.am.runuser	2004-10-05 09:56:25.677196589 -0400
1ba26ca
+++ coreutils-5.2.1/src/Makefile.am	2004-10-05 09:56:25.916169665 -0400
1ba26ca
@@ -1,6 +1,6 @@
1ba26ca
 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
1ba26ca
 
1ba26ca
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
1ba26ca
+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
1ba26ca
 
1ba26ca
 bin_SCRIPTS = groups
1ba26ca
 bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
1ba26ca
@@ -67,6 +67,7 @@
1ba26ca
 uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
1ba26ca
 
1ba26ca
 su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
1ba26ca
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) 
1ba26ca
 
1ba26ca
 $(PROGRAMS): ../lib/libfetish.a
1ba26ca
 
1ba26ca
@@ -84,7 +85,7 @@
1ba26ca
 	chmod +x $@-t
1ba26ca
 	mv $@-t $@
1ba26ca
 
1ba26ca
-all-local: su$(EXEEXT)
1ba26ca
+all-local: su$(EXEEXT) runuser
1ba26ca
 
1ba26ca
 installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
1ba26ca
 
1ba26ca
@@ -100,7 +101,7 @@
1ba26ca
   chmod $(setuid_root_mode) $(installed_su)
1ba26ca
 
1ba26ca
 install-root: su$(EXEEXT)
1ba26ca
-	@$(INSTALL_SU)
1ba26ca
+	@$(INSTALL_SU)	
1ba26ca
 
1ba26ca
 install-exec-local: su$(EXEEXT)
1ba26ca
 	@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
1ba26ca
--- /dev/null	2004-09-30 04:21:43.103661032 -0400
1ba26ca
+++ coreutils-5.2.1/src/runuser.c	2004-10-05 10:04:28.835490381 -0400
1ba26ca
@@ -0,0 +1,53 @@
1ba26ca
+#define CHECKPASSWD 0
1ba26ca
+#define pam_start my_pam_start
1ba26ca
+#define pam_end my_pam_end
1ba26ca
+#define pam_setcred my_pam_setcred
1ba26ca
+#define pam_open_session my_pam_open_session
1ba26ca
+#define pam_close_session my_pam_close_session
1ba26ca
+#define pam_strerror my_pam_strerror
1ba26ca
+#define pam_getenvlist my_pam_getenvlist
1ba26ca
+#include "su.c"
1ba26ca
+int pam_start(const char *service_name, const char *user,
1ba26ca
+		     const struct pam_conv *pam_conversation,
1ba26ca
+	      pam_handle_t **pamh) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+int pam_end(pam_handle_t *pamh, int pam_status) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+int pam_setcred(pam_handle_t *pamh, int flags){
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+int pam_open_session(pam_handle_t *pamh, int flags){
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+int pam_close_session(pam_handle_t *pamh, int flags){
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+const char *pam_strerror(pam_handle_t *pamh, int err){
1ba26ca
+	return "";
1ba26ca
+}
1ba26ca
+char **pam_getenvlist(pam_handle_t *pamh){
1ba26ca
+	return NULL;
1ba26ca
+}
1ba26ca
+
1ba26ca
+int misc_conv(int num_msg, const struct pam_message **msgm,
1ba26ca
+	      struct pam_response **response, void *appdata_ptr) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+
1ba26ca
+int pam_authenticate(pam_handle_t *pamh, int flags) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+
1ba26ca
+int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+
1ba26ca
+int pam_chauthtok (pam_handle_t *pamh, int flags) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}
1ba26ca
+
1ba26ca
+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
1ba26ca
+	return PAM_SUCCESS;
1ba26ca
+}