Files
shadow/debian/patches/428_grpck_add_prune_option
T

51 lines
1.1 KiB
Plaintext

Goal: grpck now has an (otherwise undocumented) -p option, so that
shadowconfig can clean up the results of the above, so the config
script will fail randomly less often.
Fixes: #103385
Status wrt upstream: It could certainly be submitted to upstream.
--- a/src/grpck.c
+++ b/src/grpck.c
@@ -79,6 +79,7 @@
/* Options */
static bool read_only = false;
static bool sort_mode = false;
+static bool prune = false;
/* local function prototypes */
static void fail_exit (int status);
@@ -178,7 +179,7 @@
/*
* Parse the command line arguments
*/
- while ((arg = getopt (argc, argv, "qrs")) != EOF) {
+ while ((arg = getopt (argc, argv, "qprs")) != EOF) {
switch (arg) {
case 'q':
/* quiet - ignored for now */
@@ -189,6 +190,9 @@
case 's':
sort_mode = true;
break;
+ case 'p':
+ prune = true;
+ break;
default:
usage ();
}
@@ -474,7 +478,12 @@
/*
* prompt the user to delete the entry or not
*/
- if (!yes_or_no (read_only)) {
+ if (!prune) {
+ if (!yes_or_no (read_only)) {
+ continue;
+ }
+ } else {
+ puts (_("Yes"));
continue;
}