auth: move cookie file to ~/.config/pulse/cookie

In order to follow XDG basedir, read the cookie file from
~/.config/pulse/cookie if possible, but fall back to the old file.
if it doesn't exist.
This commit is contained in:
Lennart Poettering 2012-05-15 23:59:33 +02:00
parent 9ab510a692
commit 87ae830705
14 changed files with 57 additions and 32 deletions

View file

@ -1971,7 +1971,7 @@ int pa__init(pa_module*m) {
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
if (!(u->auth_cookie = pa_auth_cookie_get(u->core, pa_modargs_get_value(ma, "cookie", PA_NATIVE_COOKIE_FILE), PA_NATIVE_COOKIE_LENGTH)))
if (!(u->auth_cookie = pa_auth_cookie_get(u->core, pa_modargs_get_value(ma, "cookie", PA_NATIVE_COOKIE_FILE), TRUE, PA_NATIVE_COOKIE_LENGTH)))
goto fail;
if (!(u->server_name = pa_xstrdup(pa_modargs_get_value(ma, "server", NULL)))) {