Commit 62bac018 authored by Stephen Smalley's avatar Stephen Smalley Committed by Linus Torvalds

[PATCH] selinux: eliminate selinux_task_ctxid

Eliminate selinux_task_ctxid since it duplicates selinux_task_get_sid.
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Acked-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 89fa3024
...@@ -69,16 +69,6 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, ...@@ -69,16 +69,6 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
*/ */
void selinux_audit_set_callback(int (*callback)(void)); void selinux_audit_set_callback(int (*callback)(void));
/**
* selinux_task_ctxid - determine a context ID for a process.
* @tsk: the task object
* @ctxid: ID value returned via this
*
* On return, ctxid will contain an ID for the context. This value
* should only be used opaquely.
*/
void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
/** /**
* selinux_ctxid_to_string - map a security context ID to a string * selinux_ctxid_to_string - map a security context ID to a string
* @ctxid: security context ID to be converted. * @ctxid: security context ID to be converted.
...@@ -166,11 +156,6 @@ static inline void selinux_audit_set_callback(int (*callback)(void)) ...@@ -166,11 +156,6 @@ static inline void selinux_audit_set_callback(int (*callback)(void))
return; return;
} }
static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
{
*ctxid = 0;
}
static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
{ {
*ctx = NULL; *ctx = NULL;
......
...@@ -385,7 +385,7 @@ static int audit_filter_rules(struct task_struct *tsk, ...@@ -385,7 +385,7 @@ static int audit_filter_rules(struct task_struct *tsk,
logged upon error */ logged upon error */
if (f->se_rule) { if (f->se_rule) {
if (need_sid) { if (need_sid) {
selinux_task_ctxid(tsk, &sid); selinux_get_task_sid(tsk, &sid);
need_sid = 0; need_sid = 0;
} }
result = selinux_audit_rule_match(sid, f->type, result = selinux_audit_rule_match(sid, f->type,
......
...@@ -21,15 +21,6 @@ ...@@ -21,15 +21,6 @@
#include "security.h" #include "security.h"
#include "objsec.h" #include "objsec.h"
void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
{
struct task_security_struct *tsec = tsk->security;
if (selinux_enabled)
*ctxid = tsec->sid;
else
*ctxid = 0;
}
int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
{ {
if (selinux_enabled) if (selinux_enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment