]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdbctl: don't expect argument to --fuzzy
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2025 10:55:24 +0000 (11:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2025 16:40:05 +0000 (17:40 +0100)
The getopt() parser was completely wrong, it expected an argument where
wasn't expected or processes.

The test cases only passed by accident because they use the "user" verb
which is also the default verb. It would be accidently read as argument
for --fuzzy and ignored.

Fix that.

src/userdb/userdbctl.c

index e47c3761d0b26f2fc6101faf237a13583a7d6c00..8a85778ef7d4a0882b11f6682bd67eee7700ae4a 100644 (file)
@@ -1227,7 +1227,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "chain",        no_argument,       NULL, ARG_CHAIN        },
                 { "uid-min",      required_argument, NULL, ARG_UID_MIN      },
                 { "uid-max",      required_argument, NULL, ARG_UID_MAX      },
-                { "fuzzy",        required_argument, NULL, 'z'              },
+                { "fuzzy",        no_argument,       NULL, 'z'              },
                 { "disposition",  required_argument, NULL, ARG_DISPOSITION  },
                 { "boundaries",   required_argument, NULL, ARG_BOUNDARIES   },
                 {}