socket-util-unix: Fix umask race in bind_unix_socket().
authorBen Pfaff <blp@nicira.com>
Thu, 7 Aug 2014 23:25:05 +0000 (16:25 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 7 Aug 2014 23:25:05 +0000 (16:25 -0700)
commit2d5cfef8255e09eac16feb71eb3318b6302c7bea
treeeb0bb946a9c581254a30e3cf3d9470ced6aae575
parentc38fe63e931690fd9474998d793858019fe7783c
socket-util-unix: Fix umask race in bind_unix_socket().

The umask is a process-wide value, so bind_unix_socket() races with file
creation in other Open vSwitch threads.  This fixes the race.

The workaround for non-Linux systems is not ideal, but I do not know any
other general solution.  I tested the workaround only on Linux.

CC: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
lib/socket-util-unix.c