chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: hook up PAM module with logind
[elogind.git]
/
src
/
logind-user.c
diff --git
a/src/logind-user.c
b/src/logind-user.c
index cb3e44197fc6d6b1de3c24d1991f875c93b28b9b..8ebd6eca235b1a3e7803006872ed13b50d46294d 100644
(file)
--- 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;
}
return NULL;
}
- if (asprintf(&u->state_file, "/run/systemd/user/%lu", (unsigned long) uid) < 0) {
+ if (asprintf(&u->state_file, "/run/systemd/user
s
/%lu", (unsigned long) uid) < 0) {
free(u->name);
free(u);
return NULL;
free(u->name);
free(u);
return NULL;
@@
-94,7
+94,7
@@
int user_save(User *u) {
assert(u);
assert(u->state_file);
assert(u);
assert(u->state_file);
- r = safe_mkdir("/run/systemd/user", 0755, 0, 0);
+ r = safe_mkdir("/run/systemd/user
s
", 0755, 0, 0);
if (r < 0)
goto finish;
if (r < 0)
goto finish;
@@
-152,7
+152,7
@@
finish:
int user_load(User *u) {
int r;
char *display = NULL;
int user_load(User *u) {
int r;
char *display = NULL;
- Session *s;
+ Session *s
= NULL
;
assert(u);
assert(u);
@@
-172,8
+172,10
@@
int user_load(User *u) {
return r;
}
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;
if (s && s->display && x11_display_is_local(s->display))
u->display = s;