diff --git a/Xext/security.c b/Xext/security.c index 7ea032f54..74ba8d42c 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -1715,7 +1715,7 @@ SecurityCheckPropertyAccess(CallbackListPtr *pcbl, pointer unused, /* if client trusted or window untrusted, allow operation */ - if (!client || (TRUSTLEVEL(client) == XSecurityClientTrusted) || + if ((TRUSTLEVEL(client) == XSecurityClientTrusted) || (TRUSTLEVEL(wClient(pWin)) != XSecurityClientTrusted) ) return; diff --git a/Xext/xselinux.c b/Xext/xselinux.c index 4ed2784e6..648bb6efd 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -1070,7 +1070,7 @@ XSELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) char *propname = NameForAtom(rec->pProp->propertyName); tclient = wClient(pWin); - if (!client || !tclient || !HAVESTATE(tclient)) + if (!tclient || !HAVESTATE(tclient)) return; propsid = GetPropertySID(SID(tclient)->ctx, propname); @@ -1235,13 +1235,15 @@ XSELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata) rc = avc_sid_to_context(SID(client), &ctx); if (rc < 0) FatalError("XSELinux: Failed to get security context!\n"); - rc = ChangeWindowProperty(pWin, atom_client_ctx, XA_STRING, 8, - PropModeReplace, strlen(ctx), ctx, FALSE); + rc = dixChangeWindowProperty(serverClient, + pWin, atom_client_ctx, XA_STRING, 8, + PropModeReplace, strlen(ctx), ctx, FALSE); freecon(ctx); } else - rc = ChangeWindowProperty(pWin, atom_client_ctx, XA_STRING, 8, - PropModeReplace, 10, "UNLABELED!", FALSE); + rc = dixChangeWindowProperty(serverClient, + pWin, atom_client_ctx, XA_STRING, 8, + PropModeReplace, 10, "UNLABELED!", FALSE); if (rc != Success) FatalError("XSELinux: Failed to set context property on window!\n"); } /* XSELinuxResourceState */ diff --git a/dix/property.c b/dix/property.c index 9ff6993e6..74d548d8e 100644 --- a/dix/property.c +++ b/dix/property.c @@ -374,7 +374,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, pointer value, Bool sendevent) { - return dixChangeWindowProperty(NullClient, pWin, property, type, format, + return dixChangeWindowProperty(serverClient, pWin, property, type, format, mode, len, value, sendevent); }