summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-08 15:33:46 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-08 23:13:45 +0100
commit079dac08c6a2725ce6e5ed2afa3f03d057c999c6 (patch)
tree05d1d88d5f963146065912aad58c12b528c2412c /src/login
parentacf97e213e69a97e63ab8f7fad7ecd53608c757a (diff)
systemctl,loginctl: start polkit agent for all polkit enabled operations
Diffstat (limited to 'src/login')
-rw-r--r--src/login/loginctl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 57a0ab0840..9f7790389a 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -50,8 +50,8 @@ static bool arg_legend = true;
static const char *arg_kill_who = NULL;
static int arg_signal = SIGTERM;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
-static bool arg_ask_password = true;
static char *arg_host = NULL;
+static bool arg_ask_password = true;
static unsigned arg_lines = 10;
static OutputMode arg_output = OUTPUT_SHORT;
@@ -827,6 +827,8 @@ static int activate(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
r = sd_bus_call_method (
@@ -856,6 +858,8 @@ static int kill_session(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
if (!arg_kill_who)
arg_kill_who = "all";
@@ -921,6 +925,8 @@ static int terminate_user(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
uid_t uid;
@@ -952,6 +958,8 @@ static int kill_user(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
if (!arg_kill_who)
arg_kill_who = "all";
@@ -1036,6 +1044,8 @@ static int lock_sessions(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
r = sd_bus_call_method (
bus,
"org.freedesktop.login1",
@@ -1057,6 +1067,8 @@ static int terminate_seat(sd_bus *bus, char **args, unsigned n) {
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
r = sd_bus_call_method (
@@ -1077,6 +1089,7 @@ static int terminate_seat(sd_bus *bus, char **args, unsigned n) {
}
static void help(void) {
+
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"Send control commands to or query the login manager.\n\n"
" -h --help Show this help\n"