From a2242f6f1b22e7015fc5a4731f74c8bd93dd16d5 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 8 Mar 2008 16:23:22 +0000 Subject: [PATCH] Do not rewrite the group and gshadow file in case of error. --- ChangeLog | 9 +++++++-- NEWS | 1 + src/groupdel.c | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13e6846c..a1d8bd44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-08 Nicolas François + + * NEWS, src/groupdel.c: Do not rewrite the group and gshadow file + in case of error. + 2008-03-08 Nicolas François * src/groupdel.c: Do not log that the group was deleted if an @@ -5,8 +10,8 @@ 2008-03-08 Nicolas François - * 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 diff --git a/NEWS b/NEWS index 48e25cca..d1b8f83f 100644 --- 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 diff --git a/src/groupdel.c b/src/groupdel.c index c67ec699..f67063e5 100644 --- a/src/groupdel.c +++ b/src/groupdel.c @@ -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)