Commit 96ba6190 authored by Mike Gabriel's avatar Mike Gabriel

nxcomp/src/{Loop,Proxy}.cpp: On Debian/kFreeBSD (and other *BSD variants) the…

nxcomp/src/{Loop,Proxy}.cpp: On Debian/kFreeBSD (and other *BSD variants) the sockaddr_un.sun_path property is 104 chars long, not 108. Hard-coding Unix domain sockets in nxcomp the string length 104. Fixes ArcticaProject/nx-libs#507.
parent d3f97cea
......@@ -3810,7 +3810,15 @@ int SetupAuthInstance()
launchdAddrUnix.sun_family = AF_UNIX;
#ifdef __linux__
const int launchdAddrNameLength = 108;
#else
/* POSIX/SUS does not specify a length.
* BSD derivatives generally support 104 bytes, other systems may be more constrained.
* If you happen to run into such systems, extend this section with the appropriate limit.
*/
const int launchdAddrNameLength = 104;
#endif
int success = -1;
......
......@@ -6294,7 +6294,15 @@ int Proxy::handleNewGenericConnectionFromProxyUnix(int channelId, T_channel_type
serverAddrUnix.sun_family = AF_UNIX;
#ifdef __linux__
const int serverAddrNameLength = 108;
#else
/* POSIX/SUS does not specify a length.
* BSD derivatives generally support 104 bytes, other systems may be more constrained.
* If you happen to run into such systems, extend this section with the appropriate limit.
*/
const int serverAddrNameLength = 104;
#endif
strncpy(serverAddrUnix.sun_path, path, serverAddrNameLength);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment