summaryrefslogtreecommitdiff
path: root/src/logind-user.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-24 18:50:50 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-24 18:50:50 +0200
commit98a28fef2618e54a644614c759f371f297381b70 (patch)
treeac0f1d97bce1a298706d367c0b788a956f700bda /src/logind-user.c
parent77527da0a02029ce9c5ec86d5db5ea42147a658f (diff)
logind: hook up PAM module with logind
Diffstat (limited to 'src/logind-user.c')
-rw-r--r--src/logind-user.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/logind-user.c b/src/logind-user.c
index cb3e44197f..8ebd6eca23 100644
--- a/src/logind-user.c
+++ b/src/logind-user.c
@@ -45,7 +45,7 @@ User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) {
return NULL;
}
- if (asprintf(&u->state_file, "/run/systemd/user/%lu", (unsigned long) uid) < 0) {
+ if (asprintf(&u->state_file, "/run/systemd/users/%lu", (unsigned long) uid) < 0) {
free(u->name);
free(u);
return NULL;
@@ -94,7 +94,7 @@ int user_save(User *u) {
assert(u);
assert(u->state_file);
- r = safe_mkdir("/run/systemd/user", 0755, 0, 0);
+ r = safe_mkdir("/run/systemd/users", 0755, 0, 0);
if (r < 0)
goto finish;
@@ -152,7 +152,7 @@ finish:
int user_load(User *u) {
int r;
char *display = NULL;
- Session *s;
+ Session *s = NULL;
assert(u);
@@ -172,8 +172,10 @@ int user_load(User *u) {
return r;
}
- s = hashmap_get(u->manager->sessions, display);
- free(display);
+ if (display) {
+ s = hashmap_get(u->manager->sessions, display);
+ free(display);
+ }
if (s && s->display && x11_display_is_local(s->display))
u->display = s;