Revert "dix: Pull client-is-local flag up to the ClientRec"
This reverts commit 49d38b75c8
.
ABI change pended for 1.13
This commit is contained in:
parent
3be37375ee
commit
d9eeede52f
|
@ -300,7 +300,7 @@ ProcXF86BigfontQueryVersion(
|
||||||
#endif
|
#endif
|
||||||
reply.capabilities =
|
reply.capabilities =
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
(client->local && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
|
(LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
|
@ -367,7 +367,7 @@ ProcXF86BigfontQueryFont(
|
||||||
#else
|
#else
|
||||||
switch (client->req_len) {
|
switch (client->req_len) {
|
||||||
case 2: /* client with version 1.0 libX11 */
|
case 2: /* client with version 1.0 libX11 */
|
||||||
stuff_flags = (client->local && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
|
stuff_flags = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
|
||||||
break;
|
break;
|
||||||
case 3: /* client with version 1.1 libX11 */
|
case 3: /* client with version 1.1 libX11 */
|
||||||
stuff_flags = stuff->flags;
|
stuff_flags = stuff->flags;
|
||||||
|
|
|
@ -586,7 +586,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
|
||||||
}
|
}
|
||||||
rep.isCapable = isCapable;
|
rep.isCapable = isCapable;
|
||||||
|
|
||||||
if (!client->local || client->swapped)
|
if (!LocalClient(client) || client->swapped)
|
||||||
rep.isCapable = 0;
|
rep.isCapable = 0;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
@ -1253,7 +1253,7 @@ ProcXF86DRIDispatch (register ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data)
|
switch (stuff->data)
|
||||||
|
|
|
@ -928,7 +928,7 @@ ProcXDGADispatch (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return DGAErrorBase + XF86DGAClientNotLocal;
|
return DGAErrorBase + XF86DGAClientNotLocal;
|
||||||
|
|
||||||
#ifdef DGA_REQ_DEBUG
|
#ifdef DGA_REQ_DEBUG
|
||||||
|
|
|
@ -1527,7 +1527,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.permissions = XF86VM_READ_PERMISSION;
|
rep.permissions = XF86VM_READ_PERMISSION;
|
||||||
if (xf86GetVidModeEnabled() &&
|
if (xf86GetVidModeEnabled() &&
|
||||||
(xf86GetVidModeAllowNonLocal() || client->local)) {
|
(xf86GetVidModeAllowNonLocal() || LocalClient (client))) {
|
||||||
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
||||||
}
|
}
|
||||||
if(client->swapped) {
|
if(client->swapped) {
|
||||||
|
@ -1597,7 +1597,7 @@ ProcXF86VidModeDispatch(ClientPtr client)
|
||||||
default:
|
default:
|
||||||
if (!xf86GetVidModeEnabled())
|
if (!xf86GetVidModeEnabled())
|
||||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||||
if (xf86GetVidModeAllowNonLocal() || client->local) {
|
if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XF86VidModeAddModeLine:
|
case X_XF86VidModeAddModeLine:
|
||||||
return ProcXF86VidModeAddModeLine(client);
|
return ProcXF86VidModeAddModeLine(client);
|
||||||
|
@ -2017,7 +2017,7 @@ SProcXF86VidModeDispatch(ClientPtr client)
|
||||||
default:
|
default:
|
||||||
if (!xf86GetVidModeEnabled())
|
if (!xf86GetVidModeEnabled())
|
||||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||||
if (xf86GetVidModeAllowNonLocal() || client->local) {
|
if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XF86VidModeAddModeLine:
|
case X_XF86VidModeAddModeLine:
|
||||||
return SProcXF86VidModeAddModeLine(client);
|
return SProcXF86VidModeAddModeLine(client);
|
||||||
|
|
|
@ -130,7 +130,7 @@ ProcXF86DRIQueryDirectRenderingCapable(
|
||||||
}
|
}
|
||||||
rep.isCapable = isCapable;
|
rep.isCapable = isCapable;
|
||||||
|
|
||||||
if (!client->local || client->swapped)
|
if (!LocalClient(client) || client->swapped)
|
||||||
rep.isCapable = 0;
|
rep.isCapable = 0;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
@ -557,7 +557,7 @@ ProcXF86DRIDispatch (
|
||||||
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data)
|
switch (stuff->data)
|
||||||
|
|
|
@ -547,7 +547,7 @@ ProcDRI2Dispatch (ClientPtr client)
|
||||||
return ProcDRI2QueryVersion(client);
|
return ProcDRI2QueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
|
|
@ -630,7 +630,7 @@ ProcAppleWMDispatch (
|
||||||
return ProcAppleWMQueryVersion(client);
|
return ProcAppleWMQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return WMErrorBase + AppleWMClientNotLocal;
|
return WMErrorBase + AppleWMClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data)
|
switch (stuff->data)
|
||||||
|
@ -693,7 +693,7 @@ SProcAppleWMDispatch (
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
/* It is bound to be non-local when there is byte swapping */
|
/* It is bound to be non-local when there is byte swapping */
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return WMErrorBase + AppleWMClientNotLocal;
|
return WMErrorBase + AppleWMClientNotLocal;
|
||||||
|
|
||||||
/* only local clients are allowed WM access */
|
/* only local clients are allowed WM access */
|
||||||
|
|
|
@ -133,7 +133,7 @@ ProcAppleDRIQueryDirectRenderingCapable(
|
||||||
}
|
}
|
||||||
rep.isCapable = isCapable;
|
rep.isCapable = isCapable;
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
rep.isCapable = 0;
|
rep.isCapable = 0;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
@ -365,7 +365,7 @@ ProcAppleDRIDispatch (
|
||||||
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return DRIErrorBase + AppleDRIClientNotLocal;
|
return DRIErrorBase + AppleDRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data)
|
switch (stuff->data)
|
||||||
|
|
|
@ -548,7 +548,7 @@ ProcWindowsWMDispatch (ClientPtr client)
|
||||||
return ProcWindowsWMQueryVersion(client);
|
return ProcWindowsWMQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return WMErrorBase + WindowsWMClientNotLocal;
|
return WMErrorBase + WindowsWMClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data)
|
switch (stuff->data)
|
||||||
|
@ -598,7 +598,7 @@ SProcWindowsWMDispatch (ClientPtr client)
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
/* It is bound to be non-local when there is byte swapping */
|
/* It is bound to be non-local when there is byte swapping */
|
||||||
if (!client->local)
|
if (!LocalClient(client))
|
||||||
return WMErrorBase + WindowsWMClientNotLocal;
|
return WMErrorBase + WindowsWMClientNotLocal;
|
||||||
|
|
||||||
/* only local clients are allowed WM access */
|
/* only local clients are allowed WM access */
|
||||||
|
|
|
@ -91,7 +91,6 @@ typedef struct _Client {
|
||||||
pointer requestBuffer;
|
pointer requestBuffer;
|
||||||
pointer osPrivate; /* for OS layer, including scheduler */
|
pointer osPrivate; /* for OS layer, including scheduler */
|
||||||
char swapped;
|
char swapped;
|
||||||
char local;
|
|
||||||
char big_requests;
|
char big_requests;
|
||||||
char closeDownMode;
|
char closeDownMode;
|
||||||
char clientGone;
|
char clientGone;
|
||||||
|
|
|
@ -353,6 +353,8 @@ typedef struct sockaddr * sockaddrPtr;
|
||||||
|
|
||||||
extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client);
|
extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client);
|
||||||
|
|
||||||
|
extern _X_EXPORT int LocalClient(ClientPtr /* client */);
|
||||||
|
|
||||||
extern _X_EXPORT int LocalClientCred(ClientPtr, int *, int *);
|
extern _X_EXPORT int LocalClientCred(ClientPtr, int *, int *);
|
||||||
|
|
||||||
#define LCC_UID_SET (1 << 0)
|
#define LCC_UID_SET (1 << 0)
|
||||||
|
|
|
@ -1045,6 +1045,13 @@ ComputeLocalClient(ClientPtr client)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool LocalClient(ClientPtr client)
|
||||||
|
{
|
||||||
|
if (!client->osPrivate)
|
||||||
|
return FALSE;
|
||||||
|
return ((OsCommPtr)client->osPrivate)->local_client;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the uid and gid of a connected local client
|
* Return the uid and gid of a connected local client
|
||||||
*
|
*
|
||||||
|
@ -1202,7 +1209,7 @@ AuthorizedClient(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
return client->local ? Success : BadAccess;
|
return LocalClient(client) ? Success : BadAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a host to the access control list. This is the external interface
|
/* Add a host to the access control list. This is the external interface
|
||||||
|
|
|
@ -745,7 +745,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
|
||||||
free(oc);
|
free(oc);
|
||||||
return NullClient;
|
return NullClient;
|
||||||
}
|
}
|
||||||
client->local = ComputeLocalClient(client);
|
oc->local_client = ComputeLocalClient(client);
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
ConnectionTranslation[fd] = client->index;
|
ConnectionTranslation[fd] = client->index;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -162,6 +162,7 @@ typedef struct _osComm {
|
||||||
XID auth_id; /* authorization id */
|
XID auth_id; /* authorization id */
|
||||||
CARD32 conn_time; /* timestamp if not established, else 0 */
|
CARD32 conn_time; /* timestamp if not established, else 0 */
|
||||||
struct _XtransConnInfo *trans_conn; /* transport connection object */
|
struct _XtransConnInfo *trans_conn; /* transport connection object */
|
||||||
|
Bool local_client;
|
||||||
} OsCommRec, *OsCommPtr;
|
} OsCommRec, *OsCommPtr;
|
||||||
|
|
||||||
extern int FlushClient(
|
extern int FlushClient(
|
||||||
|
|
Loading…
Reference in New Issue