]> granicus.if.org Git - shadow/commitdiff
Do not raise an error if the group does not exist in the gshadow file.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 8 Mar 2008 16:17:07 +0000 (16:17 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 8 Mar 2008 16:17:07 +0000 (16:17 +0000)
ChangeLog
NEWS
src/groupdel.c

index 0e5d5e195c9382597ca14911c793426dcb84dc1e..a92611980a0c90695db0df488db2afe68a264548 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-08  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/groupdel.c: Do not raise an error if the group does not
+       exist in the gshadow file.
+
 2008-03-08  Nicolas François  <nicolas.francois@centraliens.net>
 
        * etc/login.defs: Document MAX_MEMBERS_PER_GROUP.
diff --git a/NEWS b/NEWS
index fe68b97847e753e9af8d5b241b35bf09012cc432..48e25cca519e7e6317d2c629d48d61727dd67e88 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ shadow-4.1.0 -> shadow-4.1.1                                          UNRELEASED
 - groupadd
   * New option -p/--password to specify an encrypted password.
   * New option -r, --system for system accounts.
+- groupdel
+  * Do not fail if the group does not exist in the gshadow file.
 - groupmems
   * Fix buffer overflow when adding an user to a group. Thanks to Peter Vrabec.
 - groupmod
index 4982f70158d9bd42bc34b50fc22a24e68818b286..69e49c5590b9c1ca5e213253b5065d0782e201c6 100644 (file)
@@ -99,10 +99,13 @@ static void grp_update (void)
        /*
         * Delete the shadow group entries as well.
         */
-       if (is_shadow_grp && !sgr_remove (group_name)) {
-               fprintf (stderr,
-                        _("%s: error removing shadow group entry\n"), Prog);
-               errors++;
+       if (is_shadow_grp && (sgr_locate (group_name) != NULL)) {
+               if (!sgr_remove (group_name)) {
+                       fprintf (stderr,
+                                _("%s: error removing shadow group entry\n"),
+                                Prog);
+                       errors++;
+               }
        }
 #endif                         /* SHADOWGRP */
 #ifdef WITH_AUDIT