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:
Keith Packard 2015-09-21 07:16:14 +01:00 committed by Adam Jackson
parent 9af111fe04
commit 6c2c6fb5a7
4 changed files with 23 additions and 12 deletions

View File

@ -29,11 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "gcstruct.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 };
/* Special-cased hook functions. Called by Xserver.
@ -342,15 +337,11 @@ XaceCensorImage(ClientPtr client,
int
XaceGetConnectionNumber(ClientPtr client)
{
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
return _XSERVTransGetConnectionNumber(ci);
return GetClientFd(client);
}
int
XaceIsLocal(ClientPtr client)
{
XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
return _XSERVTransIsLocal(ci);
return ClientIsLocal(client);
}

View File

@ -41,7 +41,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "extnsionst.h"
#include "xacestr.h"
#include "client.h"
#include "../os/osdep.h"
#define _XSELINUX_NEED_FLASK_MAP
#include "xselinuxint.h"

View File

@ -415,12 +415,19 @@ typedef struct {
extern _X_EXPORT int
GetLocalClientCreds(ClientPtr, LocalClientCredRec **);
extern _X_EXPORT void
FreeLocalClientCreds(LocalClientCredRec *);
extern _X_EXPORT int
ChangeAccessControl(ClientPtr /*client */ , int /*fEnabled */ );
extern _X_EXPORT int
GetClientFd(ClientPtr);
extern _X_EXPORT Bool
ClientIsLocal(ClientPtr client);
extern _X_EXPORT int
GetAccessControl(void);

View File

@ -1574,6 +1574,20 @@ GetAccessControl(void)
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
*