From 35c9650e0ee8e72fcc8334817ce29076024fa4ce Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Oct 2022 11:49:52 +0200 Subject: [PATCH] pulse-server: do chmod of the socket like pulseaudio Pulseaudio sets the socket permissions to 0777 with chmod when the socket was not from systemd. Do the same. Fixes #1729 --- src/modules/module-protocol-pulse/server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/server.c b/src/modules/module-protocol-pulse/server.c index af1913b95..89f343a12 100644 --- a/src/modules/module-protocol-pulse/server.c +++ b/src/modules/module-protocol-pulse/server.c @@ -616,7 +616,6 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag pw_log_warn("server %p: unlink('%s') failed: %m", server, addr_un->sun_path); } - if (bind(fd, (const struct sockaddr *) addr_un, SUN_LEN(addr_un)) < 0) { res = -errno; pw_log_warn("server %p: bind() to '%s' failed: %m", @@ -624,6 +623,10 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag goto error_close; } + if (chmod(addr_un->sun_path, 0777) < 0) + pw_log_warn("server %p: chmod('%s') failed: %m", + server, addr_un->sun_path); + if (listen(fd, server->listen_backlog) < 0) { res = -errno; pw_log_warn("server %p: listen() on '%s' failed: %m",