Hello community, here is the log from the commit of package coreutils for openSUSE:11.3 checked in at Thu Jun 30 16:38:34 CEST 2011.
-------- --- old-versions/11.3/UPDATES/all/coreutils/coreutils.changes 2010-10-27 18:58:25.000000000 +0200 +++ 11.3/coreutils/coreutils.changes 2011-06-08 18:14:57.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Jun 8 15:37:36 CEST 2011 - p...@suse.de + +- Fix vulnerability in su (bnc#697897). + +------------------------------------------------------------------- calling whatdependson for 11.3-i586 New: ---- coreutils-bnc#697897-setsid.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ coreutils.spec ++++++ --- /var/tmp/diff_new_pack.iYV0Hu/_old 2011-06-30 16:36:04.000000000 +0200 +++ /var/tmp/diff_new_pack.iYV0Hu/_new 2011-06-30 16:36:04.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package coreutils (Version 7.1) +# spec file for package coreutils # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ License: GFDLv1.2 ; GPLv2+ ; GPLv3+ Group: System/Base Version: 7.1 -Release: 11.<RELEASE1> +Release: 11.<RELEASE3> Provides: fileutils sh-utils stat textutils mktemp Obsoletes: fileutils sh-utils stat textutils mktemp Obsoletes: libselinux <= 1.23.11-3 libselinux-32bit = 9 libselinux-64bit = 9 libselinux-x86 = 9 @@ -51,6 +51,7 @@ Patch25: coreutils-cifs-afs.diff Patch26: coreutils-add_ogv.patch Patch27: coreutils-fix_distcheck.patch +Patch28: coreutils-bnc#697897-setsid.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -123,6 +124,7 @@ %patch25 %patch26 %patch27 +%patch28 %build #AUTOPOINT=true autoreconf -fi ++++++ coreutils-bnc#697897-setsid.patch ++++++ Index: src/su.c =================================================================== --- src/su.c.orig 2011-06-08 16:05:24.900396480 +0200 +++ src/su.c 2011-06-08 16:07:15.069885356 +0200 @@ -160,9 +160,13 @@ static bool simulate_login; /* If true, change some environment vars to indicate the user su'd to. */ static bool change_environment; +/* If true, then don't call setsid() with a command. */ +int same_session = 0; + static struct option const longopts[] = { {"command", required_argument, NULL, 'c'}, + {"session-command", required_argument, NULL, 'C'}, {"fast", no_argument, NULL, 'f'}, {"login", no_argument, NULL, 'l'}, {"preserve-environment", no_argument, NULL, 'p'}, @@ -337,14 +341,29 @@ create_watching_parent (void) sigemptyset (&action.sa_mask); action.sa_flags = 0; sigemptyset (&ourset); - if (sigaddset (&ourset, SIGTERM) - || sigaddset (&ourset, SIGALRM) - || sigaction (SIGTERM, &action, NULL) - || sigprocmask (SIG_UNBLOCK, &ourset, NULL)) - { + + if (!same_session) + { + if (sigaddset(&ourset, SIGINT) || sigaddset(&ourset, SIGQUIT)) + { + error (0, errno, _("cannot set signal handler")); + caught_signal = true; + } + } + if (!caught_signal && (sigaddset(&ourset, SIGTERM) + || sigaddset(&ourset, SIGALRM) + || sigaction(SIGTERM, &action, NULL) + || sigprocmask(SIG_UNBLOCK, &ourset, NULL))) + { error (0, errno, _("cannot set signal handler")); caught_signal = true; } + if (!caught_signal && !same_session && (sigaction(SIGINT, &action, NULL) + || sigaction(SIGQUIT, &action, NULL))) + { + error (0, errno, _("cannot set signal handler")); + caught_signal = true; + } } if (!caught_signal) { @@ -760,6 +779,8 @@ Change the effective user id and group i \n\ -, -l, --login make the shell a login shell\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\ @@ -782,6 +803,7 @@ main (int argc, char **argv) int optc; const char *new_user = DEFAULT_USER; char *command = NULL; + int request_same_session = 0; char *shell = NULL; struct passwd *pw; struct passwd pw_copy; @@ -807,6 +829,11 @@ main (int argc, char **argv) command = optarg; break; + case 'C': + command = optarg; + request_same_session = 1; + break; + case 'f': fast_startup = true; break; @@ -877,6 +904,9 @@ main (int argc, char **argv) } #endif + if (request_same_session || !command || !pw->pw_uid) + same_session = 1; + if (!shell && !change_environment) shell = getenv ("SHELL"); if (shell && getuid () != 0 && restricted_shell (pw->pw_shell)) @@ -898,6 +928,8 @@ main (int argc, char **argv) #endif change_identity (pw); + if (!same_session) + setsid (); /* Set environment after pam_open_session, which may put KRB5CCNAME into the pam_env, etc. */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org