]> granicus.if.org Git - shadow/commitdiff
* NEWS, src/userdel.c: Fix segfault when userdel removes the
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 18 May 2012 18:56:24 +0000 (18:56 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 18 May 2012 18:56:24 +0000 (18:56 +0000)
user's group.

ChangeLog
NEWS
src/userdel.c

index feb9dc65a502c26651ee2f9ace4ed8982a54efa1..f9eba533537502e73e6106bd559a5ccb0aa09333 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-18  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/userdel.c: Fix segfault when userdel removes the
+       user's group.
+
 2012-05-17  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, src/login.c: Log in utmp / utmpx / wtmp also when PAM is
diff --git a/NEWS b/NEWS
index 68c2302b97760273e1ac358cbb85b0d651fc166f..4501df950a9777b23a3175723362773f660a203f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ shadow-4.1.5 -> shadow-4.1.5.1                                  UNRELEASED
 - login
   * Log into utmp(x) when PAM is enabled, but do not log into wtmp.
     This complete pam_lastlog which logs into wtmp and in into utmp(x).
+- userdel
+  * Fix segfault when userdel removes the user's group.
 
 shadow-4.1.4.3 -> shadow-4.1.5                                 2012-02-12
 
index 63c107bf8b96665ab9ec3a93d99cff0617c75a60..8f731a598f8ca857f7845a88d054cba77a70203e 100644 (file)
@@ -333,22 +333,22 @@ static void remove_usergroup (void)
                 * We can remove this group, it is not the primary
                 * group of any remaining user.
                 */
-               if (gr_remove (grp->gr_name) == 0) {
+               if (gr_remove (user_name) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot remove entry '%s' from %s\n"),
-                                Prog, grp->gr_name, gr_dbname ());
+                                Prog, user_name, gr_dbname ());
                        fail_exit (E_GRP_UPDATE);
                }
 
 #ifdef WITH_AUDIT
                audit_logger (AUDIT_DEL_GROUP, Prog,
                              "deleting group",
-                             grp->gr_name, AUDIT_NO_ID,
+                             user_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_SUCCESS);
 #endif                         /* WITH_AUDIT */
                SYSLOG ((LOG_INFO,
                         "removed group '%s' owned by '%s'\n",
-                        grp->gr_name, user_name));
+                        user_name, user_name));
 
 #ifdef SHADOWGRP
                if (sgr_locate (user_name) != NULL) {
@@ -361,12 +361,12 @@ static void remove_usergroup (void)
 #ifdef WITH_AUDIT
                        audit_logger (AUDIT_DEL_GROUP, Prog,
                                      "deleting shadow group",
-                                     grp->gr_name, AUDIT_NO_ID,
+                                     user_name, AUDIT_NO_ID,
                                      SHADOW_AUDIT_SUCCESS);
 #endif                         /* WITH_AUDIT */
                        SYSLOG ((LOG_INFO,
                                 "removed shadow group '%s' owned by '%s'\n",
-                                grp->gr_name, user_name));
+                                user_name, user_name));
 
                }
 #endif                         /* SHADOWGRP */