2

I am working on a project which runs on different platforms including Linux, Solaris, HP-UX & IBM-AIX.

When we create a new socket using socket(), system creates pathname socket and also, creates a file in some temp directory. I am trying to set up an environment where this file doesn't get created.

I have found a solution for Linux. In Linux, there is notion of 'Abstract Socket'. An abstract socket address is distinguished (from a pathname socket) by the fact that sun_path[0] is a null byte ('\0'). For more info, please refer the man page - http://man7.org/linux/man-pages/man7/unix.7.html

I am trying to find out similar solution i.e. 'no file should be created for a socket' for other platforms namely Solaris, HP-UX & IBM-AIX.

shahidbits
  • 121
  • 10

1 Answers1

0

For AIX, I am pretty sure that there is no equivalent as abstract socket. There is shared memory and other interprocess communication facilities.

For unix domain socket, I believe it is the file system that provides the security / protection if that is desired. e.g. you can restrict the path to a particular group and then the file system will make sure that only that uses in that group (as in /etc/group) can access that path.

pedz
  • 2,271
  • 1
  • 17
  • 20