2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/AUTHORS coreutils-8.7/AUTHORS
|
|
|
|
--- coreutils-8.7-orig/AUTHORS 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/AUTHORS 2010-11-15 10:08:04.222078001 +0100
|
2009-11-27 13:24:09 +00:00
|
|
|
@@ -65,6 +65,7 @@ readlink: Dmitry V. Levin
|
2008-11-11 16:03:49 +00:00
|
|
|
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
|
2008-10-22 11:07:44 +00:00
|
|
|
rmdir: David MacKenzie
|
|
|
|
runcon: Russell Coker
|
2009-05-25 12:11:34 +00:00
|
|
|
+runuser: David MacKenzie, Dan Walsh
|
2008-10-22 11:07:44 +00:00
|
|
|
seq: Ulrich Drepper
|
|
|
|
sha1sum: Ulrich Drepper, Scott Miller, David Madore
|
2009-05-25 12:11:34 +00:00
|
|
|
sha224sum: Ulrich Drepper, Scott Miller, David Madore
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/man/help2man coreutils-8.7/man/help2man
|
|
|
|
--- coreutils-8.7-orig/man/help2man 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/man/help2man 2010-11-15 10:08:51.331054884 +0100
|
|
|
|
@@ -555,6 +555,9 @@ while (length)
|
2009-11-27 13:24:09 +00:00
|
|
|
$include{$sect} .= $content;
|
|
|
|
}
|
|
|
|
|
|
|
|
+# There is no info documentation for runuser (shared with su).
|
|
|
|
+$opt_no_info = 1 if $program eq 'runuser';
|
|
|
|
+
|
|
|
|
# Refer to the real documentation.
|
|
|
|
unless ($opt_no_info)
|
|
|
|
{
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/man/Makefile.am coreutils-8.7/man/Makefile.am
|
|
|
|
--- coreutils-8.7-orig/man/Makefile.am 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/man/Makefile.am 2010-11-15 10:09:21.768922182 +0100
|
2009-11-27 13:24:09 +00:00
|
|
|
@@ -94,6 +94,7 @@ readlink.1: $(common_dep) $(srcdir)/read
|
2008-10-22 11:07:44 +00:00
|
|
|
rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
|
|
|
|
rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
|
|
|
|
runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c
|
|
|
|
+runuser.1: $(common_dep) $(srcdir)/runuser.x ../src/su.c
|
|
|
|
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
|
|
|
|
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
|
|
|
|
sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/man/runuser.x coreutils-8.7/man/runuser.x
|
|
|
|
--- coreutils-8.7-orig/man/runuser.x 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
+++ coreutils-8.7/man/runuser.x 2010-11-15 10:09:57.437939015 +0100
|
2009-01-28 17:29:41 +00:00
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
+[NAME]
|
|
|
|
+runuser \- run a shell with substitute user and group IDs
|
|
|
|
+[DESCRIPTION]
|
|
|
|
+.\" Add any additional description here
|
|
|
|
+[SEE ALSO]
|
|
|
|
+.TP
|
|
|
|
+More detailed Texinfo documentation could be found by command
|
|
|
|
+.TP
|
2009-09-22 13:24:02 +00:00
|
|
|
+\t\fBinfo coreutils \(aqsu invocation\(aq\fR\t
|
2009-01-28 17:29:41 +00:00
|
|
|
+.TP
|
2009-09-22 13:24:02 +00:00
|
|
|
+since the command \fBrunuser\fR is trimmed down version of command \fBsu\fR.
|
2009-01-28 17:29:41 +00:00
|
|
|
+.br
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/README coreutils-8.7/README
|
|
|
|
--- coreutils-8.7-orig/README 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/README 2010-11-15 10:10:43.002922253 +0100
|
2012-01-07 19:47:10 +00:00
|
|
|
@@ -11,8 +11,8 @@ The programs that can be built with this
|
2008-01-25 17:48:11 +00:00
|
|
|
factor false fmt fold groups head hostid hostname id install join kill
|
|
|
|
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
|
2012-01-07 19:47:10 +00:00
|
|
|
nproc od paste pathchk pinky pr printenv printf ptx pwd readlink realpath
|
|
|
|
- rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
|
|
|
|
- shuf sleep sort split stat stdbuf stty su sum sync tac tail tee test
|
|
|
|
+ rm rmdir runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum
|
|
|
|
+ shred shuf sleep sort split stat stdbuf stty su sum sync tac tail tee test
|
|
|
|
timeout touch tr true truncate tsort tty uname unexpand uniq unlink
|
|
|
|
uptime users vdir wc who whoami yes
|
2008-11-11 16:03:49 +00:00
|
|
|
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/src/Makefile.am coreutils-8.7/src/Makefile.am
|
|
|
|
--- coreutils-8.7-orig/src/Makefile.am 2010-11-15 10:07:07.339171659 +0100
|
|
|
|
+++ coreutils-8.7/src/Makefile.am 2010-11-15 10:12:14.847094550 +0100
|
2009-11-27 13:24:09 +00:00
|
|
|
@@ -100,6 +100,7 @@ EXTRA_PROGRAMS = \
|
|
|
|
rm \
|
|
|
|
rmdir \
|
|
|
|
runcon \
|
2010-11-15 12:16:04 +00:00
|
|
|
+ runuser \
|
2009-11-27 13:24:09 +00:00
|
|
|
seq \
|
|
|
|
sha1sum \
|
|
|
|
sha224sum \
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -300,6 +301,10 @@ cp_LDADD += $(copy_LDADD)
|
2009-11-27 13:24:09 +00:00
|
|
|
ginstall_LDADD += $(copy_LDADD)
|
|
|
|
mv_LDADD += $(copy_LDADD)
|
2008-10-22 11:07:44 +00:00
|
|
|
|
|
|
|
+runuser_SOURCES = su.c
|
|
|
|
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
|
2010-11-15 12:16:04 +00:00
|
|
|
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
|
2008-10-22 11:07:44 +00:00
|
|
|
+
|
2009-11-27 13:24:09 +00:00
|
|
|
remove_LDADD =
|
|
|
|
mv_LDADD += $(remove_LDADD)
|
|
|
|
rm_LDADD += $(remove_LDADD)
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -395,7 +400,7 @@ RELEASE_YEAR = \
|
2008-10-22 11:07:44 +00:00
|
|
|
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
|
|
|
|
$(top_srcdir)/lib/version-etc.c`
|
|
|
|
|
|
|
|
-all-local: su$(EXEEXT)
|
|
|
|
+all-local: su$(EXEEXT) runuser
|
|
|
|
|
|
|
|
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
|
|
|
|
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/src/su.c coreutils-8.7/src/su.c
|
|
|
|
--- coreutils-8.7-orig/src/su.c 2010-11-15 10:07:07.372933288 +0100
|
|
|
|
+++ coreutils-8.7/src/su.c 2010-11-15 10:42:12.569159230 +0100
|
|
|
|
@@ -100,9 +100,15 @@
|
2005-11-24 23:00:49 +00:00
|
|
|
#include "error.h"
|
|
|
|
|
2012-03-26 16:23:32 +00:00
|
|
|
/* The official name of this program (e.g., no 'g' prefix). */
|
2005-11-24 23:00:49 +00:00
|
|
|
+#ifndef RUNUSER
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
#define PROGRAM_NAME "su"
|
2005-11-24 23:00:49 +00:00
|
|
|
+#else
|
|
|
|
+#define PROGRAM_NAME "runuser"
|
|
|
|
+#endif
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
|
|
|
|
+#ifndef AUTHORS
|
2008-06-02 11:12:20 +00:00
|
|
|
#define AUTHORS proper_name ("David MacKenzie")
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
#if HAVE_PATHS_H
|
|
|
|
# include <paths.h>
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -140,6 +146,9 @@
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
#ifndef USE_PAM
|
2009-02-24 11:53:38 +00:00
|
|
|
char *crypt (char const *key, char const *salt);
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
#endif
|
|
|
|
+#ifndef CHECKPASSWD
|
|
|
|
+#define CHECKPASSWD 1
|
|
|
|
+#endif
|
2009-10-06 13:43:25 +00:00
|
|
|
|
2010-11-15 12:16:04 +00:00
|
|
|
static void run_shell (char const *, char const *, char **, size_t)
|
|
|
|
ATTRIBUTE_NORETURN;
|
|
|
|
@@ -169,6 +178,10 @@ static struct option const longopts[] =
|
2006-07-21 14:50:12 +00:00
|
|
|
{"login", no_argument, NULL, 'l'},
|
|
|
|
{"preserve-environment", no_argument, NULL, 'p'},
|
|
|
|
{"shell", required_argument, NULL, 's'},
|
|
|
|
+#ifdef RUNUSER
|
|
|
|
+ {"group", required_argument, NULL, 'g'},
|
|
|
|
+ {"supp-group", required_argument, NULL, 'G'},
|
|
|
|
+#endif
|
|
|
|
{GETOPT_HELP_OPTION_DECL},
|
|
|
|
{GETOPT_VERSION_OPTION_DECL},
|
|
|
|
{NULL, 0, NULL, 0}
|
2010-11-18 16:28:56 +00:00
|
|
|
@@ -444,6 +457,11 @@ correct_password (const struct passwd *p
|
2010-11-15 12:16:04 +00:00
|
|
|
retval = pam_set_item (pamh, PAM_RUSER, (const void *) lpw->pw_name);
|
|
|
|
PAM_BAIL_P (return false);
|
|
|
|
}
|
2005-11-24 23:00:49 +00:00
|
|
|
+#ifdef RUNUSER
|
|
|
|
+ if (getuid() != geteuid())
|
|
|
|
+ /* safety net: deny operation if we are suid by accident */
|
2008-01-25 17:48:11 +00:00
|
|
|
+ error(EXIT_FAILURE, 1, "runuser may not be setuid");
|
2005-11-24 23:00:49 +00:00
|
|
|
+#else
|
2010-11-15 12:16:04 +00:00
|
|
|
retval = pam_authenticate (pamh, 0);
|
|
|
|
PAM_BAIL_P (return false);
|
|
|
|
retval = pam_acct_mgmt (pamh, 0);
|
2010-11-18 16:28:56 +00:00
|
|
|
@@ -454,6 +472,7 @@ correct_password (const struct passwd *p
|
|
|
|
PAM_BAIL_P (return false);
|
|
|
|
}
|
|
|
|
PAM_BAIL_P (return false);
|
|
|
|
+#endif
|
|
|
|
/* Must be authenticated if this point was reached. */
|
|
|
|
return true;
|
|
|
|
#else /* !USE_PAM */
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -533,11 +552,22 @@ modify_environment (const struct passwd
|
2006-07-21 14:50:12 +00:00
|
|
|
/* Become the user and group(s) specified by PW. */
|
|
|
|
|
|
|
|
static void
|
2010-11-15 12:16:04 +00:00
|
|
|
-init_groups (const struct passwd *pw)
|
|
|
|
+init_groups (const struct passwd *pw
|
2006-07-21 14:50:12 +00:00
|
|
|
+#ifdef RUNUSER
|
2009-09-12 09:28:49 +00:00
|
|
|
+ , gid_t *groups, int num_groups
|
2006-07-21 14:50:12 +00:00
|
|
|
+#endif
|
2009-09-12 09:28:49 +00:00
|
|
|
+ )
|
2006-07-21 14:50:12 +00:00
|
|
|
{
|
|
|
|
#ifdef HAVE_INITGROUPS
|
|
|
|
+ int rc = 0;
|
|
|
|
errno = 0;
|
2010-11-15 12:16:04 +00:00
|
|
|
- if (initgroups (pw->pw_name, pw->pw_gid) == -1)
|
2006-07-21 14:50:12 +00:00
|
|
|
+#ifdef RUNUSER
|
|
|
|
+ if (num_groups)
|
|
|
|
+ rc = setgroups(num_groups, groups);
|
|
|
|
+ else
|
|
|
|
+#endif
|
|
|
|
+ rc = initgroups(pw->pw_name, pw->pw_gid);
|
2010-11-15 12:16:04 +00:00
|
|
|
+ if (rc == -1)
|
|
|
|
{
|
2006-07-21 14:50:12 +00:00
|
|
|
#ifdef USE_PAM
|
2010-11-15 12:16:04 +00:00
|
|
|
cleanup_pam (PAM_ABORT);
|
|
|
|
@@ -639,6 +669,28 @@ usage (int status)
|
2008-10-22 11:07:44 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
|
|
|
|
+#ifdef RUNUSER
|
2009-09-22 13:24:02 +00:00
|
|
|
+ printf (_("\
|
|
|
|
+Change the effective user id and group id to that of USER. Only session PAM\n\
|
|
|
|
+hooks are run, and there is no password prompt. This command is useful only\n\
|
2008-10-22 11:07:44 +00:00
|
|
|
+when run as the root user. If run as a non-root user without privilege\n\
|
2009-09-22 13:24:02 +00:00
|
|
|
+to set user ID, the command will fail as the binary is not setuid.\n\
|
|
|
|
+As %s doesn't run auth and account PAM hooks, it runs with lower overhead\n\
|
|
|
|
+than su.\n\
|
2008-10-22 11:07:44 +00:00
|
|
|
+\n\
|
|
|
|
+ -, -l, --login make the shell a login shell, uses runuser-l\n\
|
|
|
|
+ PAM file instead of default one\n\
|
|
|
|
+ -g --group=group specify the primary group\n\
|
|
|
|
+ -G --supp-group=group specify a supplemental group\n\
|
|
|
|
+ -c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
|
|
|
|
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
|
|
|
|
+ and do not create a new session\n\
|
|
|
|
+ -f, --fast pass -f to the shell (for csh or tcsh)\n\
|
|
|
|
+ -m, --preserve-environment do not reset environment variables\n\
|
|
|
|
+ -p same as -m\n\
|
|
|
|
+ -s, --shell=SHELL run SHELL if /etc/shells allows it\n\
|
2009-09-22 13:24:02 +00:00
|
|
|
+"), program_name);
|
2008-10-22 11:07:44 +00:00
|
|
|
+#else
|
|
|
|
fputs (_("\
|
|
|
|
Change the effective user id and group id to that of USER.\n\
|
|
|
|
\n\
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -651,6 +703,7 @@ Change the effective user id and group i
|
2008-10-22 11:07:44 +00:00
|
|
|
-p same as -m\n\
|
|
|
|
-s, --shell=SHELL run SHELL if /etc/shells allows it\n\
|
|
|
|
"), stdout);
|
|
|
|
+#endif
|
|
|
|
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
|
|
|
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
|
|
|
fputs (_("\
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -672,6 +725,12 @@ main (int argc, char **argv)
|
2006-07-21 14:50:12 +00:00
|
|
|
char *shell = NULL;
|
|
|
|
struct passwd *pw;
|
|
|
|
struct passwd pw_copy;
|
|
|
|
+#ifdef RUNUSER
|
|
|
|
+ struct group *gr;
|
|
|
|
+ gid_t groups[NGROUPS_MAX];
|
|
|
|
+ int num_supp_groups = 0;
|
|
|
|
+ int use_gid = 0;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
initialize_main (&argc, &argv);
|
2008-11-11 16:03:49 +00:00
|
|
|
set_program_name (argv[0]);
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -686,7 +745,11 @@ main (int argc, char **argv)
|
2006-07-21 14:50:12 +00:00
|
|
|
simulate_login = false;
|
|
|
|
change_environment = true;
|
|
|
|
|
|
|
|
- while ((optc = getopt_long (argc, argv, "c:flmps:", longopts, NULL)) != -1)
|
|
|
|
+ while ((optc = getopt_long (argc, argv, "c:flmps:"
|
|
|
|
+#ifdef RUNUSER
|
2009-09-12 09:28:49 +00:00
|
|
|
+ "g:G:"
|
2006-07-21 14:50:12 +00:00
|
|
|
+#endif
|
2009-09-12 09:28:49 +00:00
|
|
|
+ , longopts, NULL)) != -1)
|
2006-07-21 14:50:12 +00:00
|
|
|
{
|
|
|
|
switch (optc)
|
2009-09-12 09:28:49 +00:00
|
|
|
{
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -716,6 +779,28 @@ main (int argc, char **argv)
|
2009-09-12 09:28:49 +00:00
|
|
|
shell = optarg;
|
|
|
|
break;
|
2006-07-21 14:50:12 +00:00
|
|
|
|
|
|
|
+#ifdef RUNUSER
|
2009-09-12 09:28:49 +00:00
|
|
|
+ case 'g':
|
|
|
|
+ gr = getgrnam(optarg);
|
|
|
|
+ if (!gr)
|
|
|
|
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
|
|
|
|
+ use_gid = 1;
|
|
|
|
+ groups[0] = gr->gr_gid;
|
|
|
|
+ break;
|
2006-07-21 14:50:12 +00:00
|
|
|
+
|
2009-09-12 09:28:49 +00:00
|
|
|
+ case 'G':
|
|
|
|
+ num_supp_groups++;
|
|
|
|
+ if (num_supp_groups >= NGROUPS_MAX)
|
|
|
|
+ error (EXIT_FAILURE, 0,
|
|
|
|
+ _("Can't specify more than %d supplemental groups"),
|
|
|
|
+ NGROUPS_MAX - 1);
|
|
|
|
+ gr = getgrnam(optarg);
|
|
|
|
+ if (!gr)
|
|
|
|
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
|
|
|
|
+ groups[num_supp_groups] = gr->gr_gid;
|
|
|
|
+ break;
|
2006-07-21 14:50:12 +00:00
|
|
|
+#endif
|
|
|
|
+
|
2009-09-12 09:28:49 +00:00
|
|
|
case_GETOPT_HELP_CHAR;
|
2006-07-21 14:50:12 +00:00
|
|
|
|
2009-09-12 09:28:49 +00:00
|
|
|
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -754,7 +839,20 @@ main (int argc, char **argv)
|
2009-09-12 09:28:49 +00:00
|
|
|
: DEFAULT_SHELL);
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
endpwent ();
|
|
|
|
|
|
|
|
- if (!correct_password (pw))
|
2006-07-21 14:50:12 +00:00
|
|
|
+#ifdef RUNUSER
|
|
|
|
+ if (num_supp_groups && !use_gid)
|
|
|
|
+ {
|
|
|
|
+ pw->pw_gid = groups[1];
|
|
|
|
+ memmove (groups, groups + 1, sizeof(gid_t) * num_supp_groups);
|
|
|
|
+ }
|
|
|
|
+ else if (use_gid)
|
|
|
|
+ {
|
|
|
|
+ pw->pw_gid = groups[0];
|
|
|
|
+ num_supp_groups++;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
+ if (CHECKPASSWD && !correct_password (pw))
|
|
|
|
{
|
|
|
|
#ifdef SYSLOG_FAILURE
|
|
|
|
log_su (pw, false);
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -784,7 +882,11 @@ main (int argc, char **argv)
|
|
|
|
}
|
|
|
|
shell = xstrdup (shell ? shell : pw->pw_shell);
|
2006-07-21 14:50:12 +00:00
|
|
|
|
2010-11-15 12:16:04 +00:00
|
|
|
- init_groups (pw);
|
|
|
|
+ init_groups (pw
|
2006-07-21 14:50:12 +00:00
|
|
|
+#ifdef RUNUSER
|
2009-09-12 09:28:49 +00:00
|
|
|
+ , groups, num_supp_groups
|
2006-07-21 14:50:12 +00:00
|
|
|
+#endif
|
2010-11-15 12:16:04 +00:00
|
|
|
+ );
|
2009-11-27 13:24:09 +00:00
|
|
|
|
2010-11-15 12:16:04 +00:00
|
|
|
#ifdef USE_PAM
|
|
|
|
create_watching_parent ();
|
|
|
|
diff -urNp coreutils-8.7-orig/tests/misc/help-version coreutils-8.7/tests/misc/help-version
|
|
|
|
--- coreutils-8.7-orig/tests/misc/help-version 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/tests/misc/help-version 2010-11-15 10:45:18.473682325 +0100
|
|
|
|
@@ -32,6 +32,7 @@ expected_failure_status_nohup=125
|
2009-11-27 13:24:09 +00:00
|
|
|
expected_failure_status_stdbuf=125
|
|
|
|
expected_failure_status_su=125
|
|
|
|
expected_failure_status_timeout=125
|
|
|
|
+expected_failure_status_runuser=125
|
|
|
|
expected_failure_status_printenv=2
|
|
|
|
expected_failure_status_tty=3
|
|
|
|
expected_failure_status_sort=2
|
2010-11-15 12:16:04 +00:00
|
|
|
@@ -209,6 +210,7 @@ seq_setup () { args=10; }
|
2010-04-26 13:15:37 +00:00
|
|
|
sleep_setup () { args=0; }
|
|
|
|
su_setup () { args=--version; }
|
|
|
|
stdbuf_setup () { args="-oL true"; }
|
|
|
|
+runuser_setup () { args=--version; }
|
|
|
|
timeout_setup () { args=--version; }
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
|
2008-10-22 11:07:44 +00:00
|
|
|
# I'd rather not run sync, since it spins up disks that I've
|
2010-11-15 12:16:04 +00:00
|
|
|
diff -urNp coreutils-8.7-orig/tests/misc/invalid-opt coreutils-8.7/tests/misc/invalid-opt
|
|
|
|
--- coreutils-8.7-orig/tests/misc/invalid-opt 2010-10-11 19:35:11.000000000 +0200
|
|
|
|
+++ coreutils-8.7/tests/misc/invalid-opt 2010-11-15 10:45:46.451938873 +0100
|
2009-11-27 13:24:09 +00:00
|
|
|
@@ -37,6 +37,7 @@ my %exit_status =
|
|
|
|
sort => 2,
|
|
|
|
stdbuf => 125,
|
|
|
|
su => 125,
|
|
|
|
+ runuser => 125,
|
|
|
|
test => 0,
|
|
|
|
timeout => 125,
|
|
|
|
true => 0,
|