Mageia Bugzilla – Attachment 7869 Details for
Bug 11902
random /run/user/$UID/pulse Permission denied messages on konsole
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch based on git commit 076601ee28a442868ba4ab92a6f379190f6fa0ab
0001-core-util-Fail-if-XDG_RUNTIME_DIR-belongs-to-someone-else.patch (text/plain), 772 bytes, created by
Jan Smout
on 2016-05-27 22:38:51 CEST
(
hide
)
Description:
Patch based on git commit 076601ee28a442868ba4ab92a6f379190f6fa0ab
Filename:
MIME Type:
Creator:
Jan Smout
Created:
2016-05-27 22:38:51 CEST
Size:
772 bytes
patch
obsolete
>--- a/src/pulsecore/core-util.c >+++ b/src/pulsecore/core-util.c >@@ -1816,6 +1816,14 @@ char *pa_get_runtime_dir(void) { > /* Use the XDG standard for the runtime directory. */ > d = getenv("XDG_RUNTIME_DIR"); > if (d) { >+ struct stat st; >+ if (stat(d, &st) == 0 && st.st_uid != getuid()) { >+ pa_log("XDG_RUNTIME_DIR (%s) is not owned by us (uid %d), but by uid %d! " >+ "(This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)", >+ d, getuid(), st.st_uid); >+ goto fail; >+ } >+ > k = pa_sprintf_malloc("%s" PA_PATH_SEP "pulse", d); > > if (pa_make_secure_dir(k, m, (uid_t) -1, (gid_t) -1, true) < 0) {
--- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -1816,6 +1816,14 @@ char *pa_get_runtime_dir(void) { /* Use the XDG standard for the runtime directory. */ d = getenv("XDG_RUNTIME_DIR"); if (d) { + struct stat st; + if (stat(d, &st) == 0 && st.st_uid != getuid()) { + pa_log("XDG_RUNTIME_DIR (%s) is not owned by us (uid %d), but by uid %d! " + "(This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)", + d, getuid(), st.st_uid); + goto fail; + } + k = pa_sprintf_malloc("%s" PA_PATH_SEP "pulse", d); if (pa_make_secure_dir(k, m, (uid_t) -1, (gid_t) -1, true) < 0) {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 11902
: 7869