unix.7: Expand discussion of socket permissions

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-06-17 18:47:24 +02:00
parent ce552c68fb
commit 7578ea2f85
1 changed files with 7 additions and 3 deletions

View File

@ -506,9 +506,13 @@ filesystem honor the permissions of the directory they are in.
Creation of a new socket will fail if the process does not have write and
search (execute) permission on the directory the socket is created in.
Connecting to a stream socket object requires write permission.
This behavior differs from many BSD-derived systems,
which ignore permissions for UNIX domain sockets.
On Linux,
connecting to a stream socket object requires write permission on that socket;
sending a datagram to a datagram socket likewise
requires write permission on that socket.
POSIX does not make any statement about the effect of the permissions
on a socket file, and on many systems (e.g., several BSD derivatives),
the socket permissions are ignored.
Portable programs should not rely on
this feature for security.