diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2006-09-26 02:31:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:52 -0400 |
commit | 1a70cd40cb291c25b67ec0da715a49d76719329d (patch) | |
tree | ffb4c6cd3f7ef1b92822ebbda11bd2b035c2bc86 | |
parent | 62bac0185ad3dfef11d9602980445c54d45199c6 (diff) |
[PATCH] selinux: rename selinux_ctxid_to_string
Rename selinux_ctxid_to_string to selinux_sid_to_string to be
consistent with other interfaces.
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 | 8 | ||||
-rw-r--r-- | kernel/audit.c | 14 | ||||
-rw-r--r-- | kernel/auditfilter.c | 2 | ||||
-rw-r--r-- | kernel/auditsc.c | 4 | ||||
-rw-r--r-- | security/selinux/exports.c | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/include/linux/selinux.h b/include/linux/selinux.h index 79e4707ca772..df9098de4c99 100644 --- a/include/linux/selinux.h +++ b/include/linux/selinux.h | |||
@@ -70,8 +70,8 @@ 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_ctxid_to_string - map a security context ID to a string | 73 | * selinux_sid_to_string - map a security context ID to a string |
74 | * @ctxid: security context ID to be converted. | 74 | * @sid: security context ID to be converted. |
75 | * @ctx: address of context string to be returned | 75 | * @ctx: address of context string to be returned |
76 | * @ctxlen: length of returned context string. | 76 | * @ctxlen: length of returned context string. |
77 | * | 77 | * |
@@ -79,7 +79,7 @@ void selinux_audit_set_callback(int (*callback)(void)); | |||
79 | * string will be allocated internally, and the caller must call | 79 | * string will be allocated internally, and the caller must call |
80 | * kfree() on it after use. | 80 | * kfree() on it after use. |
81 | */ | 81 | */ |
82 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen); | 82 | int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen); |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * selinux_get_inode_sid - get the inode's security context ID | 85 | * selinux_get_inode_sid - get the inode's security context ID |
@@ -156,7 +156,7 @@ static inline void selinux_audit_set_callback(int (*callback)(void)) | |||
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | 158 | ||
159 | static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | 159 | static inline int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen) |
160 | { | 160 | { |
161 | *ctx = NULL; | 161 | *ctx = NULL; |
162 | *ctxlen = 0; | 162 | *ctxlen = 0; |
diff --git a/kernel/audit.c b/kernel/audit.c index 963fd15c9621..f9889ee77825 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -244,7 +244,7 @@ static int audit_set_rate_limit(int limit, uid_t loginuid, u32 sid) | |||
244 | char *ctx = NULL; | 244 | char *ctx = NULL; |
245 | u32 len; | 245 | u32 len; |
246 | int rc; | 246 | int rc; |
247 | if ((rc = selinux_ctxid_to_string(sid, &ctx, &len))) | 247 | if ((rc = selinux_sid_to_string(sid, &ctx, &len))) |
248 | return rc; | 248 | return rc; |
249 | else | 249 | else |
250 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, | 250 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, |
@@ -267,7 +267,7 @@ static int audit_set_backlog_limit(int limit, uid_t loginuid, u32 sid) | |||
267 | char *ctx = NULL; | 267 | char *ctx = NULL; |
268 | u32 len; | 268 | u32 len; |
269 | int rc; | 269 | int rc; |
270 | if ((rc = selinux_ctxid_to_string(sid, &ctx, &len))) | 270 | if ((rc = selinux_sid_to_string(sid, &ctx, &len))) |
271 | return rc; | 271 | return rc; |
272 | else | 272 | else |
273 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, | 273 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, |
@@ -293,7 +293,7 @@ static int audit_set_enabled(int state, uid_t loginuid, u32 sid) | |||
293 | char *ctx = NULL; | 293 | char *ctx = NULL; |
294 | u32 len; | 294 | u32 len; |
295 | int rc; | 295 | int rc; |
296 | if ((rc = selinux_ctxid_to_string(sid, &ctx, &len))) | 296 | if ((rc = selinux_sid_to_string(sid, &ctx, &len))) |
297 | return rc; | 297 | return rc; |
298 | else | 298 | else |
299 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, | 299 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, |
@@ -321,7 +321,7 @@ static int audit_set_failure(int state, uid_t loginuid, u32 sid) | |||
321 | char *ctx = NULL; | 321 | char *ctx = NULL; |
322 | u32 len; | 322 | u32 len; |
323 | int rc; | 323 | int rc; |
324 | if ((rc = selinux_ctxid_to_string(sid, &ctx, &len))) | 324 | if ((rc = selinux_sid_to_string(sid, &ctx, &len))) |
325 | return rc; | 325 | return rc; |
326 | else | 326 | else |
327 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, | 327 | audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, |
@@ -538,7 +538,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
538 | if (status_get->mask & AUDIT_STATUS_PID) { | 538 | if (status_get->mask & AUDIT_STATUS_PID) { |
539 | int old = audit_pid; | 539 | int old = audit_pid; |
540 | if (sid) { | 540 | if (sid) { |
541 | if ((err = selinux_ctxid_to_string( | 541 | if ((err = selinux_sid_to_string( |
542 | sid, &ctx, &len))) | 542 | sid, &ctx, &len))) |
543 | return err; | 543 | return err; |
544 | else | 544 | else |
@@ -576,7 +576,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
576 | "user pid=%d uid=%u auid=%u", | 576 | "user pid=%d uid=%u auid=%u", |
577 | pid, uid, loginuid); | 577 | pid, uid, loginuid); |
578 | if (sid) { | 578 | if (sid) { |
579 | if (selinux_ctxid_to_string( | 579 | if (selinux_sid_to_string( |
580 | sid, &ctx, &len)) { | 580 | sid, &ctx, &len)) { |
581 | audit_log_format(ab, | 581 | audit_log_format(ab, |
582 | " ssid=%u", sid); | 582 | " ssid=%u", sid); |
@@ -614,7 +614,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
614 | loginuid, sid); | 614 | loginuid, sid); |
615 | break; | 615 | break; |
616 | case AUDIT_SIGNAL_INFO: | 616 | case AUDIT_SIGNAL_INFO: |
617 | err = selinux_ctxid_to_string(audit_sig_sid, &ctx, &len); | 617 | err = selinux_sid_to_string(audit_sig_sid, &ctx, &len); |
618 | if (err) | 618 | if (err) |
619 | return err; | 619 | return err; |
620 | sig_data = kmalloc(sizeof(*sig_data) + len, GFP_KERNEL); | 620 | sig_data = kmalloc(sizeof(*sig_data) + len, GFP_KERNEL); |
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index a44879b0c72f..1a58a81fb09d 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -1398,7 +1398,7 @@ static void audit_log_rule_change(uid_t loginuid, u32 sid, char *action, | |||
1398 | if (sid) { | 1398 | if (sid) { |
1399 | char *ctx = NULL; | 1399 | char *ctx = NULL; |
1400 | u32 len; | 1400 | u32 len; |
1401 | if (selinux_ctxid_to_string(sid, &ctx, &len)) | 1401 | if (selinux_sid_to_string(sid, &ctx, &len)) |
1402 | audit_log_format(ab, " ssid=%u", sid); | 1402 | audit_log_format(ab, " ssid=%u", sid); |
1403 | else | 1403 | else |
1404 | audit_log_format(ab, " subj=%s", ctx); | 1404 | audit_log_format(ab, " subj=%s", ctx); |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 331e17010393..fb83c5cb8c32 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -898,7 +898,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
898 | if (axi->osid != 0) { | 898 | if (axi->osid != 0) { |
899 | char *ctx = NULL; | 899 | char *ctx = NULL; |
900 | u32 len; | 900 | u32 len; |
901 | if (selinux_ctxid_to_string( | 901 | if (selinux_sid_to_string( |
902 | axi->osid, &ctx, &len)) { | 902 | axi->osid, &ctx, &len)) { |
903 | audit_log_format(ab, " osid=%u", | 903 | audit_log_format(ab, " osid=%u", |
904 | axi->osid); | 904 | axi->osid); |
@@ -1005,7 +1005,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
1005 | if (n->osid != 0) { | 1005 | if (n->osid != 0) { |
1006 | char *ctx = NULL; | 1006 | char *ctx = NULL; |
1007 | u32 len; | 1007 | u32 len; |
1008 | if (selinux_ctxid_to_string( | 1008 | if (selinux_sid_to_string( |
1009 | n->osid, &ctx, &len)) { | 1009 | n->osid, &ctx, &len)) { |
1010 | audit_log_format(ab, " osid=%u", n->osid); | 1010 | audit_log_format(ab, " osid=%u", n->osid); |
1011 | call_panic = 2; | 1011 | call_panic = 2; |
diff --git a/security/selinux/exports.c b/security/selinux/exports.c index ee0fb47f81ae..b6f96943be1f 100644 --- a/security/selinux/exports.c +++ b/security/selinux/exports.c | |||
@@ -21,10 +21,10 @@ | |||
21 | #include "security.h" | 21 | #include "security.h" |
22 | #include "objsec.h" | 22 | #include "objsec.h" |
23 | 23 | ||
24 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | 24 | int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen) |
25 | { | 25 | { |
26 | if (selinux_enabled) | 26 | if (selinux_enabled) |
27 | return security_sid_to_context(ctxid, ctx, ctxlen); | 27 | return security_sid_to_context(sid, ctx, ctxlen); |
28 | else { | 28 | else { |
29 | *ctx = NULL; | 29 | *ctx = NULL; |
30 | *ctxlen = 0; | 30 | *ctxlen = 0; |