From b70a3dca85bbcb6089c49f880a452be26130bb6d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 27 Jul 2021 10:49:40 +1000 Subject: [PATCH] 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 --- src/modules/module-protocol-native.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c index 5aa88b852..d57bcf8c9 100644 --- a/src/modules/module-protocol-native.c +++ b/src/modules/module-protocol-native.c @@ -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; }