1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

userdbctl: add a switch for explicitly enabling/disabling multiplexer-based lookups

This is incredibly useful for debugging.
This commit is contained in:
Lennart Poettering 2021-11-08 17:27:26 +01:00
parent e032cbd591
commit 4083d825e9

View File

@ -617,6 +617,7 @@ static int help(int argc, char *argv[], void *userdata) {
" --synthesize=BOOL Synthesize root/nobody user\n" " --synthesize=BOOL Synthesize root/nobody user\n"
" --with-dropin=BOOL Control whether to include drop-in records\n" " --with-dropin=BOOL Control whether to include drop-in records\n"
" --with-varlink=BOOL Control whether to talk to services at all\n" " --with-varlink=BOOL Control whether to talk to services at all\n"
" --multiplexer=BOOL Control whether to use the multiplexer\n"
" --json=pretty|short JSON output mode\n" " --json=pretty|short JSON output mode\n"
"\nSee the %s for details.\n", "\nSee the %s for details.\n",
program_invocation_short_name, program_invocation_short_name,
@ -638,6 +639,7 @@ static int parse_argv(int argc, char *argv[]) {
ARG_WITH_DROPIN, ARG_WITH_DROPIN,
ARG_WITH_VARLINK, ARG_WITH_VARLINK,
ARG_SYNTHESIZE, ARG_SYNTHESIZE,
ARG_MULTIPLEXER,
ARG_JSON, ARG_JSON,
}; };
@ -652,6 +654,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "with-dropin", required_argument, NULL, ARG_WITH_DROPIN }, { "with-dropin", required_argument, NULL, ARG_WITH_DROPIN },
{ "with-varlink", required_argument, NULL, ARG_WITH_VARLINK }, { "with-varlink", required_argument, NULL, ARG_WITH_VARLINK },
{ "synthesize", required_argument, NULL, ARG_SYNTHESIZE }, { "synthesize", required_argument, NULL, ARG_SYNTHESIZE },
{ "multiplexer", required_argument, NULL, ARG_MULTIPLEXER },
{ "json", required_argument, NULL, ARG_JSON }, { "json", required_argument, NULL, ARG_JSON },
{} {}
}; };
@ -787,6 +790,14 @@ static int parse_argv(int argc, char *argv[]) {
SET_FLAG(arg_userdb_flags, USERDB_DONT_SYNTHESIZE, !r); SET_FLAG(arg_userdb_flags, USERDB_DONT_SYNTHESIZE, !r);
break; break;
case ARG_MULTIPLEXER:
r = parse_boolean_argument("--multiplexer=", optarg, NULL);
if (r < 0)
return r;
SET_FLAG(arg_userdb_flags, USERDB_AVOID_MULTIPLEXER, !r);
break;
case '?': case '?':
return -EINVAL; return -EINVAL;