[Pkg-shadow-commits] r1885 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Mar 8 16:17:08 UTC 2008


Author: nekral-guest
Date: 2008-03-08 16:17:07 +0000 (Sat, 08 Mar 2008)
New Revision: 1885

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/src/groupdel.c
Log:
Do not raise an error if the group does not exist in the gshadow file.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-03-08 16:05:30 UTC (rev 1884)
+++ upstream/trunk/ChangeLog	2008-03-08 16:17:07 UTC (rev 1885)
@@ -1,5 +1,10 @@
 2008-03-08  Nicolas François  <nicolas.francois at 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 at centraliens.net>
+
 	* etc/login.defs: Document MAX_MEMBERS_PER_GROUP.
 
 2008-03-07  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-03-08 16:05:30 UTC (rev 1884)
+++ upstream/trunk/NEWS	2008-03-08 16:17:07 UTC (rev 1885)
@@ -31,6 +31,8 @@
 - 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

Modified: upstream/trunk/src/groupdel.c
===================================================================
--- upstream/trunk/src/groupdel.c	2008-03-08 16:05:30 UTC (rev 1884)
+++ upstream/trunk/src/groupdel.c	2008-03-08 16:17:07 UTC (rev 1885)
@@ -99,10 +99,13 @@
 	/*
 	 * 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




More information about the Pkg-shadow-commits mailing list