summaryrefslogtreecommitdiff
path: root/xserver/os
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2016-08-09 18:59:56 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2016-08-09 18:59:56 +0000
commit3e81c965a468dfb01615d5ec68812bcdca147faa (patch)
tree6a9f713393a7cd977cb7eaf1968824e739adc830 /xserver/os
parent12009397d721440f38cf1bd9356b5c6b86b46ac7 (diff)
Update to xserver 1.18.4
tested by krw@ and dcoppa@ ok dcoppa@
Diffstat (limited to 'xserver/os')
-rw-r--r--xserver/os/Makefile.in3
-rw-r--r--xserver/os/access.c44
2 files changed, 44 insertions, 3 deletions
diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in
index e99805462..3aa4eb043 100644
--- a/xserver/os/Makefile.in
+++ b/xserver/os/Makefile.in
@@ -176,6 +176,8 @@ BASE_FONT_PATH = @BASE_FONT_PATH@
BUILD_DATE = @BUILD_DATE@
BUILD_TIME = @BUILD_TIME@
BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@
+BUNDLE_VERSION = @BUNDLE_VERSION@
+BUNDLE_VERSION_STRING = @BUNDLE_VERSION_STRING@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
@@ -407,6 +409,7 @@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
XPBPROXY_LIBS = @XPBPROXY_LIBS@
XQUARTZ_LIBS = @XQUARTZ_LIBS@
XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
+XQUARTZ_SPARKLE_FEED_URL = @XQUARTZ_SPARKLE_FEED_URL@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
diff --git a/xserver/os/access.c b/xserver/os/access.c
index 2499a9f12..dac6f49a6 100644
--- a/xserver/os/access.c
+++ b/xserver/os/access.c
@@ -173,6 +173,10 @@ SOFTWARE.
#endif /* WIN32 */
+#if !defined(WIN32) || defined(__CYGWIN__)
+#include <libgen.h>
+#endif
+
#define X_INCLUDE_NETDB_H
#include <X11/Xos_r.h>
@@ -1081,9 +1085,8 @@ ResetHosts(const char *display)
}
}
-/* Is client on the local host */
-Bool
-ComputeLocalClient(ClientPtr client)
+static Bool
+xtransLocalClient(ClientPtr client)
{
int alen, family, notused;
Xtransaddr *from = NULL;
@@ -1116,6 +1119,41 @@ ComputeLocalClient(ClientPtr client)
return FALSE;
}
+/* Is client on the local host */
+Bool
+ComputeLocalClient(ClientPtr client)
+{
+ const char *cmdname = GetClientCmdName(client);
+
+ if (!xtransLocalClient(client))
+ return FALSE;
+
+ /* If the executable name is "ssh", assume that this client connection
+ * is forwarded from another host via SSH
+ */
+ if (cmdname) {
+ char *cmd = strdup(cmdname);
+ Bool ret;
+
+ /* Cut off any colon and whatever comes after it, see
+ * https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html
+ */
+ cmd = strtok(cmd, ":");
+
+#if !defined(WIN32) || defined(__CYGWIN__)
+ ret = strcmp(basename(cmd), "ssh") != 0;
+#else
+ ret = strcmp(cmd, "ssh") != 0;
+#endif
+
+ free(cmd);
+
+ return ret;
+ }
+
+ return TRUE;
+}
+
/*
* Return the uid and all gids of a connected local client
* Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds