diff options
Diffstat (limited to 'src/systemctl/systemctl-logind.c')
-rw-r--r-- | src/systemctl/systemctl-logind.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/systemctl/systemctl-logind.c b/src/systemctl/systemctl-logind.c index 405f12a33d..4070c64257 100644 --- a/src/systemctl/systemctl-logind.c +++ b/src/systemctl/systemctl-logind.c @@ -96,17 +96,19 @@ int logind_check_inhibitors(enum action a) { char **s; int r; - if (arg_ignore_inhibitors || arg_force > 0) + if (arg_check_inhibitors == 0 || arg_force > 0) return 0; if (arg_when > 0) return 0; - if (geteuid() == 0) - return 0; + if (arg_check_inhibitors < 0) { + if (geteuid() == 0) + return 0; - if (!on_tty()) - return 0; + if (!on_tty()) + return 0; + } if (arg_transport != BUS_TRANSPORT_LOCAL) return 0; |