diff options
author | Mihai Moldovan <ionic@ionic.de> | 2016-06-01 21:57:36 +0200 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2016-06-01 21:57:36 +0200 |
commit | 3d54338330821a3e60e0f52cce2a9dd1f94f8b5c (patch) | |
tree | e1d61f5f14cf5f26f3cf7094c485a5424f0551ea /nx-X11/programs/Xserver/os/connection.c | |
parent | c646808bcb0fe95e9794409231a9fa8b51990971 (diff) | |
parent | b2145323c189a9c68d475d387fdfac54bcb33c94 (diff) | |
download | nx-libs-3d54338330821a3e60e0f52cce2a9dd1f94f8b5c.tar.gz nx-libs-3d54338330821a3e60e0f52cce2a9dd1f94f8b5c.tar.bz2 nx-libs-3d54338330821a3e60e0f52cce2a9dd1f94f8b5c.zip |
Merge branch 'sunweaver-pr/xserver-drop-outdated-xext-extensions' into arctica-3.6.x
Attributes GH PR #106: https://github.com/ArcticaProject/nx-libs/pull/106
Diffstat (limited to 'nx-X11/programs/Xserver/os/connection.c')
-rw-r--r-- | nx-X11/programs/Xserver/os/connection.c | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index ef71cd540..2df92bf91 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -147,19 +147,10 @@ extern __const__ int _nfiles; #include <nx-X11/Xpoll.h> #include "opaque.h" #include "dixstruct.h" -#ifdef XAPPGROUP -#include <nx-X11/extensions/Xagsrv.h> -#endif #ifdef XCSECURITY #define _SECURITY_SERVER #include <nx-X11/extensions/security.h> #endif -#ifdef LBX -#include "colormapst.h" -#include "propertyst.h" -#include "lbxserve.h" -#include "osdep.h" -#endif #ifdef X_NOT_POSIX #define Pid_t int @@ -300,12 +291,10 @@ int ListenTransCount; static void ErrorConnMax(XtransConnInfo /* trans_conn */); -#ifndef LBX static void CloseDownFileDescriptor( OsCommPtr /*oc*/ ); -#endif static XtransConnInfo @@ -694,64 +683,13 @@ ClientAuthorized(ClientPtr client, char *reason = NULL; XtransConnInfo trans_conn; int restore_trans_conn = 0; - ClientPtr lbxpc = NULL; priv = (OsCommPtr)client->osPrivate; trans_conn = priv->trans_conn; -#ifdef LBX - if (!trans_conn) { - /* - * Since trans_conn is NULL, this must be a proxy's client for - * which we have NO address. Therefore, we will temporarily - * set the client's trans_conn to the proxy's trans_conn and - * after CheckAuthorization the client's trans_conn will be - * restored. - * - * If XDM-AUTHORIZATION-1 is being used, CheckAuthorization - * will eventually call XdmAuthorizationValidate and this - * later function may use the client's trans_conn to get the - * client's address. Since a XDM-AUTH-1 auth string includes - * the client's address, this address is compared to the address - * in the client's trans_conn. If the proxy and client are - * on the same host, the comparison will fail; otherwise the - * comparison will fail and the client will not be authorized - * to connect to the server. - * - * The basis for this additional code is to prevent a - * NULL pointer dereference of the client's trans_conn. - * The fundamental problem - the fact that the client's - * trans_conn is NULL - is because the NewClient - * request in version 1.0 of the LBX protocol does not - * send the client's address to the server. When the - * spec is changed and the client's address is sent to - * server in the NewClient request, this additional code - * should be removed. - * - * See defect number XWSog08218 for more information. - */ - lbxpc = LbxProxyClient(priv->proxy); - trans_conn = ((OsCommPtr)lbxpc->osPrivate)->trans_conn; - priv->trans_conn = trans_conn; - restore_trans_conn = 1; - } -#endif - auth_id = CheckAuthorization (proto_n, auth_proto, string_n, auth_string, client, &reason); -#ifdef LBX - if (! priv->trans_conn) { - if (auth_id == (XID) ~0L && !GetAccessControl()) - auth_id = ((OsCommPtr)lbxpc->osPrivate)->auth_id; -#ifdef XCSECURITY - else if (auth_id != (XID) ~0L && !SecuritySameLevel(lbxpc, auth_id)) { - auth_id = (XID) ~0L; - reason = "Client trust level differs from that of LBX Proxy"; - } -#endif - } -#endif if (auth_id == (XID) ~0L) { if ( @@ -763,9 +701,6 @@ ClientAuthorized(ClientPtr client, &family, &fromlen, &from) != -1) { if ( -#ifdef LBX - !trans_conn || -#endif InvalidHost ((struct sockaddr *) from, fromlen, client)) AuthAudit(client, FALSE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); @@ -782,14 +717,6 @@ ClientAuthorized(ClientPtr client, } if (auth_id == (XID) ~0L) { -#ifdef LBX - /* - * Restore client's trans_conn state - */ - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif if (reason) return reason; else @@ -814,44 +741,22 @@ ClientAuthorized(ClientPtr client, /* indicate to Xdmcp protocol that we've opened new client */ XdmcpOpenDisplay(priv->fd); #endif /* XDMCP */ -#ifdef XAPPGROUP - if (ClientStateCallback) - XagCallClientStateChange (client); -#endif /* At this point, if the client is authorized to change the access control * list, we should getpeername() information, and add the client to * the selfhosts list. It's not really the host machine, but the * true purpose of the selfhosts list is to see who may change the * access control list. */ -#ifdef LBX - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif return((char *)NULL); } static ClientPtr -#ifdef LBX -AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time, - int (*Flush)( - ClientPtr /*who*/, OsCommPtr /*oc*/, - char * /*extraBuf*/, int /*extraCount*/), - void (*Close)( - ClientPtr /*client*/), - LbxProxyPtr proxy) -#else AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) -#endif { OsCommPtr oc; ClientPtr client; if ( -#ifdef LBX - trans_conn && -#endif #ifndef WIN32 fd >= lastfdesc #else @@ -868,20 +773,11 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->output = (ConnectionOutputPtr)NULL; oc->auth_id = None; oc->conn_time = conn_time; -#ifdef LBX - oc->proxy = proxy; - oc->Flush = Flush; - oc->Close = Close; - oc->largereq = (ConnectionInputPtr) NULL; -#endif if (!(client = NextAvailableClient((void *)oc))) { xfree (oc); return NullClient; } -#ifdef LBX - if (trans_conn) -#endif { #if !defined(WIN32) ConnectionTranslation[fd] = client->index; @@ -908,39 +804,6 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) return client; } -#ifdef LBX - -int -ClientConnectionNumber (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return oc->fd; -} - -ClientPtr -AllocLbxClientConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return AllocNewConnection ((XtransConnInfo)NULL, oc->fd, GetTimeInMillis(), - LbxFlushClient, LbxCloseClient, proxy); -} - -void -LbxProxyConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - FlushClient(client, oc, (char *)NULL, 0); - oc->proxy = proxy; - oc->Flush = LbxFlushClient; - oc->Close = LbxCloseClient; - LbxPrimeInput(client, proxy); -} - -#endif - /***************** * EstablishNewConnections * If anyone is waiting on listened sockets, accept them. @@ -1020,10 +883,6 @@ EstablishNewConnections(ClientPtr clientUnused, void * closure) _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); if (!AllocNewConnection (new_trans_conn, newconn, connect_time -#ifdef LBX - , StandardFlushClient, - CloseDownFileDescriptor, (LbxProxyPtr)NULL -#endif )) { ErrorConnMax(new_trans_conn); @@ -1093,27 +952,17 @@ ErrorConnMax(XtransConnInfo trans_conn) * Remove this file descriptor and it's I/O buffers, etc. ************/ -#ifdef LBX -void -CloseDownFileDescriptor(ClientPtr client) -#else static void CloseDownFileDescriptor(OsCommPtr oc) -#endif { -#ifdef LBX - OsCommPtr oc = (OsCommPtr) client->osPrivate; -#endif int connection = oc->fd; if (oc->trans_conn) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); } -#ifndef LBX FreeOsBuffers(oc); xfree(oc); -#endif #ifndef WIN32 ConnectionTranslation[connection] = 0; #else @@ -1208,13 +1057,7 @@ CloseDownConnection(ClientPtr client) #ifdef XDMCP XdmcpCloseDisplay(oc->fd); #endif -#ifndef LBX CloseDownFileDescriptor(oc); -#else - (*oc->Close) (client); - FreeOsBuffers(oc); - xfree(oc); -#endif client->osPrivate = (void *)NULL; if (auditTrailLevel > 1) AuditF("client %d disconnected\n", client->index); @@ -1303,17 +1146,8 @@ IgnoreClient (ClientPtr client) { OsCommPtr oc = (OsCommPtr)client->osPrivate; int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); -#endif isItTimeToYield = TRUE; -#ifdef LBX - if (lbxClient) { - lbxClient->ignored = TRUE; - return; - } -#endif if (!GrabInProgress || FD_ISSET(connection, &AllClients)) { if (FD_ISSET (connection, &ClientsWithInput)) @@ -1347,14 +1181,6 @@ AttendClient (ClientPtr client) { OsCommPtr oc = (OsCommPtr)client->osPrivate; int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); - - if (lbxClient) { - lbxClient->ignored = FALSE; - return; - } -#endif if (!GrabInProgress || GrabInProgress == client->index || FD_ISSET(connection, &GrabImperviousClients)) { |