Subject: Re: Are permissions of local sockets correct?
To: Michael van Elst <>
From: Julio M. Merino Vidal <>
List: tech-kern
Date: 08/22/2005 21:34:52
On 8/22/05, Michael van Elst <> wrote:
> ("Julio M. Merino Vidal") writes:
> >while trying gamin (a file alteration monitor, like fam), I found that i=
> >refuses to work because it detects that the local sockets it creates
> >have "too much permissions" (that is, 777).
> Many UNIX variants ignore the mode bits for local sockets. This is
> probably just 'traditional' but also makes local sockets more similar
> to network sockets.
> >FreeBSD, OpenBSD and Linux respect the umask.  If our behavior is
> >not correct, what about the following patch?
> Our behaviour is at least not consistent as connect() seems to honor
> the mode bits when you change them with chmod.
> Does fchmod() work?

No, it doesn't.  It returns EINVAL.

I also checked what Linux does and, while it returns success, it does
not change the permissions.

chmod works correctly, though.

What should we do then?  Make fchmod(2) work with sockets too?


Julio M. Merino Vidal <>
The NetBSD Project -