chiark / gitweb /
logind: add a debug message in case the session already exists
authorDjalal Harouni <tixxdz@opendz.org>
Wed, 19 Feb 2014 22:17:45 +0000 (23:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 Mar 2014 04:34:08 +0000 (05:34 +0100)
If the session already exists then the only way to log it is to set the
debug option of pam_systemd. There are no debug messages in the login
service that permits to log if the session already exists.

So just add it, and while we are it add the "uid" field to the debug
message that indicates that the session was created.

src/login/logind-dbus.c
src/login/logind-session-dbus.c

index 235b1313d470d3f19f7739a2c1cf35b5aaaf572b..c5f9cb393075bc5de5a0aec566bcc93cada19f1b 100644 (file)
@@ -594,6 +594,17 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
                 if (!path)
                         return -ENOMEM;
 
+                log_debug("Sending reply about an existing session: "
+                          "id=%s object_path=%s uid=%u runtime_path=%s "
+                          "session_fd=%d seat=%s vtnr=%u",
+                          session->id,
+                          path,
+                          (uint32_t) session->user->uid,
+                          session->user->runtime_path,
+                          fifo_fd,
+                          session->seat ? session->seat->id : "",
+                          (uint32_t) session->vtnr);
+
                 return sd_bus_reply_method_return(
                                 message, "soshusub",
                                 session->id,
index fc728bb9d60e9d775b174b7412ab0f2332460f53..c3d4d60158f274c3b221086a917989fdc0f9d80b 100644 (file)
@@ -675,9 +675,11 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
                 return -ENOMEM;
 
         log_debug("Sending reply about created session: "
-                  "id=%s object_path=%s runtime_path=%s session_fd=%d seat=%s vtnr=%u",
+                  "id=%s object_path=%s uid=%u runtime_path=%s "
+                  "session_fd=%d seat=%s vtnr=%u",
                   s->id,
                   p,
+                  (uint32_t) s->user->uid,
                   s->user->runtime_path,
                   fifo_fd,
                   s->seat ? s->seat->id : "",