[Pkg-shadow-commits] r1892 - in upstream/trunk: . lib

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Mar 8 22:52:45 UTC 2008


Author: nekral-guest
Date: 2008-03-08 22:52:44 +0000 (Sat, 08 Mar 2008)
New Revision: 1892

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/lib/commonio.c
Log:
* lib/commonio.c (commonio_remove): Fail when the name to be
  removed is used by different entries (like commonio_update does).
* NEWS: This fix the behavior of groupdel when the system is not
  configured to support split group but different group entries
  have the name of the group to be deleted.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-03-08 22:44:53 UTC (rev 1891)
+++ upstream/trunk/ChangeLog	2008-03-08 22:52:44 UTC (rev 1892)
@@ -1,5 +1,13 @@
 2008-03-08  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/commonio.c (commonio_remove): Fail when the name to be
+	removed is used by different entries (like commonio_update does).
+	* NEWS: This fix the behavior of groupdel when the system is not
+	configured to support split group but different group entries
+	have the name of the group to be deleted.
+
+2008-03-08  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* NEWS, src/useradd.c: Make sure the passwd, group, shadow, and
 	gshadow files are unlocked on exit. Unlock locked files in
 	fail_exit(). Prefer fail_exit() over exit().

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-03-08 22:44:53 UTC (rev 1891)
+++ upstream/trunk/NEWS	2008-03-08 22:52:44 UTC (rev 1892)
@@ -36,6 +36,8 @@
   * 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.
   * Make sure the group and gshadow files are unlocked on exit.
+  * Fail if the system is not configured to support split groups and
+    different group entries have the name of the group to be deleted.
 - groupmems
   * Fix buffer overflow when adding an user to a group. Thanks to Peter Vrabec.
 - groupmod

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2008-03-08 22:44:53 UTC (rev 1891)
+++ upstream/trunk/lib/commonio.c	2008-03-08 22:52:44 UTC (rev 1892)
@@ -886,6 +886,10 @@
 		errno = ENOENT;
 		return 0;
 	}
+	if (next_entry_by_name (db, p->next, name)) {
+		fprintf (stderr, _("Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"), name, db->filename);
+		return 0;
+	}
 
 	commonio_del_entry (db, p);
 




More information about the Pkg-shadow-commits mailing list