lib: allow group access to Unix domain sockets
authorAndy Zhou <azhou@nicira.com>
Sat, 10 Oct 2015 02:45:46 +0000 (19:45 -0700)
committerAndy Zhou <azhou@nicira.com>
Thu, 12 Nov 2015 02:06:02 +0000 (18:06 -0800)
commit2258d8b5d2099d7a2b56c8414e6d3bddc9b43f0f
tree1d0cf938cf521920aa1b3ba8cda8f24c92380bd4
parent3de44dd188690763cfa8f08cf36c64ade0174501
lib: allow group access to Unix domain sockets

By default, Unix domain sockets are created with file system permission
mode of 0700. This means that only processes that runs under the same
user can access this socket.

For OVS, it may be more convenient to control access at the group
level rather than at the user level, since other processes need to
access OVSDB and UNIXCTL sockets while running under different users.

This patch changes Unix domain sockets' file system permission to 0770,
to grant group access.

It has not been an issue in the past since OVS, until very recently,
had to run as root. If a process needed to access OVSDB or UNIXCTL
sockets, it had to be a root process as well.

With the added --user option to OVS daemons and this change, system
administrators can deploy OVS more securely: OVS daemons can run as
a non root user. Various processes that need to talk to OVS does not
have to run as root process anymore.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
lib/socket-util-unix.c