static char *group_name;
static gid_t group_id = -1;
+static bool check_group_busy = true;
#ifdef SHADOWGRP
static bool is_shadow_grp;
Prog);
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -f, --force delete group even if it is the primary group of a user\n"), usageout);
(void) fputs ("\n", usageout);
exit (status);
}
{NULL, 0, NULL, '\0'}
};
- while ((c = getopt_long (argc, argv, "hR:",
+ while ((c = getopt_long (argc, argv, "hfR:",
long_options, NULL)) != -1) {
switch (c) {
case 'h':
/*@notreached@*/break;
case 'R': /* no-op, handled in process_root_flag () */
break;
+ case 'f':
+ check_group_busy = false;
+ break;
default:
usage (E_USAGE);
}
/*
* Make sure this isn't the primary group of anyone.
*/
- group_busy (group_id);
+ if (check_group_busy) {
+ group_busy (group_id);
+ }
/*
* Do the hard stuff - open the files, delete the group entries,