summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <wjt@endlessos.org>2021-11-11 15:48:04 +0000
committerPhaedrus Leeds <mwl458@gmail.com>2022-01-04 10:44:37 -0800
commitf95636cfe28314a1620e5365513fe56b77943cec (patch)
tree6ca8d7b77cd83217e529e596db29c550f04dfcdf
parent369d922d2c1546a2eb2525e40895d5f1f7f79e4b (diff)
downloadflatpak-f95636cfe28314a1620e5365513fe56b77943cec.tar.gz
run: Support PulseAudio socket path without unix: prefix
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/ says: > If the string starts with / or unix: the remaining address string is taken as > UNIX socket name. but previously the string was only taken to be a UNIX socket name if it began with "unix:". This is an issue in practice with WSLg <https://github.com/microsoft/wslg> which sets $PULSE_SERVER to "/mnt/wslg/PulseServer", without a "unix:" prefix. (cherry picked from commit 7534a970a5535d57d5fa07bd5ed9eb3647cbb7dc)
-rw-r--r--common/flatpak-run.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/flatpak-run.c b/common/flatpak-run.c
index fc66672f..7059303e 100644
--- a/common/flatpak-run.c
+++ b/common/flatpak-run.c
@@ -591,8 +591,11 @@ flatpak_run_parse_pulse_server (const char *value)
continue;
server = closing + 1;
}
+
if (g_str_has_prefix (server, "unix:"))
return g_strdup (server + 5);
+ if (server[0] == '/')
+ return g_strdup (server);
}
return NULL;