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

2018-08-20 Thread Ben Pfaff
On Mon, Aug 20, 2018 at 11:08:36AM -0400, Aaron Conole wrote: > Terry Wilson writes: > > >> Gather 'round folks, and let me tell you the tale of a series long > >> ago posted: > >> > >> https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/321866.html > >> > >> Something... something ...

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

2018-08-20 Thread Aaron Conole
Terry Wilson writes: >> Gather 'round folks, and let me tell you the tale of a series long >> ago posted: >> >> https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/321866.html >> >> Something... something ... black magic... >> I think the fchmod needs to happen after the bind for the

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

2018-08-17 Thread Ben Pfaff
On Thu, Aug 16, 2018 at 10:38:01PM -0500, Terry Wilson wrote: > >> It doesn't (and never has) on my Centos 7 machine. I ran into this a > >> couple of years ago and ended up just working around it. As an example > >> after make rpm-fedora and installing: > >> [centos@test x86_64]$ ls -al

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

2018-08-16 Thread Terry Wilson
>> It doesn't (and never has) on my Centos 7 machine. I ran into this a >> couple of years ago and ended up just working around it. As an example >> after make rpm-fedora and installing: >> [centos@test x86_64]$ ls -al /var/run/openvswitch/db.sock >> srwxr-x---. 1 openvswitch openvswitch0 Aug

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

2018-08-16 Thread Terry Wilson
> Gather 'round folks, and let me tell you the tale of a series long > ago posted: > > https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/321866.html > > Something... something ... black magic... > I think the fchmod needs to happen after the bind for the permissions > to actually be

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

2018-08-16 Thread Ben Pfaff
On Thu, Aug 16, 2018 at 06:58:54PM -0400, Aaron Conole wrote: > Terry Wilson writes: > > > On Thu, Aug 16, 2018 at 4:57 PM, Ben Pfaff wrote: > >> On Thu, Aug 16, 2018 at 07:55:09PM +, Terry Wilson wrote: > >>> Unix sockets were not being created with the permission 0770, > >>> instead using

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

2018-08-16 Thread Aaron Conole
Terry Wilson writes: > On Thu, Aug 16, 2018 at 4:57 PM, Ben Pfaff wrote: >> On Thu, Aug 16, 2018 at 07:55:09PM +, 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

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

2018-08-16 Thread Terry Wilson
>> Surely there's a better way to do this. > > I *hope* so. I mean it certainly seems like something one would want > to be able to do, but I remember looking for a couple of days 2 years > ago and giving up. umask seemed like the only reliable option. > Whatever the solution is, fchmod is *not*

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

2018-08-16 Thread Terry Wilson
On Thu, Aug 16, 2018 at 4:57 PM, Ben Pfaff wrote: > On Thu, Aug 16, 2018 at 07:55:09PM +, 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,

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

2018-08-16 Thread Ben Pfaff
On Thu, Aug 16, 2018 at 07:55:09PM +, 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