summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-07-06 00:44:39 +0000
committerEric Anholt <anholt@freebsd.org>2004-07-06 00:44:39 +0000
commit616e67f2b69018a7c6ffd91f1742ece51c4c5f78 (patch)
treee657c55edb343ae37bee58f39e31777f061b5249
parentc5072fb61a23d4b4063d9c2f6043c23ff200af1b (diff)
XFree86 bugzilla #1376: xdm opens random tcp sockets
"Even when DisplayManager.requestPort is set to 0, xdm will open a chooserFd tcp socket on all interfaces. This apparently cannot be disabled by configuration and presents a possible security risk. Older versions of xdm/socket.c appear to have checked and aborted if request_port == 0, but the current one does not..."
-rw-r--r--socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index a5a4dc7..6193a5a 100644
--- a/socket.c
+++ b/socket.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/xdm/socket.c,v 1.2 2004/04/23 19:54:42 eich Exp $ */
/* $Xorg: socket.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */
/*
@@ -67,6 +67,9 @@ CreateWellKnownSockets (void)
char *name = localHostname ();
registerHostname (name, strlen (name));
+ if (request_port == 0)
+ return;
+
#if defined(IPv6) && defined(AF_INET6)
chooserFd = socket (AF_INET6, SOCK_STREAM, 0);
if (chooserFd == -1)