]> err.no Git - systemd/commitdiff
logind: unlink state files when stopping
authorLennart Poettering <lennart@poettering.net>
Tue, 24 May 2011 22:58:55 +0000 (00:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Jun 2011 17:29:44 +0000 (19:29 +0200)
src/logind-seat.c
src/logind-session.c
src/logind-user.c
src/logind.h

index 24a5d8f20bf6713d9594fbc2306ec6b9780476f5..ae89ec9d8385440d3fd1efa698e5185e86affe2d 100644 (file)
@@ -75,11 +75,7 @@ void seat_free(Seat *s) {
 
         hashmap_remove(s->manager->seats, s->id);
 
-        if (s->state_file) {
-                unlink(s->state_file);
-                free(s->state_file);
-        }
-
+        free(s->state_file);
         free(s);
 }
 
@@ -323,7 +319,7 @@ int seat_stop(Seat *s) {
                         r = k;
         }
 
-        seat_save(s);
+        unlink(s->state_file);
         seat_add_to_gc_queue(s);
 
         return r;
index 566323d1e6619fb7cb235719332c9ebfc3e96468..8f1280dbdca6a6fbaf16aef844309c48422e813c 100644 (file)
@@ -86,11 +86,7 @@ void session_free(Session *s) {
 
         hashmap_remove(s->manager->sessions, s->id);
 
-        if (s->state_file) {
-                unlink(s->state_file);
-                free(s->state_file);
-        }
-
+        free(s->state_file);
         free(s);
 }
 
@@ -445,7 +441,8 @@ int session_stop(Session *s) {
         /* Remove X11 symlink */
         session_unlink_x11_socket(s);
 
-        session_save(s);
+        unlink(s->state_file);
+        session_add_to_gc_queue(s);
 
         return r;
 }
index 19db746d8bc52228c0e715c8291d47fecc779de3..7d6df8db7a8d6989be36b4b70a44db5d6c0fc7d2 100644 (file)
@@ -82,12 +82,7 @@ void user_free(User *u) {
         hashmap_remove(u->manager->users, ULONG_TO_PTR((unsigned long) u->uid));
 
         free(u->name);
-
-        if (u->state_file) {
-                unlink(u->state_file);
-                free(u->state_file);
-        }
-
+        free(u->state_file);
         free(u);
 }
 
@@ -385,6 +380,9 @@ int user_stop(User *u) {
         if (k < 0)
                 r = k;
 
+        unlink(u->state_file);
+        user_add_to_gc_queue(u);
+
         return r;
 }
 
index 7a3121629e65e5a317c50e7470b450d47c46b194..a8b387b05fe43767ad9dbab9fe33f1c32465017d 100644 (file)
@@ -39,6 +39,7 @@
  * PAM rewrite
  * spawn user systemd
  * dbus API
+ * don't allow everybody to take logind name
  *
  * non-local X11 server
  * reboot/shutdown halt management