summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-05-25 00:58:55 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-21 19:29:44 +0200
commitd2f92cdfd0189491387069da45734816effd8cbd (patch)
tree0b111941e299d73bebf9f916a32f545cc044d80b /src
parent14c3baca3eb8b32fc266e46127851585bee5aff2 (diff)
logind: unlink state files when stopping
Diffstat (limited to 'src')
-rw-r--r--src/logind-seat.c8
-rw-r--r--src/logind-session.c9
-rw-r--r--src/logind-user.c10
-rw-r--r--src/logind.h1
4 files changed, 10 insertions, 18 deletions
diff --git a/src/logind-seat.c b/src/logind-seat.c
index 24a5d8f20b..ae89ec9d83 100644
--- a/src/logind-seat.c
+++ b/src/logind-seat.c
@@ -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;
diff --git a/src/logind-session.c b/src/logind-session.c
index 566323d1e6..8f1280dbdc 100644
--- a/src/logind-session.c
+++ b/src/logind-session.c
@@ -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;
}
diff --git a/src/logind-user.c b/src/logind-user.c
index 19db746d8b..7d6df8db7a 100644
--- a/src/logind-user.c
+++ b/src/logind-user.c
@@ -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;
}
diff --git a/src/logind.h b/src/logind.h
index 7a3121629e..a8b387b05f 100644
--- a/src/logind.h
+++ b/src/logind.h
@@ -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