Contents
Are UNIX domain sockets secure?
In short, Unix domain sockets are secure in general. You can use POSIX permissions to lock down access to the file descriptor (FD) associated with the socket, and the server side can request information such as credentials and PID of clients before they can fully connect.
How do UNIX domain sockets work?
Unix sockets are bidirectional. This means that every side can perform both read and write operations. While, FIFOs are unidirectional: it has a writer peer and a reader peer. Unix sockets create less overhead and communication is faster, than by localhost IP sockets.
Is socket write blocking?
If there is not enough available buffer space to hold the socket data to be transmitted, and the socket is in blocking mode, write() blocks the caller until additional buffer space becomes available.
What is the purpose of generic socket address structure?
Generic Socket Address Structure A socket address structures is always passed by reference when passed as an argument to any socket functions. But any socket function that takes one of these pointers as an argument must deal with socket address structures from any of the supported protocol families.
How do I create a domain socket in UNIX?
To create a UNIX domain socket, use the socket function and specify AF_UNIX as the domain for the socket. The z/TPF system supports a maximum number of 16,383 active UNIX domain sockets at any time. After a UNIX domain socket is created, you must bind the socket to a unique file path by using the bind function.
Is it safe to use Unix domain sockets?
In short, Unix domain sockets are secure in general. You can use POSIX permissions to lock down access to the file descriptor (FD) associated with the socket, and the server side can request information such as credentials and PID of clients before they can fully connect.
What are the permissions for a Unix socket?
While the permissions of the parent directory will still be applied, these may be harder to administer than the permissions on the socket file itself. Unix domain sockets provide another means for verifying the identity of the remote process: SCM_CREDENTIALS, as documented in unix (7).
Can a socket file be ignored in HP-UX?
Yes, you can do this, but it may not be the best design since, on some systems, such as HP-UX, the permissions of the socket file are ignored. While the permissions of the parent directory will still be applied, these may be harder to administer than the permissions on the socket file itself.
Can you see the socket file from root?
Yes. Since me is the only user with permissions, they are the only ones who may enter that folder and view the socket. root, of course, is root. Yes, you can do this, but it may not be the best design since, on some systems, such as HP-UX, the permissions of the socket file are ignored.