summaryrefslogtreecommitdiff
path: root/src/login/logind-inhibit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-21 11:57:48 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-21 11:57:48 +0200
commit409133be63387fc04d927e8aecd2f6ba03d2f143 (patch)
tree53805338e9e71c3344d6f46320c9dbf506612768 /src/login/logind-inhibit.c
parent68e9f6e6be9e6e14a71788b490ba8cdc3ed7f2b5 (diff)
logind: allow users to override their own suspend/sleep inhibitors
Diffstat (limited to 'src/login/logind-inhibit.c')
-rw-r--r--src/login/logind-inhibit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index fce2f4dd90..66e4c29f36 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -364,7 +364,9 @@ bool manager_is_inhibited(
InhibitWhat w,
InhibitMode mm,
dual_timestamp *since,
- bool only_active) {
+ bool ignore_inactive,
+ bool ignore_uid,
+ uid_t uid) {
Inhibitor *i;
Iterator j;
@@ -381,7 +383,10 @@ bool manager_is_inhibited(
if (i->mode != mm)
continue;
- if (only_active && pid_is_active(m, i->pid) <= 0)
+ if (ignore_inactive && pid_is_active(m, i->pid) <= 0)
+ continue;
+
+ if (ignore_uid && i->uid == uid)
continue;
if (!inhibited ||