mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
protocol-native: don't initialize sockets in $HOME
Leaving sockets in the home directories is bad form, so let's not do this. This effectively requires XDG_RUNTIME_DIR to be set for pipewire to work - it is set correctly on most setups anyway and on custom setups this needs to be addressed with a custom environment. Fixes #1443
This commit is contained in:
parent
5c78cbd356
commit
b70a3dca85
1 changed files with 2 additions and 10 deletions
|
|
@ -535,16 +535,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;
|
||||
}
|
||||
|
||||
|
|
@ -562,8 +554,8 @@ static int init_socket_name(struct server *s, const char *name)
|
|||
pw_log_debug("name:%s runtime_dir:%s", name, runtime_dir);
|
||||
|
||||
if (runtime_dir == NULL && !path_is_absolute) {
|
||||
pw_log_error("server %p: name %s is not an absolute path and no runtime dir found."
|
||||
"set one of PIPEWIRE_RUNTIME_DIR, XDG_RUNTIME_DIR, HOME or "
|
||||
pw_log_error("server %p: name %s is not an absolute path and no runtime dir found. "
|
||||
"Set one of PIPEWIRE_RUNTIME_DIR, XDG_RUNTIME_DIR or "
|
||||
"USERPROFILE in the environment", s, name);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue