chiark / gitweb /
login: initialize XDG_RUNTIME_DIR as /run/user/$UID instead of /run/user/$USER
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Jun 2012 15:25:28 +0000 (17:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Jun 2012 15:29:22 +0000 (17:29 +0200)
The sssd folks would like to place the kerberos credential cache in
XDG_RUNTIME_DIR, but need to do that in the PAM auth hooks, before
pam_systemd is run as part of the PAM session setup. Hence, in order to
make this easy for them: avoid usage of usernames, and use user IDs
instead thus making an additional NSS lookup unnecessary in the kerberos
bits, but still have the directory well-defined so that the kerberos
bits can determine it before pam_systemd is run.

src/login/logind-user.c

index 4622812e3c66eda4a2153e13f18f8af9864df5db..0a3f22ce9965d60fdb048683bcc11ce84fe28015 100644 (file)
@@ -259,9 +259,7 @@ static int user_mkdir_runtime_path(User *u) {
         }
 
         if (!u->runtime_path) {
-                p = strappend("/run/user/", u->name);
-
-                if (!p) {
+                if (asprintf(&p, "/run/user/%lu", (unsigned long) u->uid) < 0) {
                         log_error("Out of memory");
                         return -ENOMEM;
                 }