mirror of
https://github.com/systemd/systemd.git
synced 2025-01-24 06:04:05 +03:00
logind: don's change dry-run boolean before we actually enqueue the operation
Let's not affect change before the PK check.
This commit is contained in:
parent
15e99a4392
commit
d13f5e164e
@ -2037,6 +2037,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);
|
||||
@ -2047,7 +2048,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")) {
|
||||
@ -2091,6 +2092,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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user