diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2006-09-26 02:31:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:52 -0400 |
commit | 62bac0185ad3dfef11d9602980445c54d45199c6 (patch) | |
tree | 8478673a1dccac5f4e7add4ad802a2bf69b269a4 | |
parent | 89fa30242facca249aead2aac03c4c69764f911c (diff) |
[PATCH] selinux: eliminate selinux_task_ctxid
Eliminate selinux_task_ctxid since it duplicates selinux_task_get_sid.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/selinux.h | 15 | ||||
-rw-r--r-- | kernel/auditsc.c | 2 | ||||
-rw-r--r-- | security/selinux/exports.c | 9 |
3 files changed, 1 insertions, 25 deletions
diff --git a/include/linux/selinux.h b/include/linux/selinux.h index aad4e390d6a5..79e4707ca772 100644 --- a/include/linux/selinux.h +++ b/include/linux/selinux.h | |||
@@ -70,16 +70,6 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | |||
70 | void selinux_audit_set_callback(int (*callback)(void)); | 70 | void selinux_audit_set_callback(int (*callback)(void)); |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * selinux_task_ctxid - determine a context ID for a process. | ||
74 | * @tsk: the task object | ||
75 | * @ctxid: ID value returned via this | ||
76 | * | ||
77 | * On return, ctxid will contain an ID for the context. This value | ||
78 | * should only be used opaquely. | ||
79 | */ | ||
80 | void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid); | ||
81 | |||
82 | /** | ||
83 | * selinux_ctxid_to_string - map a security context ID to a string | 73 | * selinux_ctxid_to_string - map a security context ID to a string |
84 | * @ctxid: security context ID to be converted. | 74 | * @ctxid: security context ID to be converted. |
85 | * @ctx: address of context string to be returned | 75 | * @ctx: address of context string to be returned |
@@ -166,11 +156,6 @@ static inline void selinux_audit_set_callback(int (*callback)(void)) | |||
166 | return; | 156 | return; |
167 | } | 157 | } |
168 | 158 | ||
169 | static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) | ||
170 | { | ||
171 | *ctxid = 0; | ||
172 | } | ||
173 | |||
174 | static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | 159 | static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) |
175 | { | 160 | { |
176 | *ctx = NULL; | 161 | *ctx = NULL; |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 1bd8827a0102..331e17010393 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -385,7 +385,7 @@ static int audit_filter_rules(struct task_struct *tsk, | |||
385 | logged upon error */ | 385 | logged upon error */ |
386 | if (f->se_rule) { | 386 | if (f->se_rule) { |
387 | if (need_sid) { | 387 | if (need_sid) { |
388 | selinux_task_ctxid(tsk, &sid); | 388 | selinux_get_task_sid(tsk, &sid); |
389 | need_sid = 0; | 389 | need_sid = 0; |
390 | } | 390 | } |
391 | result = selinux_audit_rule_match(sid, f->type, | 391 | result = selinux_audit_rule_match(sid, f->type, |
diff --git a/security/selinux/exports.c b/security/selinux/exports.c index 9d7737db5e51..ee0fb47f81ae 100644 --- a/security/selinux/exports.c +++ b/security/selinux/exports.c | |||
@@ -21,15 +21,6 @@ | |||
21 | #include "security.h" | 21 | #include "security.h" |
22 | #include "objsec.h" | 22 | #include "objsec.h" |
23 | 23 | ||
24 | void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) | ||
25 | { | ||
26 | struct task_security_struct *tsec = tsk->security; | ||
27 | if (selinux_enabled) | ||
28 | *ctxid = tsec->sid; | ||
29 | else | ||
30 | *ctxid = 0; | ||
31 | } | ||
32 | |||
33 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | 24 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) |
34 | { | 25 | { |
35 | if (selinux_enabled) | 26 | if (selinux_enabled) |