diff options
Diffstat (limited to 'xserver/os')
-rw-r--r-- | xserver/os/Makefile.in | 3 | ||||
-rw-r--r-- | xserver/os/access.c | 44 |
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 |