]> granicus.if.org Git - shadow/commitdiff
If compiled without PAM support, enforce the limits from /etc/limits when
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 12 Oct 2007 22:36:26 +0000 (22:36 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 12 Oct 2007 22:36:26 +0000 (22:36 +0000)
one of the -, -l, or --login options is set, even if called by root.
Thanks to Justin Bronder.

ChangeLog
NEWS
src/su.c

index 545d4d8764aae1c65350e3a03b1fafd8a2c061c2..bc673938bb076c445b838156f26d1df93032971a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-13  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/su.c: If compiled without PAM support, enforce the
+       limits from /etc/limits when one of the -, -l, or --login options
+       is set, even if called by root. Thanks to Justin Bronder.
+
 2007-10-07  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, Changelog: Convert the Changelog and NEWS files to UTF-8
diff --git a/NEWS b/NEWS
index 62d9fa64e04574e4256ce4c81909800c21fb6968..7ebfe080383ecaf19ed473e07b9617989dfc99b8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 $Id: NEWS,v 1.492 2007/02/01 20:49:25 kloczek Exp $
 
-shadow-4.0.18.1 -> shadow-4.0.18.2                                     09-08-2006
+shadow-4.0.18.1 -> shadow-4.0.18.2                                     13-10-2007
 
 *** general:
 - usermod: fixed handle -a option (by Benno Schulenberg
@@ -9,6 +9,9 @@ shadow-4.0.18.1 -> shadow-4.0.18.2                                      09-08-2006
   (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=211659),
 - groupadd, groupdel, groupmod, useradd, userdel, usermod: flush nscd cashes
   after close /etc/{group,passwd} files,
+- su: If compiled without PAM support, enforce the limits from /etc/limits
+  when one of the -, -l, or --login options is set, even if called by root.
+*** documentation:
 - updated translations: ja, nl, tl.
 - groupadd.8, groupmod.8, login.1, useradd.8, userdel.8, usermod.8: grammar
   mistakes and other correctstions (by Schulenberg <bensberg@justemail.net>),
index 40054bcfb649b7241d0cd4e90d9feb38eafc37ad..745f476622e6ecdd54e775920ecbd6225ee590b7 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -790,8 +790,9 @@ int main (int argc, char **argv)
        }
 #else                          /* !USE_PAM */
        environ = newenvp;      /* make new environment active */
-       
-       if (!amroot)            /* no limits if su from root */
+
+       /* no limits if su from root (unless su must fake login's behavior) */
+       if (!amroot || fakelogin)
                setup_limits (&pwent);
 
        if (setup_uid_gid (&pwent, is_console))