summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-15 11:11:52 +0100
committerLennart Poettering <lennart@poettering.net>2019-11-15 11:11:52 +0100
commitc59e2ec6961e6ce1acb97bb2cdb7499dc23bc23d (patch)
treea07981df67c58ab09c25cf5b78f0b50faa99dcb1 /src/systemctl
parent385d581b7429f9d1d6d2826eac82e581468656f9 (diff)
downloadsystemd-c59e2ec6961e6ce1acb97bb2cdb7499dc23bc23d.tar.gz
ask-password-agent: introduce ask_password_agent_open_if_enabled()
This makes the ask-password agent handling more alike the polkit agent handling again, and introduces ask_password_agent_open_if_enabled() that works just like the already existing polkit_agent_open_if_enabled().
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 4be695d5b6..012867fbb0 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -236,22 +236,16 @@ static void release_busses(void) {
buses[w] = sd_bus_flush_close_unref(buses[w]);
}
-static void ask_password_agent_open_if_enabled(void) {
+static void ask_password_agent_open_maybe(void) {
/* Open the password agent as a child process if necessary */
if (arg_dry_run)
return;
- if (!arg_ask_password)
- return;
-
if (arg_scope != UNIT_FILE_SYSTEM)
return;
- if (arg_transport != BUS_TRANSPORT_LOCAL)
- return;
-
- ask_password_agent_open();
+ ask_password_agent_open_if_enabled(arg_transport, arg_ask_password);
}
static void polkit_agent_open_maybe(void) {
@@ -3071,7 +3065,7 @@ static int start_unit(int argc, char *argv[], void *userdata) {
if (r < 0)
return r;
- ask_password_agent_open_if_enabled();
+ ask_password_agent_open_maybe();
polkit_agent_open_maybe();
if (arg_action == ACTION_SYSTEMCTL) {