+2008-09-06 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/groupmems.c: Call open_files() and close_files().
+ * src/groupmems.c: Always call check_perms(), which takes care of
+ checking if --list is used.
+
2008-09-06 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/obscure.c: Compare characters to '\0', not NULL.
}
}
- if (!list) {
- check_perms ();
+ check_perms ();
- if (gr_lock () == 0) {
- fprintf (stderr,
- _("%s: cannot lock %s; try again later.\n"),
- Prog, gr_dbname ());
- fail_exit (EXIT_GROUP_FILE);
- }
- gr_locked = true;
- }
+ open_files ();
grp = gr_locate (name);
-
if (NULL == grp) {
fprintf (stderr, _("%s: group '%s' does not exist in %s\n"),
Prog, name, gr_dbname ());
purge_members (grp);
}
- if (gr_close () == 0) {
- fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing %s", gr_dbname ()));
- fail_exit (EXIT_GROUP_FILE);
- }
- if (gr_unlock () == 0) {
- fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
- /* continue */
- }
+ close_files ();
exit (EXIT_SUCCESS);
}