selinux: Stop using security_context_t
This is apparently deprecated now and is and was always just char *.
This commit is contained in:
parent
6f63873da5
commit
f3a98334e6
|
@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid)
|
#define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
security_context_t octx;
|
char *octx;
|
||||||
security_context_t dctx;
|
char *dctx;
|
||||||
CARD32 octx_len;
|
CARD32 octx_len;
|
||||||
CARD32 dctx_len;
|
CARD32 dctx_len;
|
||||||
CARD32 id;
|
CARD32 id;
|
||||||
|
@ -48,10 +48,10 @@ typedef struct {
|
||||||
* Extension Dispatch
|
* Extension Dispatch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static security_context_t
|
static char *
|
||||||
SELinuxCopyContext(char *ptr, unsigned len)
|
SELinuxCopyContext(char *ptr, unsigned len)
|
||||||
{
|
{
|
||||||
security_context_t copy = malloc(len + 1);
|
char *copy = malloc(len + 1);
|
||||||
|
|
||||||
if (!copy)
|
if (!copy)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -84,7 +84,7 @@ static int
|
||||||
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
{
|
{
|
||||||
SELinuxGetContextReply rep;
|
SELinuxGetContextReply rep;
|
||||||
security_context_t ctx = NULL;
|
char *ctx = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (sid) {
|
if (sid) {
|
||||||
|
@ -117,7 +117,7 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||||
{
|
{
|
||||||
PrivateRec **privPtr = &client->devPrivates;
|
PrivateRec **privPtr = &client->devPrivates;
|
||||||
security_id_t *pSid;
|
security_id_t *pSid;
|
||||||
security_context_t ctx = NULL;
|
char *ctx = NULL;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ ProcSELinuxGetCreateContext(ClientPtr client, unsigned offset)
|
||||||
static int
|
static int
|
||||||
ProcSELinuxSetDeviceContext(ClientPtr client)
|
ProcSELinuxSetDeviceContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
security_id_t sid;
|
security_id_t sid;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
|
|
|
@ -114,7 +114,7 @@ SELinuxLabelClient(ClientPtr client)
|
||||||
int fd = XaceGetConnectionNumber(client);
|
int fd = XaceGetConnectionNumber(client);
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
|
|
||||||
subj = dixLookupPrivate(&client->devPrivates, subjectKey);
|
subj = dixLookupPrivate(&client->devPrivates, subjectKey);
|
||||||
obj = dixLookupPrivate(&client->devPrivates, objectKey);
|
obj = dixLookupPrivate(&client->devPrivates, objectKey);
|
||||||
|
@ -169,7 +169,7 @@ SELinuxLabelInitial(void)
|
||||||
XaceScreenAccessRec srec;
|
XaceScreenAccessRec srec;
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
void *unused;
|
void *unused;
|
||||||
|
|
||||||
/* Do the serverClient */
|
/* Do the serverClient */
|
||||||
|
@ -773,7 +773,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
|
subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
|
||||||
|
|
||||||
if (subj->sid) {
|
if (subj->sid) {
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
int rc = avc_sid_to_context_raw(subj->sid, &ctx);
|
int rc = avc_sid_to_context_raw(subj->sid, &ctx);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@ -791,7 +791,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
|
||||||
obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
|
obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
|
||||||
|
|
||||||
if (obj->sid) {
|
if (obj->sid) {
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
int rc = avc_sid_to_context_raw(obj->sid, &ctx);
|
int rc = avc_sid_to_context_raw(obj->sid, &ctx);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@ -847,7 +847,7 @@ void
|
||||||
SELinuxFlaskInit(void)
|
SELinuxFlaskInit(void)
|
||||||
{
|
{
|
||||||
struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 };
|
struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 };
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
int ret = TRUE;
|
int ret = TRUE;
|
||||||
|
|
||||||
switch (selinuxEnforcingState) {
|
switch (selinuxEnforcingState) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ static int
|
||||||
SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap)
|
SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap)
|
||||||
{
|
{
|
||||||
const char *name = NameForAtom(atom);
|
const char *name = NameForAtom(atom);
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
|
||||||
obj->poly = 1;
|
obj->poly = 1;
|
||||||
|
@ -255,7 +255,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
|
||||||
{
|
{
|
||||||
const char *name = LookupEventName(type);
|
const char *name = LookupEventName(type);
|
||||||
security_id_t sid;
|
security_id_t sid;
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
|
|
||||||
type &= 127;
|
type &= 127;
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
|
||||||
int
|
int
|
||||||
SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn)
|
SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn)
|
||||||
{
|
{
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
|
|
||||||
/* Look in the mappings of extension names to contexts */
|
/* Look in the mappings of extension names to contexts */
|
||||||
if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) {
|
if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) {
|
||||||
|
@ -347,10 +347,10 @@ SELinuxTypeToClass(RESTYPE type)
|
||||||
return (security_class_t) (unsigned long) tmp;
|
return (security_class_t) (unsigned long) tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
security_context_t
|
char *
|
||||||
SELinuxDefaultClientLabel(void)
|
SELinuxDefaultClientLabel(void)
|
||||||
{
|
{
|
||||||
security_context_t ctx;
|
char *ctx;
|
||||||
|
|
||||||
if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0)
|
if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0)
|
||||||
FatalError("SELinux: failed to look up remote-client context\n");
|
FatalError("SELinux: failed to look up remote-client context\n");
|
||||||
|
|
|
@ -99,7 +99,7 @@ int
|
||||||
|
|
||||||
security_class_t SELinuxTypeToClass(RESTYPE type);
|
security_class_t SELinuxTypeToClass(RESTYPE type);
|
||||||
|
|
||||||
security_context_t SELinuxDefaultClientLabel(void);
|
char *SELinuxDefaultClientLabel(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
SELinuxLabelInit(void);
|
SELinuxLabelInit(void);
|
||||||
|
|
Loading…
Reference in New Issue