summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-10-02 16:09:24 +0200
committerSven Eden <yamakuzure@gmx.net>2017-10-02 16:09:24 +0200
commit5675cf5cfbd89cb6d887c5e74ca0132f933d222c (patch)
tree1b4fd9ddf702b294e91ea47d4dab0f66919dce36 /src/login/logind-dbus.c
parentad9cd1015e7428c8a1a989e64b774491428fc839 (diff)
logind: don's change dry-run boolean before we actually enqueue the operation
Let's not affect change before the PK check.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 1769f221e..699290c8a 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2079,6 +2079,7 @@ static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_
uint64_t elapse;
char *type;
int r;
+ bool dry_run = false;
assert(m);
assert(message);
@@ -2090,7 +2091,7 @@ static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_
if (startswith(type, "dry-")) {
type += 4;
- m->shutdown_dry_run = true;
+ dry_run = true;
}
if (streq(type, "poweroff")) {
@@ -2134,6 +2135,8 @@ static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_
return log_oom();
}
+ m->shutdown_dry_run = dry_run;
+
if (m->nologin_timeout_source) {
r = sd_event_source_set_time(m->nologin_timeout_source, elapse);
if (r < 0)