xselinux: Rename SelectionManager to more generic SecurityManager.
This commit is contained in:
parent
6ffeecabb7
commit
46794d0c96
|
@ -72,8 +72,8 @@ typedef struct {
|
||||||
security_id_t sid;
|
security_id_t sid;
|
||||||
} SELinuxSelectionRec;
|
} SELinuxSelectionRec;
|
||||||
|
|
||||||
static ClientPtr selectionManager;
|
static ClientPtr securityManager;
|
||||||
static Window selectionWindow;
|
static Window securityWindow;
|
||||||
|
|
||||||
/* audit file descriptor */
|
/* audit file descriptor */
|
||||||
static int audit_fd;
|
static int audit_fd;
|
||||||
|
@ -849,9 +849,9 @@ SELinuxClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
|
||||||
|
|
||||||
case ClientStateRetained:
|
case ClientStateRetained:
|
||||||
case ClientStateGone:
|
case ClientStateGone:
|
||||||
if (pci->client == selectionManager) {
|
if (pci->client == securityManager) {
|
||||||
selectionManager = NULL;
|
securityManager = NULL;
|
||||||
selectionWindow = 0;
|
securityWindow = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -935,9 +935,9 @@ SELinuxSelectionState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
|
||||||
|
|
||||||
case SelectionConvertSelection:
|
case SelectionConvertSelection:
|
||||||
/* redirect the convert request if necessary */
|
/* redirect the convert request if necessary */
|
||||||
if (selectionManager && selectionManager != rec->client) {
|
if (securityManager && securityManager != rec->client) {
|
||||||
rec->selection->client = selectionManager;
|
rec->selection->client = securityManager;
|
||||||
rec->selection->window = selectionWindow;
|
rec->selection->window = securityWindow;
|
||||||
} else {
|
} else {
|
||||||
rec->selection->client = rec->selection->alt_client;
|
rec->selection->client = rec->selection->alt_client;
|
||||||
rec->selection->window = rec->selection->alt_window;
|
rec->selection->window = rec->selection->alt_window;
|
||||||
|
@ -1004,39 +1004,39 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcSELinuxSetSelectionManager(ClientPtr client)
|
ProcSELinuxSetSecurityManager(ClientPtr client)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxSetSelectionManagerReq);
|
REQUEST(SELinuxSetSecurityManagerReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxSetSelectionManagerReq);
|
REQUEST_SIZE_MATCH(SELinuxSetSecurityManagerReq);
|
||||||
|
|
||||||
if (stuff->window == None) {
|
if (stuff->window == None) {
|
||||||
selectionManager = NULL;
|
securityManager = NULL;
|
||||||
selectionWindow = None;
|
securityWindow = None;
|
||||||
} else {
|
} else {
|
||||||
rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW,
|
rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW,
|
||||||
client, DixGetAttrAccess);
|
client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
selectionManager = client;
|
securityManager = client;
|
||||||
selectionWindow = stuff->window;
|
securityWindow = stuff->window;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcSELinuxGetSelectionManager(ClientPtr client)
|
ProcSELinuxGetSecurityManager(ClientPtr client)
|
||||||
{
|
{
|
||||||
SELinuxGetSelectionManagerReply rep;
|
SELinuxGetSecurityManagerReply rep;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.window = selectionWindow;
|
rep.window = securityWindow;
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
int n;
|
int n;
|
||||||
swaps(&rep.sequenceNumber, n);
|
swaps(&rep.sequenceNumber, n);
|
||||||
|
@ -1251,10 +1251,10 @@ ProcSELinuxDispatch(ClientPtr client)
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_SELinuxQueryVersion:
|
case X_SELinuxQueryVersion:
|
||||||
return ProcSELinuxQueryVersion(client);
|
return ProcSELinuxQueryVersion(client);
|
||||||
case X_SELinuxSetSelectionManager:
|
case X_SELinuxSetSecurityManager:
|
||||||
return ProcSELinuxSetSelectionManager(client);
|
return ProcSELinuxSetSecurityManager(client);
|
||||||
case X_SELinuxGetSelectionManager:
|
case X_SELinuxGetSecurityManager:
|
||||||
return ProcSELinuxGetSelectionManager(client);
|
return ProcSELinuxGetSecurityManager(client);
|
||||||
case X_SELinuxSetDeviceCreateContext:
|
case X_SELinuxSetDeviceCreateContext:
|
||||||
return ProcSELinuxSetDeviceCreateContext(client);
|
return ProcSELinuxSetDeviceCreateContext(client);
|
||||||
case X_SELinuxGetDeviceCreateContext:
|
case X_SELinuxGetDeviceCreateContext:
|
||||||
|
@ -1293,14 +1293,14 @@ SProcSELinuxQueryVersion(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SProcSELinuxSetSelectionManager(ClientPtr client)
|
SProcSELinuxSetSecurityManager(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(SELinuxSetSelectionManagerReq);
|
REQUEST(SELinuxSetSecurityManagerReq);
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxSetSelectionManagerReq);
|
REQUEST_SIZE_MATCH(SELinuxSetSecurityManagerReq);
|
||||||
swapl(&stuff->window, n);
|
swapl(&stuff->window, n);
|
||||||
return ProcSELinuxSetSelectionManager(client);
|
return ProcSELinuxSetSecurityManager(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1393,10 +1393,10 @@ SProcSELinuxDispatch(ClientPtr client)
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
case X_SELinuxQueryVersion:
|
case X_SELinuxQueryVersion:
|
||||||
return SProcSELinuxQueryVersion(client);
|
return SProcSELinuxQueryVersion(client);
|
||||||
case X_SELinuxSetSelectionManager:
|
case X_SELinuxSetSecurityManager:
|
||||||
return SProcSELinuxSetSelectionManager(client);
|
return SProcSELinuxSetSecurityManager(client);
|
||||||
case X_SELinuxGetSelectionManager:
|
case X_SELinuxGetSecurityManager:
|
||||||
return ProcSELinuxGetSelectionManager(client);
|
return ProcSELinuxGetSecurityManager(client);
|
||||||
case X_SELinuxSetDeviceCreateContext:
|
case X_SELinuxSetDeviceCreateContext:
|
||||||
return SProcSELinuxSetDeviceCreateContext(client);
|
return SProcSELinuxSetDeviceCreateContext(client);
|
||||||
case X_SELinuxGetDeviceCreateContext:
|
case X_SELinuxGetDeviceCreateContext:
|
||||||
|
|
|
@ -31,8 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
/* Extension protocol */
|
/* Extension protocol */
|
||||||
#define X_SELinuxQueryVersion 0
|
#define X_SELinuxQueryVersion 0
|
||||||
#define X_SELinuxSetSelectionManager 1
|
#define X_SELinuxSetSecurityManager 1
|
||||||
#define X_SELinuxGetSelectionManager 2
|
#define X_SELinuxGetSecurityManager 2
|
||||||
#define X_SELinuxSetDeviceCreateContext 3
|
#define X_SELinuxSetDeviceCreateContext 3
|
||||||
#define X_SELinuxGetDeviceCreateContext 4
|
#define X_SELinuxGetDeviceCreateContext 4
|
||||||
#define X_SELinuxSetDeviceContext 5
|
#define X_SELinuxSetDeviceContext 5
|
||||||
|
@ -72,13 +72,13 @@ typedef struct {
|
||||||
CARD8 SELinuxReqType;
|
CARD8 SELinuxReqType;
|
||||||
CARD16 length;
|
CARD16 length;
|
||||||
CARD32 window;
|
CARD32 window;
|
||||||
} SELinuxSetSelectionManagerReq;
|
} SELinuxSetSecurityManagerReq;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CARD8 reqType;
|
CARD8 reqType;
|
||||||
CARD8 SELinuxReqType;
|
CARD8 SELinuxReqType;
|
||||||
CARD16 length;
|
CARD16 length;
|
||||||
} SELinuxGetSelectionManagerReq;
|
} SELinuxGetSecurityManagerReq;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CARD8 type;
|
CARD8 type;
|
||||||
|
@ -91,7 +91,7 @@ typedef struct {
|
||||||
CARD32 pad4;
|
CARD32 pad4;
|
||||||
CARD32 pad5;
|
CARD32 pad5;
|
||||||
CARD32 pad6;
|
CARD32 pad6;
|
||||||
} SELinuxGetSelectionManagerReply;
|
} SELinuxGetSecurityManagerReply;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CARD8 reqType;
|
CARD8 reqType;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user