I have a program which creates a socket, and then I want to change the permissions of the socket file:
ret_val = chmod(filename, 0777);
, but it doesn't change, even though ret_val will be 0. If I try the same thing on a regular file, it works.
Any ideas?
P.S: I am running the program as root, so it has all the authority needed.
From
man 7 unix
:So if you want to control permissions on a socket, in order to be portable, you should instead control the permissions of the directory containing the socket.