Re: UNIX domain socket (Solarisx86 2.5)

Vic Abell (abe@VIC.CC.PURDUE.EDU)
Wed, 21 May 1997 14:15:48 -0500

In message <199705210918.LAA29462@albano>you write:
>
>I've tried some tests and it seems that the mode of a unix domain socket
>is ignored in both (created mode 0 in Solaris 2, mode 777 in SunOS 4).
>
>If I protect the directory that holds the socket (remove execute permission;
>read permission obviously isn't used), then I cannot connect both in SunOS 4.x
>and in Solaris 2.x.

For a separate reason I was testing, too, and found the above
statement about Solaris to be true in 2.5 and 2.6, but not in 2.5.1.
(It's probably true in Solaris < 2.5, but I didn't test that.)

On my 2.5.1 test system a bind() to a UNIX domain named socket
creates the file system object mode 0, and a connect() to a UNIX
domain file system object with mode 0 is ECONNREFUSED. It appears
the listener process must do a non-zero chmod() of the file system
object after the bind has created it to allow another process to
connect to it.

Solaris 2.5 and 2.6 seem to create the UNIX file system object for
a UNIX domain socket with non-zero mode bits.

>Casper

Vic