dix: Pull client-is-local flag up to the ClientRec
Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
3f7bc22263
commit
ff8e3ad807
|
@ -288,7 +288,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
.gid = getegid(),
|
.gid = getegid(),
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
.signature = signature,
|
.signature = signature,
|
||||||
.capabilities = (LocalClient(client) && !client->swapped)
|
.capabilities = (client->local && !client->swapped)
|
||||||
? XF86Bigfont_CAP_LocalShm : 0
|
? XF86Bigfont_CAP_LocalShm : 0
|
||||||
#else
|
#else
|
||||||
.signature = 0,
|
.signature = 0,
|
||||||
|
@ -357,7 +357,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
#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 = (LocalClient(client) &&
|
stuff_flags = (client->local &&
|
||||||
!client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
|
!client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
|
||||||
break;
|
break;
|
||||||
case 3: /* client with version 1.1 libX11 */
|
case 3: /* client with version 1.1 libX11 */
|
||||||
|
|
|
@ -561,7 +561,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client) || client->swapped)
|
if (!client->local || client->swapped)
|
||||||
isCapable = 0;
|
isCapable = 0;
|
||||||
|
|
||||||
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
|
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
|
||||||
|
@ -1229,7 +1229,7 @@ ProcXF86DRIDispatch(register ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
|
|
@ -2095,7 +2095,7 @@ ProcXDGADispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return DGAErrorBase + XF86DGAClientNotLocal;
|
return DGAErrorBase + XF86DGAClientNotLocal;
|
||||||
|
|
||||||
#ifdef DGA_REQ_DEBUG
|
#ifdef DGA_REQ_DEBUG
|
||||||
|
|
|
@ -1590,7 +1590,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (xf86GetVidModeEnabled() &&
|
if (xf86GetVidModeEnabled() &&
|
||||||
(xf86GetVidModeAllowNonLocal() || LocalClient(client))) {
|
(xf86GetVidModeAllowNonLocal() || client->local)) {
|
||||||
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
||||||
}
|
}
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
@ -1659,7 +1659,7 @@ ProcXF86VidModeDispatch(ClientPtr client)
|
||||||
default:
|
default:
|
||||||
if (!xf86GetVidModeEnabled())
|
if (!xf86GetVidModeEnabled())
|
||||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||||
if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
|
if (xf86GetVidModeAllowNonLocal() || client->local) {
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XF86VidModeAddModeLine:
|
case X_XF86VidModeAddModeLine:
|
||||||
return ProcXF86VidModeAddModeLine(client);
|
return ProcXF86VidModeAddModeLine(client);
|
||||||
|
@ -2083,7 +2083,7 @@ SProcXF86VidModeDispatch(ClientPtr client)
|
||||||
default:
|
default:
|
||||||
if (!xf86GetVidModeEnabled())
|
if (!xf86GetVidModeEnabled())
|
||||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||||
if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
|
if (xf86GetVidModeAllowNonLocal() || client->local) {
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_XF86VidModeAddModeLine:
|
case X_XF86VidModeAddModeLine:
|
||||||
return SProcXF86VidModeAddModeLine(client);
|
return SProcXF86VidModeAddModeLine(client);
|
||||||
|
|
|
@ -118,7 +118,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client) || client->swapped)
|
if (!client->local || client->swapped)
|
||||||
isCapable = 0;
|
isCapable = 0;
|
||||||
|
|
||||||
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
|
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
|
||||||
|
@ -528,7 +528,7 @@ ProcXF86DRIDispatch(register ClientPtr client)
|
||||||
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
|
|
@ -588,7 +588,7 @@ ProcDRI2Dispatch(ClientPtr client)
|
||||||
return ProcDRI2QueryVersion(client);
|
return ProcDRI2QueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
|
|
@ -612,7 +612,7 @@ ProcAppleWMDispatch(register ClientPtr client)
|
||||||
return ProcAppleWMQueryVersion(client);
|
return ProcAppleWMQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return WMErrorBase + AppleWMClientNotLocal;
|
return WMErrorBase + AppleWMClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
@ -684,7 +684,7 @@ SProcAppleWMDispatch(register 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 (!LocalClient(client))
|
if (!client->local)
|
||||||
return WMErrorBase + AppleWMClientNotLocal;
|
return WMErrorBase + AppleWMClientNotLocal;
|
||||||
|
|
||||||
/* only local clients are allowed WM access */
|
/* only local clients are allowed WM access */
|
||||||
|
|
|
@ -129,7 +129,7 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
|
||||||
}
|
}
|
||||||
rep.isCapable = isCapable;
|
rep.isCapable = isCapable;
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
rep.isCapable = 0;
|
rep.isCapable = 0;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
@ -354,7 +354,7 @@ ProcAppleDRIDispatch(register ClientPtr client)
|
||||||
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return DRIErrorBase + AppleDRIClientNotLocal;
|
return DRIErrorBase + AppleDRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
@ -469,7 +469,7 @@ SProcAppleDRIDispatch(register ClientPtr client)
|
||||||
return SProcAppleDRIQueryDirectRenderingCapable(client);
|
return SProcAppleDRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return DRIErrorBase + AppleDRIClientNotLocal;
|
return DRIErrorBase + AppleDRIClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
|
|
@ -525,7 +525,7 @@ ProcWindowsWMDispatch(ClientPtr client)
|
||||||
return ProcWindowsWMQueryVersion(client);
|
return ProcWindowsWMQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalClient(client))
|
if (!client->local)
|
||||||
return WMErrorBase + WindowsWMClientNotLocal;
|
return WMErrorBase + WindowsWMClientNotLocal;
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
@ -575,7 +575,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 (!LocalClient(client))
|
if (!client->local)
|
||||||
return WMErrorBase + WindowsWMClientNotLocal;
|
return WMErrorBase + WindowsWMClientNotLocal;
|
||||||
|
|
||||||
/* only local clients are allowed WM access */
|
/* only local clients are allowed WM access */
|
||||||
|
|
|
@ -91,6 +91,7 @@ typedef struct _Client {
|
||||||
pointer requestBuffer;
|
pointer requestBuffer;
|
||||||
pointer osPrivate; /* for OS layer, including scheduler */
|
pointer osPrivate; /* for OS layer, including scheduler */
|
||||||
Bool swapped;
|
Bool swapped;
|
||||||
|
Bool local;
|
||||||
ReplySwapPtr pSwapReplyFunc;
|
ReplySwapPtr pSwapReplyFunc;
|
||||||
XID errorValue;
|
XID errorValue;
|
||||||
int sequence;
|
int sequence;
|
||||||
|
|
|
@ -406,9 +406,6 @@ typedef struct sockaddr *sockaddrPtr;
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client);
|
InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client);
|
||||||
|
|
||||||
extern _X_EXPORT int
|
|
||||||
LocalClient(ClientPtr /* client */ );
|
|
||||||
|
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
LocalClientCred(ClientPtr, int *, int *);
|
LocalClientCred(ClientPtr, int *, int *);
|
||||||
|
|
||||||
|
|
10
os/access.c
10
os/access.c
|
@ -1007,14 +1007,6 @@ 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
|
||||||
*
|
*
|
||||||
|
@ -1176,7 +1168,7 @@ AuthorizedClient(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
return LocalClient(client) ? Success : BadAccess;
|
return client->local ? 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
|
||||||
|
|
|
@ -764,7 +764,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
|
||||||
free(oc);
|
free(oc);
|
||||||
return NullClient;
|
return NullClient;
|
||||||
}
|
}
|
||||||
oc->local_client = ComputeLocalClient(client);
|
client->local = ComputeLocalClient(client);
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
ConnectionTranslation[fd] = client->index;
|
ConnectionTranslation[fd] = client->index;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -162,7 +162,6 @@ 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(ClientPtr /*who */ ,
|
extern int FlushClient(ClientPtr /*who */ ,
|
||||||
|
|
Loading…
Reference in New Issue