]> granicus.if.org Git - shadow/commitdiff
* lib/commonio.c (commonio_remove): Fail when the name to be
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 8 Mar 2008 22:52:44 +0000 (22:52 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 8 Mar 2008 22:52:44 +0000 (22:52 +0000)
  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.

ChangeLog
NEWS
lib/commonio.c

index 4f3703625e6ee16aba2b5b835fee65dba52ff19a..326531ae4e4f2692d5c502d552aa39ad91de9121 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-08  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * NEWS, src/useradd.c: Make sure the passwd, group, shadow, and
diff --git a/NEWS b/NEWS
index 9ba6dcc559f3b4efc9e544288233e7d6eea5a722..39e68f0656f131c7abd6045887be366812b7ccfd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,8 @@ shadow-4.1.0 -> shadow-4.1.1                                          UNRELEASED
   * 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
index 67953bdfbc41a159cf998b785cc43dd6b9b4b102..4571754dcac63321cebc67612975705c35ae5933 100644 (file)
@@ -886,6 +886,10 @@ int commonio_remove (struct commonio_db *db, const char *name)
                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);