util: XDG_SESSION_COOKIE is unsuitable as session ID

XDG_SESSION_COOKIE was supposed to be used for access control to the
session and should not be exposed to other users.

Replace usage of XDG_SESSION_COOKIE by XDG_SESSION_ID which is the right
choice here since it is actually a proper session ID that may be
published.
This commit is contained in:
Lennart Poettering 2012-05-15 14:04:31 +02:00
parent 8f540c6e76
commit 8a55219599

View file

@ -2758,7 +2758,8 @@ char *pa_machine_id(void) {
char *pa_session_id(void) {
const char *e;
if (!(e = getenv("XDG_SESSION_COOKIE")))
e = getenv("XDG_SESSION_ID");
if (!e)
return NULL;
return pa_utf8_filter(e);