]>
Commit | Line | Data |
---|---|---|
948def4a | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
7820a56c JW |
2 | |
3 | #include "bus-polkit.h" | |
4 | #include "logind-polkit.h" | |
5 | #include "missing_capability.h" | |
6 | #include "user-util.h" | |
7 | ||
8 | int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error) { | |
9 | #if ENABLE_POLKIT | |
10 | return bus_verify_polkit_async( | |
11 | message, | |
7820a56c | 12 | "org.freedesktop.login1.chvt", |
7b36fb9f | 13 | /* details= */ NULL, |
7820a56c JW |
14 | &manager->polkit_registry, |
15 | error); | |
16 | #else | |
17 | /* Allow chvt when polkit is not present. This allows a service to start a graphical session as a | |
18 | * non-root user when polkit is not compiled in, more closely matching the default polkit policy */ | |
19 | return 1; | |
20 | #endif | |
21 | } |