summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--access.c39
-rw-r--r--auth.c14
-rw-r--r--chooser.c71
-rw-r--r--config/Xaccess14
-rw-r--r--genauth.c3
-rw-r--r--socket.c7
-rw-r--r--util.c4
-rw-r--r--xdm.man.cpp12
-rw-r--r--xdmcp.c25
9 files changed, 102 insertions, 87 deletions
diff --git a/access.c b/access.c
index 567129e..006e5e6 100644
--- a/access.c
+++ b/access.c
@@ -27,7 +27,7 @@ in this Software without prior written authorization from the copyright holder.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/xdm/access.c,v 3.12 2003/07/18 15:53:28 tsi Exp $ */
+/* $XFree86: xc/programs/xdm/access.c,v 3.14 2003/11/23 22:02:07 herrb Exp $ */
/*
* Access control for XDMCP - keep a database of allowable display addresses
@@ -49,6 +49,10 @@ in this Software without prior written authorization from the copyright holder.
# include <netdb.h>
+# if defined(IPv6) && defined(AF_INET6)
+# include <arpa/inet.h>
+# endif
+
#define ALIAS_CHARACTER '%'
#define NEGATE_CHARACTER '!'
#define CHOOSER_STRING "CHOOSER"
@@ -330,7 +334,7 @@ tryagain:
}
#else
if (hostent) {
- addr = &(hostent->h_addr);
+ addr = hostent->h_addr;
addr_length = hostent->h_length;
}
#endif
@@ -440,9 +444,10 @@ ReadDisplayEntry (FILE *file)
#else
struct hostent *hostent;
- if ((hostent = gethostbyname (displayOrAlias)) == NULL)
+ if ((hostent = gethostbyname (displayOrAlias)) != NULL)
{
- addr = &(hostent->h_addr);
+ Debug("ReadDisplayEntry: %s\n", displayOrAlias);
+ addr = hostent->h_addr;
addrtype = hostent->h_addrtype;
addr_length = hostent->h_length;
}
@@ -906,6 +911,32 @@ void ForEachListenAddr (
}
if (!listenFound) {
(*listenfunction) (NULL, closure);
+#if defined(IPv6) && defined(AF_INET6) && defined(XDM_DEFAULT_MCAST_ADDR6)
+ { /* Join default IPv6 Multicast Group */
+
+ static ARRAY8 defaultMcastAddress;
+
+ if (defaultMcastAddress.length == 0) {
+ struct in6_addr addr6;
+
+ if (inet_pton(AF_INET6,XDM_DEFAULT_MCAST_ADDR6,&addr6) == 1) {
+ if (!XdmcpAllocARRAY8 (&defaultMcastAddress,
+ sizeof(struct in6_addr))) {
+ LogOutOfMem ("ReadHostEntry\n");
+ defaultMcastAddress.length = -1;
+ } else {
+ memcpy(defaultMcastAddress.data, &addr6,
+ sizeof(struct in6_addr));
+ }
+ } else {
+ defaultMcastAddress.length = -1;
+ }
+ }
+ if ( defaultMcastAddress.length == sizeof(struct in6_addr) ) {
+ (*mcastfunction) (&defaultMcastAddress, closure);
+ }
+ }
+#endif
}
}
diff --git a/auth.c b/auth.c
index 057580a..547b55b 100644
--- a/auth.c
+++ b/auth.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/xdm/auth.c,v 3.30 2003/11/16 16:35:02 herrb Exp $ */
+/* $XFree86: xc/programs/xdm/auth.c,v 3.31 2003/12/02 22:55:05 herrb Exp $ */
/*
* xdm - display manager daemon
@@ -752,6 +752,12 @@ DefineSelf(int fd, FILE *file, Xauth *auth)
Debug ("Skipping IPv6 localhost address\n");
continue;
}
+ /* Also skip XDM-AUTHORIZATION-1 */
+ if (auth->name_length == 19 &&
+ strcmp(auth->name, "XDM-AUTHORIZATION-1") == 0) {
+ Debug ("Skipping IPv6 XDM-AUTHORIZATION-1\n");
+ continue;
+ }
}
#endif
writeAddr(family, len, addr, file, auth);
@@ -1046,6 +1052,12 @@ DefineSelf (int fd, FILE *file, Xauth *auth)
Debug ("Skipping IPv6 localhost address\n");
continue;
}
+ /* Also skip XDM-AUTHORIZATION-1 */
+ if (auth->name_length == 19 &&
+ strcmp(auth->name, "XDM-AUTHORIZATION-1") == 0) {
+ Debug ("Skipping IPv6 XDM-AUTHORIZATION-1\n");
+ continue;
+ }
}
#endif
}
diff --git a/chooser.c b/chooser.c
index 4d47a12..e0d1821 100644
--- a/chooser.c
+++ b/chooser.c
@@ -26,7 +26,7 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/xdm/chooser.c,v 3.26 2003/07/18 15:53:28 tsi Exp $ */
+/* $XFree86: xc/programs/xdm/chooser.c,v 3.27 2003/11/23 22:57:31 herrb Exp $ */
/*
* Chooser - display a menu of names and let the user select one
@@ -130,9 +130,7 @@ in this Software without prior written authorization from The Open Group.
# include <sync/queue.h>
# include <sync/sema.h>
#endif
-#ifndef __GNU__
-# include <net/if.h>
-#endif /* __GNU__ */
+#include <net/if.h>
#endif /* hpux */
#include <netdb.h>
@@ -573,8 +571,6 @@ RegisterHostaddr (struct sockaddr *addr, int len, xdmOpCode type)
* addresses on the local host.
*/
-#if !defined(__GNU__)
-
/* Handle variable length ifreq in BNR2 and later */
#ifdef VARIABLE_IFREQ
#define ifr_size(p) (sizeof (struct ifreq) + \
@@ -768,69 +764,6 @@ RegisterHostname (char *name)
#endif /* IPv6 */
}
}
-#else /* __GNU__ */
-static void
-RegisterHostname (char *name)
-{
- struct hostent *hostent;
- struct sockaddr_in in_addr;
-
- if (!strcmp (name, BROADCAST_HOSTNAME))
- {
- in_addr.sin_addr.s_addr= htonl(0xFFFFFFFF);
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- BROADCAST_QUERY);
- }
- else
- {
-
- /* address as hex string, e.g., "12180022" (deprecated) */
- if (strlen(name) == 8 &&
- FromHex(name, (char *)&in_addr.sin_addr, strlen(name)) == 0)
- {
- in_addr.sin_family = AF_INET;
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- QUERY);
- } else {
-#if defined(IPv6) && defined(AF_INET6)
- char sport[8];
- struct addrinfo *ai, *nai, hints;
- bzero(&hints,sizeof(hints));
- hints.ai_socktype = SOCK_DGRAM;
- sprintf(sport, "%d", XDM_UDP_PORT);
- if (getaddrinfo(name, sport, &hints, &ai) == 0) {
- for (nai = ai ; nai != NULL ; nai = nai->ai_next) {
- if ((nai->ai_family == AF_INET) ||
- (nai->ai_family == AF_INET6)) {
- RegisterHostaddr(nai->ai_addr, nai->ai_addrlen, QUERY);
- }
- }
- }
-#else
- /* Per RFC 1123, check first for IP address in dotted-decimal form */
- else if ((in_addr.sin_addr.s_addr = inet_addr(name)) != -1)
- in_addr.sin_family = AF_INET;
- else
- {
- hostent = gethostbyname (name);
- if (!hostent)
- return;
- if (hostent->h_addrtype != AF_INET || hostent->h_length != 4)
- return;
- in_addr.sin_family = hostent->h_addrtype;
- memmove( &in_addr.sin_addr, hostent->h_addr, 4);
- }
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- QUERY);
-#endif
- }
-
- }
-}
-#endif /* __GNU__ */
static ARRAYofARRAY8 AuthenticationNames;
diff --git a/config/Xaccess b/config/Xaccess
index f0672ef..f1f8557 100644
--- a/config/Xaccess
+++ b/config/Xaccess
@@ -1,5 +1,5 @@
# $Xorg: Xaccess,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
-# $XFree86: xc/programs/xdm/config/Xaccess,v 1.4 2003/07/09 15:27:40 tsi Exp $
+# $XFree86: xc/programs/xdm/config/Xaccess,v 1.5 2003/11/22 04:51:03 dawes Exp $
#
# Access control file for XDMCP connections
#
@@ -86,5 +86,15 @@
# all unicast interfaces, but not for multicast packets. If any LISTEN lines
# are specified, then only the listed interfaces will be listened on.
#
+# IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
+# multicast addresses for XDMCP, where X in the prefix may be replaced
+# by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
+# 5 for Site-Local, and so on. The default is equivalent to the example shown
+# here using the Link-Local version to most closely match the old IPv4 subnet
+# broadcast behavior.
+#
+# LISTEN * ff02:0:0:0:0:0:0:12b
-#LISTEN * ff02::1
+# This example shows listening for multicast on all scopes up to site-local
+#
+# LISTEN * ff01:0:0:0:0:0:0:12b ff02:0:0:0:0:0:0:12b ff03:0:0:0:0:0:0:12b ff04:0:0:0:0:0:0:12b ff05:0:0:0:0:0:0:12b
diff --git a/genauth.c b/genauth.c
index 0e50226..3e68210 100644
--- a/genauth.c
+++ b/genauth.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/xdm/genauth.c,v 3.20 2003/10/17 20:20:02 herrb Exp $ */
+/* $XFree86: xc/programs/xdm/genauth.c,v 3.21 2003/11/26 07:33:10 herrb Exp $ */
/*
* xdm - display manager daemon
@@ -437,6 +437,7 @@ GenerateAuthData (char *auth, int len)
auth[i] |= bit;
}
}
+ return 1;
#else /* !XDMAUTH */
#ifdef ARC4_RANDOM
unsigned int *rnd = (unsigned*)auth;
diff --git a/socket.c b/socket.c
index b472bfb..8b0ec86 100644
--- a/socket.c
+++ b/socket.c
@@ -27,7 +27,7 @@ other dealings in this Software without prior written authorization
from the copyright holder.
*/
-/* $XFree86: xc/programs/xdm/socket.c,v 3.13 2003/07/18 15:39:52 tsi Exp $ */
+/* $XFree86: xc/programs/xdm/socket.c,v 3.14 2003/11/25 22:21:08 herrb Exp $ */
/*
* xdm - display manager daemon
@@ -430,7 +430,10 @@ UpdateMcastGroup(ARRAY8Ptr addr, void **closure)
{
struct socklist *s = (struct socklist *) *closure;
struct socklist *g;
-
+
+ if (s == NULL)
+ return;
+
g = FindInList(s->mcastgroups, addr);
if (g) { /* Already in the group, mark & continue */
diff --git a/util.c b/util.c
index 401d4ae..b3f5bce 100644
--- a/util.c
+++ b/util.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/xdm/util.c,v 3.20 2002/05/31 18:46:10 dawes Exp $ */
+/* $XFree86: xc/programs/xdm/util.c,v 3.21 2003/11/22 04:09:26 dawes Exp $ */
/*
* xdm - display manager daemon
@@ -55,7 +55,7 @@ from The Open Group.
#undef _POSIX_SOURCE
#endif
#endif
-#if defined(__osf__) || defined(linux) || defined(__QNXNTO__) || defined(__GNU__)
+#if defined(__osf__) || defined(linux) || defined(__QNXNTO__) || defined(__GLIBC__)
#define setpgrp setpgid
#endif
diff --git a/xdm.man.cpp b/xdm.man.cpp
index 9ad586e..9b0de19 100644
--- a/xdm.man.cpp
+++ b/xdm.man.cpp
@@ -23,7 +23,7 @@
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
-.\" $XFree86: xc/programs/xdm/xdm.man,v 3.26 2003/10/24 20:38:15 tsi Exp $
+.\" $XFree86: xc/programs/xdm/xdm.man,v 3.27 2003/11/22 04:51:02 dawes Exp $
.\"
.TH XDM 1 __xorgversion__
.SH NAME
@@ -806,6 +806,16 @@ LISTEN 10.11.12.13 # Listen only on this interface, as long
\& # as no other listen directives appear in
\& # file.
.fi
+.SH "IPv6 MULTICAST ADDRESS SPECIFICATION"
+.PP
+The Internet Assigned Numbers Authority has has assigned
+ff0\fIX\fP:0:0:0:0:0:0:12b as the permanently assigned range of
+multicast addresses for XDMCP. The \fIX\fP in the prefix may be replaced
+by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
+5 for Site-Local, and so on. (See IETF RFC 2373 or its replacement for
+further details and scope definitions.) xdm defaults to listening on the
+Link-Local scope address ff02:0:0:0:0:0:0:12b to most closely match the
+old IPv4 subnet broadcast behavior.
.SH "LOCAL SERVER SPECIFICATION"
.PP
The resource \fBDisplayManager.servers\fP gives a server specification
diff --git a/xdmcp.c b/xdmcp.c
index dcd28d1..14f91bc 100644
--- a/xdmcp.c
+++ b/xdmcp.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/xdm/xdmcp.c,v 3.24 2003/11/16 15:50:38 herrb Exp $ */
+/* $XFree86: xc/programs/xdm/xdmcp.c,v 3.25 2003/11/23 22:36:03 herrb Exp $ */
/*
* xdm - display manager daemon
@@ -56,9 +56,7 @@ from The Open Group.
#endif
#endif
#include <netdb.h>
-#if defined(IPv6) && defined(AF_INET6)
#include <arpa/inet.h>
-#endif
#include <time.h>
#define Time_t time_t
@@ -253,11 +251,28 @@ all_query_respond (
CARD16 connectionType;
int family;
int length;
+ const char *addrstring;
+#if defined(IPv6) && defined(AF_INET6)
+ char addrbuf[INET6_ADDRSTRLEN] = "";
+#endif
family = ConvertAddr((XdmcpNetaddr) from, &length, (char **)&(addr.data));
addr.length = length; /* convert int to short */
- Debug ("all_query_respond: conntype=%d, addr=%lx, len=%d\n",
- family, (unsigned long) *(addr.data), addr.length);
+ if (debugLevel > 0) {
+#if defined(IPv6) && defined(AF_INET6)
+ void *ipaddr;
+ if (family == AF_INET6) {
+ ipaddr = & ((struct sockaddr_in6 *) from)->sin6_addr;
+ } else {
+ ipaddr = & ((struct sockaddr_in *) from)->sin_addr;
+ }
+ addrstring = inet_ntop(family, ipaddr, addrbuf, sizeof(addrbuf));
+#else
+ addrstring = inet_ntoa(((struct sockaddr_in *)from)->sin_addr);
+#endif
+ Debug("all_query_respond: conntype=%d, addr=%s, len=%d\n",
+ family, addrstring, addr.length);
+ }
if (family < 0)
return;
connectionType = family;