mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
protocol: don't place sockets in $HOME
No server will put them there and no client will look for it there.
This commit is contained in:
parent
b70a3dca85
commit
8e8cb34dc2
|
@ -65,16 +65,8 @@ get_runtime_dir(void)
|
|||
runtime_dir = getenv("PIPEWIRE_RUNTIME_DIR");
|
||||
if (runtime_dir == NULL)
|
||||
runtime_dir = getenv("XDG_RUNTIME_DIR");
|
||||
if (runtime_dir == NULL)
|
||||
runtime_dir = getenv("HOME");
|
||||
if (runtime_dir == NULL)
|
||||
runtime_dir = getenv("USERPROFILE");
|
||||
if (runtime_dir == NULL) {
|
||||
struct passwd pwd, *result = NULL;
|
||||
char buffer[4096];
|
||||
if (getpwuid_r(getuid(), &pwd, buffer, sizeof(buffer), &result) == 0)
|
||||
runtime_dir = result ? result->pw_dir : NULL;
|
||||
}
|
||||
return runtime_dir;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,22 +55,15 @@ int get_runtime_dir(char *buf, size_t buflen, const char *dir)
|
|||
{
|
||||
const char *runtime_dir;
|
||||
struct stat stat_buf;
|
||||
char buffer[4096];
|
||||
int res, size;
|
||||
|
||||
runtime_dir = getenv("PULSE_RUNTIME_PATH");
|
||||
if (runtime_dir == NULL)
|
||||
runtime_dir = getenv("XDG_RUNTIME_DIR");
|
||||
if (runtime_dir == NULL)
|
||||
runtime_dir = getenv("HOME");
|
||||
if (runtime_dir == NULL) {
|
||||
struct passwd pwd, *result = NULL;
|
||||
if (getpwuid_r(getuid(), &pwd, buffer, sizeof(buffer), &result) == 0)
|
||||
runtime_dir = result ? result->pw_dir : NULL;
|
||||
}
|
||||
|
||||
if (runtime_dir == NULL) {
|
||||
pw_log_error(NAME": could not find a suitable runtime directory");
|
||||
pw_log_error(NAME": could not find a suitable runtime directory in"
|
||||
"$PULSE_RUNTIME_PATH and $XDG_RUNTIME_DIR");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue