chiark / gitweb /
Fixes to user and session saving
authorAndy Wingo <wingo@pobox.com>
Sun, 6 Mar 2016 15:56:33 +0000 (16:56 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 6 Mar 2016 16:14:24 +0000 (17:14 +0100)
* src/login/logind-dbus.c (method_create_session): No need to save
  session here, as session_send_create_reply will do it.
* src/login/logind-session-dbus.c (session_send_create_reply): On the
  other hand we do need to save the user here, so the file marks them as
  being active.

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

index 5e6952de0593add01e1c4296654878c0e42f7b5c..6f7e5692aacd398a32c436e52efbbb1021d0c65c 100644 (file)
@@ -801,8 +801,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
         if (r < 0)
                 goto fail;
 
-        session_save(session);
-
         return 1;
 
 fail:
index f71798b20864da2d6cc561fab1323fee34cc9719..337bbbbe8d141583c0105637dc6d1e16e87ca15c 100644 (file)
@@ -721,9 +721,10 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
         if (fifo_fd < 0)
                 return fifo_fd;
 
-        /* Update the session state file before we notify the client
-         * about the result. */
+        /* Update the session and user state files before we notify
+         * the client about the result. */
         session_save(s);
+        user_save(s->user);
 
         p = session_bus_path(s);
         if (!p)