summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:02 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:02 +0000
commit8aabaadcdab5bcbaa88583377aac04d130e56605 (patch)
tree5d872f2eea00eb13e76abd000ba58aa67f7dafa1
parentb05807f4088054b704dc8854ce08822bea72c161 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330
-rw-r--r--main.c50
-rw-r--r--pmdb.c4
-rw-r--r--pmint.h6
-rw-r--r--proxymngr.man6
4 files changed, 46 insertions, 20 deletions
diff --git a/main.c b/main.c
index ea23ab9..cfd1955 100644
--- a/main.c
+++ b/main.c
@@ -25,7 +25,7 @@ not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/proxymngr/main.c,v 1.7 2001/12/19 21:37:35 dawes Exp $ */
+/* $XFree86: xc/programs/proxymngr/main.c,v 1.9 2003/07/09 15:27:36 tsi Exp $ */
#include <stdlib.h>
#include "pmint.h"
@@ -84,12 +84,11 @@ void
SetCloseOnExec (fd)
int fd;
{
- int ret;
#ifdef F_SETFD
#ifdef FD_CLOEXEC
- ret = fcntl (fd, F_SETFD, FD_CLOEXEC);
+ (void) fcntl (fd, F_SETFD, FD_CLOEXEC);
#else
- ret = fcntl (fd, F_SETFD, 1);
+ (void) fcntl (fd, F_SETFD, 1);
#endif /* FD_CLOEXEC */
#endif /* F_SETFD */
}
@@ -430,8 +429,10 @@ Bool swap;
char *authName = NULL, *authData = NULL;
int authLen;
+#if 0 /* No-op */
CHECK_AT_LEAST_SIZE (iceConn, pmConn->pmOpcode, opcode,
length, SIZEOF (pmGetProxyAddrMsg), IceFatalToProtocol);
+#endif
IceReadCompleteMessage (iceConn, SIZEOF (pmGetProxyAddrMsg),
pmGetProxyAddrMsg, pMsg, pStart);
@@ -483,17 +484,21 @@ Bool swap;
* different host than the client or the client host,
* proxy host and the server host may all be different,
* thus a serverAddress of :0 or :0.0 is not useful.
- * Therefore, change serverAddrees to use the client's
+ * Therefore, change serverAddress to use the client's
* hostname.
*/
char *tmpName;
- tmpName = strchr (serverAddress, ':');
+ tmpName = strrchr (serverAddress, ':');
- if (tmpName && ((serverAddress[0] == ':') ||
+ if (tmpName && ((tmpName == serverAddress) ||
(!strncmp (serverAddress, "unix:", 5))))
{
+#if defined(IPv6) && defined(AF_INET6)
+ struct sockaddr_storage serverSock;
+#else
struct sockaddr_in serverSock;
+#endif
int retVal;
int addrLen = sizeof(serverSock);
@@ -502,20 +507,43 @@ Bool swap;
(void *) &addrLen);
if (!retVal)
{
+ char *canonname = NULL;
+#if defined(IPv6) && defined(AF_INET6)
+ char hostname[NI_MAXHOST];
+ struct addrinfo *ai = NULL, hints;
+
+ if (getnameinfo((struct sockaddr *) &serverSock,
+ addrLen, hostname, sizeof(hostname), NULL, 0, 0) == 0) {
+ (void)memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_CANONNAME;
+ if (getaddrinfo(hostname, NULL, &hints, &ai) == 0) {
+ canonname = ai->ai_canonname;
+ } else {
+ ai = NULL;
+ }
+ }
+#else
struct hostent *hostent;
hostent = gethostbyname (inet_ntoa(serverSock.sin_addr));
if (hostent && hostent->h_name)
+ canonname = hostent->h_name;
+#endif
+ if (canonname)
{
int len;
char * pch = strdup (tmpName);
- len = strlen(hostent->h_name) + strlen(tmpName) + 1;
+ len = strlen(canonname) + strlen(tmpName) + 1;
serverAddress = (char *) realloc (serverAddress, len);
- sprintf (serverAddress, "%s%s", hostent->h_name, pch);
+ sprintf (serverAddress, "%s%s", canonname, pch);
free (pch);
}
+#if defined(IPv6) && defined(AF_INET6)
+ if (ai != NULL)
+ freeaddrinfo(ai);
+#endif
}
}
}
@@ -562,8 +590,10 @@ Bool swap;
char *authName;
char *authData;
+#if 0 /* No-op */
CHECK_AT_LEAST_SIZE (iceConn, pmConn->pmOpcode, opcode,
length, SIZEOF (pmStartProxyMsg), IceFatalToProtocol);
+#endif
IceReadCompleteMessage (iceConn, SIZEOF (pmStartProxyMsg),
pmStartProxyMsg, pMsg, pStart);
@@ -633,8 +663,10 @@ Bool swap;
char *pData, *pStart;
char *addr = NULL, *error = NULL;
+#if 0 /* No-op */
CHECK_AT_LEAST_SIZE (iceConn, pmConn->pmOpcode, opcode,
length, SIZEOF (pmGetProxyAddrReplyMsg), IceFatalToProtocol);
+#endif
IceReadCompleteMessage (iceConn, SIZEOF (pmGetProxyAddrReplyMsg),
pmGetProxyAddrReplyMsg, pMsg, pStart);
diff --git a/pmdb.c b/pmdb.c
index 21a6cde..a191c66 100644
--- a/pmdb.c
+++ b/pmdb.c
@@ -25,7 +25,7 @@ not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/proxymngr/pmdb.c,v 1.7 2001/12/14 20:01:02 dawes Exp $ */
+/* $XFree86: xc/programs/proxymngr/pmdb.c,v 1.8 2003/09/13 21:33:11 dawes Exp $ */
#include "pmint.h"
#include "pmdb.h"
@@ -42,8 +42,6 @@ from The Open Group.
#endif
typedef SIGVAL (*Signal_Handler)(int);
-void SetCloseOnExec (int fd);
-
static proxy_service *proxyServiceList = NULL;
static Signal_Handler
diff --git a/pmint.h b/pmint.h
index f355285..49c562f 100644
--- a/pmint.h
+++ b/pmint.h
@@ -25,7 +25,7 @@ not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/proxymngr/pmint.h,v 1.5 2001/12/14 20:01:02 dawes Exp $ */
+/* $XFree86: xc/programs/proxymngr/pmint.h,v 1.6 2003/09/13 21:33:11 dawes Exp $ */
#include <stdio.h>
#include <X11/Xos.h>
@@ -54,10 +54,6 @@ typedef struct {
} PMconn;
-/* config.c: $TOG: config.c /main/12 1998/02/09 13:45:22 kaleb $ */
-
-extern int GetConfig ( char *configFile, char *serviceName, int *managed, char **startCommand, char **proxyAddress );
-
/* main.c: $TOG: main.c /main/36 1998/03/04 11:30:05 barstow $ */
extern void ForwardRequest ( PMconn *requestor, char *serviceName, char *serverAddress, char *hostAddress, char *startOptions, int authLen, char *authName, char *authData );
diff --git a/proxymngr.man b/proxymngr.man
index 901f62b..5c09994 100644
--- a/proxymngr.man
+++ b/proxymngr.man
@@ -24,7 +24,7 @@
.\" from The Open Group.
.\"
.\"
-.\" $XFree86: xc/programs/proxymngr/proxymngr.man,v 1.8 2003/02/20 03:27:32 dawes Exp $
+.\" $XFree86: xc/programs/proxymngr/proxymngr.man,v 1.9 2003/05/29 21:48:10 herrb Exp $
.\"
.TH PROXYMNGR 1 __xorgversion__
.SH NAME
@@ -92,7 +92,7 @@ For unmanaged proxies, the format is:
.PP
service-name is the name of the unmanaged proxy service, and must not
contain any spaces, for example ``XFWP''. service-name is case
-insenstive.
+insensitive.
.PP
proxy-address is the network address of the unmanaged proxy. The format
of the address is specific to the service-name. For example, for the
@@ -153,7 +153,7 @@ For an unmanaged proxy service, the proxy manager will look in the config
file to find all unmanaged proxies for this service. If there is more than
one entry in the config file with the same unmanaged service-name, the
proxy manager will try to use the proxies in the order presented in the
-config file. If none of the unmanged proxies can satisfy the request, the
+config file. If none of the unmanaged proxies can satisfy the request, the
proxy manager will timeout for a configurable amount of time (specified by
.B \-timeout
or default of 10) and reattempt to find an unmanaged proxy willing