aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/services.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2008-04-17 11:52:44 -0400
committerJames Morris <jmorris@namei.org>2008-04-21 05:09:26 -0400
commit744ba35e455b0d5cf4f85208a8ca0edcc9976b95 (patch)
tree1b242324aeba16d07e1a3811df041969c10422a6 /security/selinux/ss/services.c
parent11670889380b144adfa5a91dc184c8f6300c4b28 (diff)
SELinux: clean up printks
Make sure all printk start with KERN_* Make sure all printk end with \n Make sure all printk have the word 'selinux' in them Change "function name" to "%s", __func__ (found 2 wrong) Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r--security/selinux/ss/services.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index fc3dfca475d6..2daaddbb301d 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -415,7 +415,8 @@ static int context_struct_compute_av(struct context *scontext,
415 return 0; 415 return 0;
416 416
417inval_class: 417inval_class:
418 printk(KERN_ERR "%s: unrecognized class %d\n", __func__, tclass); 418 printk(KERN_ERR "SELinux: %s: unrecognized class %d\n", __func__,
419 tclass);
419 return -EINVAL; 420 return -EINVAL;
420} 421}
421 422
@@ -499,8 +500,8 @@ int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
499 tclass = SECCLASS_NETLINK_SOCKET; 500 tclass = SECCLASS_NETLINK_SOCKET;
500 501
501 if (!tclass || tclass > policydb.p_classes.nprim) { 502 if (!tclass || tclass > policydb.p_classes.nprim) {
502 printk(KERN_ERR "security_validate_transition: " 503 printk(KERN_ERR "SELinux: %s: unrecognized class %d\n",
503 "unrecognized class %d\n", tclass); 504 __func__, tclass);
504 rc = -EINVAL; 505 rc = -EINVAL;
505 goto out; 506 goto out;
506 } 507 }
@@ -508,24 +509,24 @@ int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
508 509
509 ocontext = sidtab_search(&sidtab, oldsid); 510 ocontext = sidtab_search(&sidtab, oldsid);
510 if (!ocontext) { 511 if (!ocontext) {
511 printk(KERN_ERR "security_validate_transition: " 512 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
512 " unrecognized SID %d\n", oldsid); 513 __func__, oldsid);
513 rc = -EINVAL; 514 rc = -EINVAL;
514 goto out; 515 goto out;
515 } 516 }
516 517
517 ncontext = sidtab_search(&sidtab, newsid); 518 ncontext = sidtab_search(&sidtab, newsid);
518 if (!ncontext) { 519 if (!ncontext) {
519 printk(KERN_ERR "security_validate_transition: " 520 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
520 " unrecognized SID %d\n", newsid); 521 __func__, newsid);
521 rc = -EINVAL; 522 rc = -EINVAL;
522 goto out; 523 goto out;
523 } 524 }
524 525
525 tcontext = sidtab_search(&sidtab, tasksid); 526 tcontext = sidtab_search(&sidtab, tasksid);
526 if (!tcontext) { 527 if (!tcontext) {
527 printk(KERN_ERR "security_validate_transition: " 528 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
528 " unrecognized SID %d\n", tasksid); 529 __func__, tasksid);
529 rc = -EINVAL; 530 rc = -EINVAL;
530 goto out; 531 goto out;
531 } 532 }
@@ -581,15 +582,15 @@ int security_compute_av(u32 ssid,
581 582
582 scontext = sidtab_search(&sidtab, ssid); 583 scontext = sidtab_search(&sidtab, ssid);
583 if (!scontext) { 584 if (!scontext) {
584 printk(KERN_ERR "security_compute_av: unrecognized SID %d\n", 585 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
585 ssid); 586 __func__, ssid);
586 rc = -EINVAL; 587 rc = -EINVAL;
587 goto out; 588 goto out;
588 } 589 }
589 tcontext = sidtab_search(&sidtab, tsid); 590 tcontext = sidtab_search(&sidtab, tsid);
590 if (!tcontext) { 591 if (!tcontext) {
591 printk(KERN_ERR "security_compute_av: unrecognized SID %d\n", 592 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
592 tsid); 593 __func__, tsid);
593 rc = -EINVAL; 594 rc = -EINVAL;
594 goto out; 595 goto out;
595 } 596 }
@@ -686,16 +687,16 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
686 *scontext = scontextp; 687 *scontext = scontextp;
687 goto out; 688 goto out;
688 } 689 }
689 printk(KERN_ERR "security_sid_to_context: called before initial " 690 printk(KERN_ERR "SELinux: %s: called before initial "
690 "load_policy on unknown SID %d\n", sid); 691 "load_policy on unknown SID %d\n", __func__, sid);
691 rc = -EINVAL; 692 rc = -EINVAL;
692 goto out; 693 goto out;
693 } 694 }
694 POLICY_RDLOCK; 695 POLICY_RDLOCK;
695 context = sidtab_search(&sidtab, sid); 696 context = sidtab_search(&sidtab, sid);
696 if (!context) { 697 if (!context) {
697 printk(KERN_ERR "security_sid_to_context: unrecognized SID " 698 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
698 "%d\n", sid); 699 __func__, sid);
699 rc = -EINVAL; 700 rc = -EINVAL;
700 goto out_unlock; 701 goto out_unlock;
701 } 702 }
@@ -925,15 +926,15 @@ static int security_compute_sid(u32 ssid,
925 926
926 scontext = sidtab_search(&sidtab, ssid); 927 scontext = sidtab_search(&sidtab, ssid);
927 if (!scontext) { 928 if (!scontext) {
928 printk(KERN_ERR "security_compute_sid: unrecognized SID %d\n", 929 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
929 ssid); 930 __func__, ssid);
930 rc = -EINVAL; 931 rc = -EINVAL;
931 goto out_unlock; 932 goto out_unlock;
932 } 933 }
933 tcontext = sidtab_search(&sidtab, tsid); 934 tcontext = sidtab_search(&sidtab, tsid);
934 if (!tcontext) { 935 if (!tcontext) {
935 printk(KERN_ERR "security_compute_sid: unrecognized SID %d\n", 936 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
936 tsid); 937 __func__, tsid);
937 rc = -EINVAL; 938 rc = -EINVAL;
938 goto out_unlock; 939 goto out_unlock;
939 } 940 }
@@ -2031,16 +2032,16 @@ int security_sid_mls_copy(u32 sid, u32 mls_sid, u32 *new_sid)
2031 POLICY_RDLOCK; 2032 POLICY_RDLOCK;
2032 context1 = sidtab_search(&sidtab, sid); 2033 context1 = sidtab_search(&sidtab, sid);
2033 if (!context1) { 2034 if (!context1) {
2034 printk(KERN_ERR "security_sid_mls_copy: unrecognized SID " 2035 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
2035 "%d\n", sid); 2036 __func__, sid);
2036 rc = -EINVAL; 2037 rc = -EINVAL;
2037 goto out_unlock; 2038 goto out_unlock;
2038 } 2039 }
2039 2040
2040 context2 = sidtab_search(&sidtab, mls_sid); 2041 context2 = sidtab_search(&sidtab, mls_sid);
2041 if (!context2) { 2042 if (!context2) {
2042 printk(KERN_ERR "security_sid_mls_copy: unrecognized SID " 2043 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
2043 "%d\n", mls_sid); 2044 __func__, mls_sid);
2044 rc = -EINVAL; 2045 rc = -EINVAL;
2045 goto out_unlock; 2046 goto out_unlock;
2046 } 2047 }
@@ -2131,17 +2132,15 @@ int security_net_peersid_resolve(u32 nlbl_sid, u32 nlbl_type,
2131 2132
2132 nlbl_ctx = sidtab_search(&sidtab, nlbl_sid); 2133 nlbl_ctx = sidtab_search(&sidtab, nlbl_sid);
2133 if (!nlbl_ctx) { 2134 if (!nlbl_ctx) {
2134 printk(KERN_ERR 2135 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
2135 "security_sid_mls_cmp: unrecognized SID %d\n", 2136 __func__, nlbl_sid);
2136 nlbl_sid);
2137 rc = -EINVAL; 2137 rc = -EINVAL;
2138 goto out_slowpath; 2138 goto out_slowpath;
2139 } 2139 }
2140 xfrm_ctx = sidtab_search(&sidtab, xfrm_sid); 2140 xfrm_ctx = sidtab_search(&sidtab, xfrm_sid);
2141 if (!xfrm_ctx) { 2141 if (!xfrm_ctx) {
2142 printk(KERN_ERR 2142 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
2143 "security_sid_mls_cmp: unrecognized SID %d\n", 2143 __func__, xfrm_sid);
2144 xfrm_sid);
2145 rc = -EINVAL; 2144 rc = -EINVAL;
2146 goto out_slowpath; 2145 goto out_slowpath;
2147 } 2146 }
@@ -2221,7 +2220,7 @@ int security_get_permissions(char *class, char ***perms, int *nperms)
2221 2220
2222 match = hashtab_search(policydb.p_classes.table, class); 2221 match = hashtab_search(policydb.p_classes.table, class);
2223 if (!match) { 2222 if (!match) {
2224 printk(KERN_ERR "%s: unrecognized class %s\n", 2223 printk(KERN_ERR "SELinux: %s: unrecognized class %s\n",
2225 __func__, class); 2224 __func__, class);
2226 rc = -EINVAL; 2225 rc = -EINVAL;
2227 goto out; 2226 goto out;