aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-09-06 10:25:19 +0200
committerMihai Moldovan <ionic@ionic.de>2017-09-06 10:25:19 +0200
commit81569ad6b58d51cc2691f075d70f89fe470a48eb (patch)
tree8d5d8a965e35e97e6ac034047224e6106cf0a69a
parentd3f97cea2ca08f0fe5e1eafb17476e813acd204a (diff)
parent96ba6190d6743b7ac4449938b287547124cce926 (diff)
downloadnx-libs-81569ad6b58d51cc2691f075d70f89fe470a48eb.tar.gz
nx-libs-81569ad6b58d51cc2691f075d70f89fe470a48eb.tar.bz2
nx-libs-81569ad6b58d51cc2691f075d70f89fe470a48eb.zip
Merge branch 'sunweaver-pr/sun-path-is-104-on-debian-kfreebsd' into 3.6.x
Attributes GH PR #508: https://github.com/ArcticaProject/nx-libs/pull/508 Fixes: ArcticaProject/nx-libs#507
-rw-r--r--nxcomp/src/Loop.cpp8
-rw-r--r--nxcomp/src/Proxy.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index b6c82a2b4..f86ee2a4f 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -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;
diff --git a/nxcomp/src/Proxy.cpp b/nxcomp/src/Proxy.cpp
index 5529de021..dabf7532e 100644
--- a/nxcomp/src/Proxy.cpp
+++ b/nxcomp/src/Proxy.cpp
@@ -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);