summaryrefslogtreecommitdiff
path: root/src/login/loginctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-24 05:29:37 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-24 05:29:37 +0100
commitb61600291e3bbc51482bbb9823ccd48f03c130da (patch)
treec969553d781619f4809a2de98d7198a2c3dcf0fe /src/login/loginctl.c
parentee17c9281d3c208ca3f4fadd800990e61e8fd4f2 (diff)
logind: add UnlockSessions() clal to complement LockSessions()
Diffstat (limited to 'src/login/loginctl.c')
-rw-r--r--src/login/loginctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 0e57e0828e..473c77b92d 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -1287,6 +1287,8 @@ static int flush_devices(DBusConnection *bus, char **args, unsigned n) {
}
static int lock_sessions(DBusConnection *bus, char **args, unsigned n) {
+ assert(args);
+
polkit_agent_open_if_enabled();
return bus_method_call_with_reply (
@@ -1294,7 +1296,7 @@ static int lock_sessions(DBusConnection *bus, char **args, unsigned n) {
"org.freedesktop.login1",
"/org/freedesktop/login1",
"org.freedesktop.login1.Manager",
- "LockSessions",
+ streq(args[0], "lock-sessions") ? "LockSessions" : "UnlockSessions",
NULL,
NULL,
DBUS_TYPE_INVALID);
@@ -1348,6 +1350,7 @@ static int help(void) {
" lock-session [ID...] Screen lock one or more sessions\n"
" unlock-session [ID...] Screen unlock one or more sessions\n"
" lock-sessions Screen lock all current sessions\n"
+ " unlock-sessions Screen unlock all current sessions\n"
" terminate-session [ID...] Terminate one or more sessions\n"
" kill-session [ID...] Send signal to processes of a session\n"
" list-users List users\n"
@@ -1496,6 +1499,7 @@ static int loginctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
{ "lock-session", MORE, 2, activate },
{ "unlock-session", MORE, 2, activate },
{ "lock-sessions", EQUAL, 1, lock_sessions },
+ { "unlock-sessions", EQUAL, 1, lock_sessions },
{ "terminate-session", MORE, 2, activate },
{ "kill-session", MORE, 2, kill_session },
{ "list-users", EQUAL, 1, list_users },