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
This commit is contained in:
Wim Taymans 2022-10-20 11:49:52 +02:00
parent e5881e9afb
commit 35c9650e0e

View file

@ -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",