From 4a287cc2b6d849c29b43af07d93fa0048d8d6e90 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 18 Jun 2019 10:41:02 +0200 Subject: [PATCH] xwayland: Allow for regular transport types for listen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xwayland uses the command line option “-listen” to pass file descriptors from the Wayland compositor. That breaks the traditional, documented behavior of the “-listen” command line option which is to enable a transport type. Checks if the given option starts with a digit, otherwise treat it as a regular transport type. Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/817 Suggested-by: Rodrigo Exterckötter Tjäder Signed-off-by: Olivier Fourdan --- hw/xwayland/xwayland.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 739f86cf1..72b2be1b6 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -115,6 +115,10 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(argv[i], "-listen") == 0) { CHECK_FOR_REQUIRED_ARGUMENTS(1); + /* Not an FD */ + if (!isdigit(*argv[i + 1])) + return 0; + NoListenAll = TRUE; if (listen_fd_count == ARRAY_SIZE(listen_fds)) FatalError("Too many -listen arguments given, max is %zu\n",