summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-16 19:21:21 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-16 19:21:21 +0200
commit770858811930c0658b189d980159ea1ac5663467 (patch)
tree2f9b1d7f89171496d7aaf291f75b06dd0a62a9e9 /src/login/logind-dbus.c
parent183de6d7d9def43ec90b94e775fdc49539a950ba (diff)
logind: only release logind session from the PAM module if the same module instance actually created it
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index b95cc9bfbb..a7647e3c80 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -83,6 +83,7 @@
" <arg name=\"fd\" type=\"h\" direction=\"out\"/>\n" \
" <arg name=\"seat\" type=\"s\" direction=\"out\"/>\n" \
" <arg name=\"vtnr\" type=\"u\" direction=\"out\"/>\n" \
+ " <arg name=\"existing\" type=\"b\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"ReleaseSession\">\n" \
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
@@ -300,7 +301,7 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess
User *user = NULL;
const char *type, *class, *seat, *tty, *display, *remote_user, *remote_host, *service;
uint32_t uid, leader, audit_id = 0;
- dbus_bool_t remote, kill_processes;
+ dbus_bool_t remote, kill_processes, exists;
char **controllers = NULL, **reset_controllers = NULL;
SessionType t;
SessionClass c;
@@ -518,6 +519,8 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess
seat = session->seat ? session->seat->id : "";
vtnr = session->vtnr;
+ exists = true;
+
b = dbus_message_append_args(
reply,
DBUS_TYPE_STRING, &session->id,
@@ -526,6 +529,7 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess
DBUS_TYPE_UNIX_FD, &fifo_fd,
DBUS_TYPE_STRING, &seat,
DBUS_TYPE_UINT32, &vtnr,
+ DBUS_TYPE_BOOLEAN, &exists,
DBUS_TYPE_INVALID);
free(p);
@@ -642,6 +646,7 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess
}
seat = s ? s->id : "";
+ exists = false;
b = dbus_message_append_args(
reply,
DBUS_TYPE_STRING, &session->id,
@@ -650,6 +655,7 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess
DBUS_TYPE_UNIX_FD, &fifo_fd,
DBUS_TYPE_STRING, &seat,
DBUS_TYPE_UINT32, &vtnr,
+ DBUS_TYPE_BOOLEAN, &exists,
DBUS_TYPE_INVALID);
free(p);