ipc: set file permissions on created sockets

When using sockets for IPC the file permissions default to whatever
the umask is.  This isn't a problem on Linux since it uses abstract
namespace sockets which don't have any permissions, but on other
platforms this causes problems with pacemaker which spawns processes
under the hacluster user and ends up failing to connect.
This commit is contained in:
David Shane Holden 2016-01-18 17:17:54 -05:00
parent a1011c5f18
commit 29b2c44fb6

View File

@ -84,6 +84,9 @@ qb_ipc_dgram_sock_setup(const char *base_name,
#endif
res = bind(request_fd, (struct sockaddr *)&local_address,
sizeof(local_address));
#if !(defined(QB_LINUX) || defined(QB_CYGWIN))
chmod(local_address.sun_path, 0660);
#endif
if (res < 0) {
goto error_connect;
}