Xext, os: Remove OS-internal usages within XACE and XSELinux
These extensions were accessing internal OS functions and structures. Expose the necessary functionality to them and remove their use of osdep.h Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
9af111fe04
commit
6c2c6fb5a7
13
Xext/xace.c
13
Xext/xace.c
|
@ -29,11 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
|
|
||||||
#define XSERV_t
|
|
||||||
#define TRANS_SERVER
|
|
||||||
#include <X11/Xtrans/Xtrans.h>
|
|
||||||
#include "../os/osdep.h"
|
|
||||||
|
|
||||||
_X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
_X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
|
||||||
|
|
||||||
/* Special-cased hook functions. Called by Xserver.
|
/* Special-cased hook functions. Called by Xserver.
|
||||||
|
@ -342,15 +337,11 @@ XaceCensorImage(ClientPtr client,
|
||||||
int
|
int
|
||||||
XaceGetConnectionNumber(ClientPtr client)
|
XaceGetConnectionNumber(ClientPtr client)
|
||||||
{
|
{
|
||||||
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
|
return GetClientFd(client);
|
||||||
|
|
||||||
return _XSERVTransGetConnectionNumber(ci);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
XaceIsLocal(ClientPtr client)
|
XaceIsLocal(ClientPtr client)
|
||||||
{
|
{
|
||||||
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
|
return ClientIsLocal(client);
|
||||||
|
|
||||||
return _XSERVTransIsLocal(ci);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "../os/osdep.h"
|
|
||||||
#define _XSELINUX_NEED_FLASK_MAP
|
#define _XSELINUX_NEED_FLASK_MAP
|
||||||
#include "xselinuxint.h"
|
#include "xselinuxint.h"
|
||||||
|
|
||||||
|
|
|
@ -415,12 +415,19 @@ typedef struct {
|
||||||
|
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
GetLocalClientCreds(ClientPtr, LocalClientCredRec **);
|
GetLocalClientCreds(ClientPtr, LocalClientCredRec **);
|
||||||
|
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
FreeLocalClientCreds(LocalClientCredRec *);
|
FreeLocalClientCreds(LocalClientCredRec *);
|
||||||
|
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
ChangeAccessControl(ClientPtr /*client */ , int /*fEnabled */ );
|
ChangeAccessControl(ClientPtr /*client */ , int /*fEnabled */ );
|
||||||
|
|
||||||
|
extern _X_EXPORT int
|
||||||
|
GetClientFd(ClientPtr);
|
||||||
|
|
||||||
|
extern _X_EXPORT Bool
|
||||||
|
ClientIsLocal(ClientPtr client);
|
||||||
|
|
||||||
extern _X_EXPORT int
|
extern _X_EXPORT int
|
||||||
GetAccessControl(void);
|
GetAccessControl(void);
|
||||||
|
|
||||||
|
|
14
os/access.c
14
os/access.c
|
@ -1574,6 +1574,20 @@ GetAccessControl(void)
|
||||||
return AccessEnabled;
|
return AccessEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
GetClientFd(ClientPtr client)
|
||||||
|
{
|
||||||
|
return ((OsCommPtr) client->osPrivate)->fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
ClientIsLocal(ClientPtr client)
|
||||||
|
{
|
||||||
|
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
|
||||||
|
|
||||||
|
return _XSERVTransIsLocal(ci);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* FamilyServerInterpreted host entry implementation
|
* FamilyServerInterpreted host entry implementation
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue