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

index 13e6846c23ebaa4553ab72396606140c4730d1ee..a1d8bd4499c5140599750b9034177ffbfb505114 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-08  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/groupdel.c: Do not rewrite the group and gshadow file
+       in case of error.
+
 2008-03-08  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/groupdel.c: Do not log that the group was deleted if an
@@ -5,8 +10,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.
+       * NEWS, 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>
 
diff --git a/NEWS b/NEWS
index 48e25cca519e7e6317d2c629d48d61727dd67e88..d1b8f83f2498066f45570667fa789688ec25f7ac 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ shadow-4.1.0 -> shadow-4.1.1                                          UNRELEASED
   * New option -r, --system for system accounts.
 - groupdel
   * Do not fail if the group does not exist in the gshadow file.
+  * Do not rewrite the group or gshadow file in case of error.
 - groupmems
   * Fix buffer overflow when adding an user to a group. Thanks to Peter Vrabec.
 - groupmod
index c67ec699c30015e21db428565364d115bd263b53..f67063e58338b2c2919079d6c8fae17abdd38bbc 100644 (file)
@@ -340,9 +340,10 @@ int main (int argc, char **argv)
        open_files ();
 
        grp_update ();
-       close_files ();
-
-       nscd_flush_cache ("group");
+       if (errors == 0) {
+               close_files ();
+               nscd_flush_cache ("group");
+       }
 
 #ifdef USE_PAM
        if (retval == PAM_SUCCESS)