XSELinux: Add a request to get a client's context from a resource ID.
This commit is contained in:
parent
c40e0b51f0
commit
9f56fc5806
|
@ -1472,6 +1472,24 @@ ProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey)
|
||||||
return SELinuxSendContextReply(client, obj->sid);
|
return SELinuxSendContextReply(client, obj->sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcSELinuxGetClientContext(ClientPtr client)
|
||||||
|
{
|
||||||
|
ClientPtr target;
|
||||||
|
SELinuxSubjectRec *subj;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||||
|
|
||||||
|
rc = dixLookupClient(&target, stuff->id, client, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
subj = dixLookupPrivate(&target->devPrivates, subjectKey);
|
||||||
|
return SELinuxSendContextReply(client, subj->sid);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SELinuxPopulateItem(SELinuxListItemRec *i, PrivateRec **privPtr, CARD32 id,
|
SELinuxPopulateItem(SELinuxListItemRec *i, PrivateRec **privPtr, CARD32 id,
|
||||||
int *size)
|
int *size)
|
||||||
|
@ -1686,6 +1704,8 @@ ProcSELinuxDispatch(ClientPtr client)
|
||||||
return ProcSELinuxGetSelectionContext(client, dataKey);
|
return ProcSELinuxGetSelectionContext(client, dataKey);
|
||||||
case X_SELinuxListSelections:
|
case X_SELinuxListSelections:
|
||||||
return ProcSELinuxListSelections(client);
|
return ProcSELinuxListSelections(client);
|
||||||
|
case X_SELinuxGetClientContext:
|
||||||
|
return ProcSELinuxGetClientContext(client);
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
@ -1782,6 +1802,17 @@ SProcSELinuxListProperties(ClientPtr client)
|
||||||
return ProcSELinuxListProperties(client);
|
return ProcSELinuxListProperties(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcSELinuxGetClientContext(ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(SELinuxGetContextReq);
|
||||||
|
int n;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||||
|
swapl(&stuff->id, n);
|
||||||
|
return ProcSELinuxGetClientContext(client);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SProcSELinuxDispatch(ClientPtr client)
|
SProcSELinuxDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -1835,6 +1866,8 @@ SProcSELinuxDispatch(ClientPtr client)
|
||||||
return SProcSELinuxGetSelectionContext(client, dataKey);
|
return SProcSELinuxGetSelectionContext(client, dataKey);
|
||||||
case X_SELinuxListSelections:
|
case X_SELinuxListSelections:
|
||||||
return ProcSELinuxListSelections(client);
|
return ProcSELinuxListSelections(client);
|
||||||
|
case X_SELinuxGetClientContext:
|
||||||
|
return SProcSELinuxGetClientContext(client);
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define X_SELinuxGetSelectionContext 19
|
#define X_SELinuxGetSelectionContext 19
|
||||||
#define X_SELinuxGetSelectionDataContext 20
|
#define X_SELinuxGetSelectionDataContext 20
|
||||||
#define X_SELinuxListSelections 21
|
#define X_SELinuxListSelections 21
|
||||||
|
#define X_SELinuxGetClientContext 22
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CARD8 reqType;
|
CARD8 reqType;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user