From: Andre Noll Date: Tue, 19 Jul 2016 17:03:15 +0000 (+0200) Subject: Make local sockets world-readable. X-Git-Tag: v0.5.7~42 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=1ada5f286b031bde90d5cdaf8f85311cbfa7db6b;hp=8945705ac35cb77b23ad4cfc732fa884bceb7e35 Make local sockets world-readable. We already have S_IWOTH, so it's kind of pointless to not permit read access to the socket special. This patch changes afs.c and audiod.c to create sockets with mode 666 which was probably intended anyway. The patch should not cause any compatibility issues since on Linux we check credentials with SCM_CREDENTIALS while *BSD ignores permissions for UNIX domain sockets. According to unix(7), portable programs should not rely on them. --- diff --git a/afs.c b/afs.c index cc3fc020..01632984 100644 --- a/afs.c +++ b/afs.c @@ -649,7 +649,7 @@ static int setup_command_socket_or_die(void) ret = create_local_socket(socket_name, 0); if (ret < 0) { ret = create_local_socket(socket_name, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH); + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IROTH); if (ret < 0) { PARA_EMERG_LOG("%s: %s\n", para_strerror(-ret), socket_name); diff --git a/audiod.c b/audiod.c index 5909859b..2f9d5da3 100644 --- a/audiod.c +++ b/audiod.c @@ -1072,7 +1072,7 @@ static void init_local_sockets(struct command_task *ct) unlink(socket_name); ct->fd[0] = create_local_socket(socket_name, 0); ct->fd[1] = create_local_socket(socket_name, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH); + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (ct->fd[0] >= 0 || ct->fd[1] >= 0) return; PARA_EMERG_LOG("%s\n", para_strerror(-ct->fd[1]));