chmod() converts local domain socket file to regular file

Corinna Vinschen
Mon May 14 12:12:00 GMT 2007

On Apr 27 12:58, Andrey Simonenko wrote:
> Greetings,
> Has Cygwin 1.5.24-2 and XP.
> A program creates local domain socket.  If S_IRUSR bit is
> removed from the socket file, then this file is converted to a
> regular file.

This is a chicken-egg problem, sort of.  The fact that the file
represents an AF_LOCAL socket is coded into the content of the file
itself.  If you remove the S_IRxxx flags, the file can't be read anymore
and Cygwin can't figure out that this is a socket file.

It's arguably a bug in Cygwin that it's possible to remove the read
flags entirely from a socket file, but so far I'm not quite sure what
the best solution to this problem is.  I'm looking into fixing that but
for now the answer is just "don't do that".


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list