diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-06 13:24:29 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-06 13:24:29 +0000 |
commit | 521d8678870697e30e39ca6afda171a230e7b4a6 (patch) | |
tree | 896130c0cd014099c10b2d2e4abc47f0065ef254 | |
parent | a2e62c87947571faa85e6e108e16409d69cc878d (diff) |
merge XFree86 4.3.99.901 (RC1) from vendor branch
-rw-r--r-- | access.c | 40 | ||||
-rw-r--r-- | auth.c | 15 | ||||
-rw-r--r-- | chooser.c | 71 | ||||
-rw-r--r-- | config/Xaccess | 17 | ||||
-rw-r--r-- | genauth.c | 4 | ||||
-rw-r--r-- | resource.c | 7 | ||||
-rw-r--r-- | session.c | 3 | ||||
-rw-r--r-- | socket.c | 8 | ||||
-rw-r--r-- | util.c | 5 | ||||
-rw-r--r-- | xdm.man.cpp | 13 | ||||
-rw-r--r-- | xdmcp.c | 26 |
11 files changed, 115 insertions, 94 deletions
@@ -1,4 +1,5 @@ /* + * $XdotOrg: access.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ * $Xorg: access.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -27,7 +28,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 +50,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 +335,7 @@ tryagain: } #else if (hostent) { - addr = &(hostent->h_addr); + addr = hostent->h_addr; addr_length = hostent->h_length; } #endif @@ -440,9 +445,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 +912,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 } } @@ -1,3 +1,4 @@ +/* $XdotOrg: auth.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ */ /* $Xorg: auth.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -26,7 +27,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 +753,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 +1053,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 } @@ -1,4 +1,5 @@ /* + * $XdotOrg: chooser.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ * $Xorg: chooser.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -26,7 +27,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 +131,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 +572,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,68 +765,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 bc2c6c3..903694c 100644 --- a/config/Xaccess +++ b/config/Xaccess @@ -1,7 +1,6 @@ +# $XdotOrg: Xaccess,v 1.3 2000/08/17 19:54:17 cpqbld Exp $ # $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.3 2001/01/17 23:45:24 dawes Exp $ +# $XFree86: xc/programs/xdm/config/Xaccess,v 1.5 2003/11/22 04:51:03 dawes Exp $ # # Access control file for XDMCP connections # @@ -88,5 +87,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 @@ -1,3 +1,4 @@ +/* $XdotOrg: genauth.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ */ /* $Xorg: genauth.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -26,7 +27,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 +438,7 @@ GenerateAuthData (char *auth, int len) auth[i] |= bit; } } + return 1; #else /* !XDMAUTH */ #ifdef ARC4_RANDOM unsigned int *rnd = (unsigned*)auth; @@ -1,3 +1,4 @@ +/* $XdotOrg: resource.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */ /* $Xorg: resource.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -130,11 +131,7 @@ int choiceTimeout; /* chooser choice timeout */ #define DEF_ACCESS_FILE "" #endif #ifndef DEF_RANDOM_FILE -# ifdef linux -# define DEF_RANDOM_FILE "/dev/urandom" -# else -# define DEF_RANDOM_FILE "/dev/mem" -# endif +#define DEF_RANDOM_FILE "/dev/mem" #endif #ifndef DEF_PRNGD_SOCKET #define DEF_PRNGD_SOCKET "/tmp/entropy" @@ -1,3 +1,4 @@ +/* $XdotOrg: session.c,v 1.8 2001/02/09 02:05:40 xorgcvs Exp $ */ /* $Xorg: session.c,v 1.8 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -588,7 +589,7 @@ StartClient ( LogError ("initgroups for \"%s\" failed, errno=%d\n", name, errno); return (0); } -#endif /* QNX4 doesn't support multi-groups, no initgroups() */ +#endif /* QNX4 doesn't support multi-groups, no initgroups() */ #ifdef USE_PAM if (pamh) { pam_error = pam_setcred (pamh, PAM_ESTABLISH_CRED); @@ -1,3 +1,4 @@ +/* $XdotOrg: socket.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */ /* $Xorg: socket.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -27,7 +28,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 +431,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 */ @@ -1,3 +1,4 @@ +/* $XdotOrg: util.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* $Xorg: util.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* @@ -26,7 +27,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 +56,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..21e13c9 100644 --- a/xdm.man.cpp +++ b/xdm.man.cpp @@ -1,3 +1,4 @@ +.\" $XdotOrg: xdm.man,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ .\" $Xorg: xdm.man,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ .\" Copyright 1988, 1994, 1998 The Open Group .\" @@ -23,7 +24,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 +807,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 @@ -1,3 +1,4 @@ +/* $XdotOrg: xdmcp.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* $Xorg: xdmcp.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* @@ -26,7 +27,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 +57,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 +252,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; |