[ovs-dev] [PATCH] Fix socket permissions on Linux

Ben Pfaff blp at ovn.org
Thu Aug 16 21:57:52 UTC 2018


On Thu, Aug 16, 2018 at 07:55:09PM +0000, Terry Wilson wrote:
> Unix sockets were not being created with the permission 0770,
> instead using the current umask value. The manpage for fchmod()
> states that that if filedes refers to a socket, the behavior is
> undefined. Insetad, use the same code as *BSD to ensure the 0770
> permission is set on unix sockets.
> 
> Signed-off-by: Terry Wilson <twilson at redhat.com>

It's extraordinarily expensive to fork() to make a single system call.

As far as I can tell, the existing code actually works on Linux, in the
same way as the third 'mode' parameter to open(2).

Surely there's a better way to do this.


More information about the dev mailing list