aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-08-01 11:17:37 -0400
committerPaul Moore <pmoore@redhat.com>2014-08-01 11:17:37 -0400
commit4fbe63d1c773cceef3fe1f6ed0c9c268f4f24760 (patch)
treeac8a91fc13402494d211489ef3123aea3a5164f7 /security
parentd960a6184a92c8da70d26355bfcb5bd8ad637743 (diff)
netlabel: shorter names for the NetLabel catmap funcs/structs
Historically the NetLabel LSM secattr catmap functions and data structures have had very long names which makes a mess of the NetLabel code and anyone who uses NetLabel. This patch renames the catmap functions and structures from "*_secattr_catmap_*" to just "*_catmap_*" which improves things greatly. There are no substantial code or logic changes in this patch. Signed-off-by: Paul Moore <pmoore@redhat.com> Tested-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/ebitmap.c18
-rw-r--r--security/selinux/ss/ebitmap.h8
-rw-r--r--security/smack/smack_access.c6
-rw-r--r--security/smack/smack_lsm.c6
-rw-r--r--security/smack/smackfs.c14
5 files changed, 26 insertions, 26 deletions
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
index 842deca9484d..afe6a269ec17 100644
--- a/security/selinux/ss/ebitmap.c
+++ b/security/selinux/ss/ebitmap.c
@@ -86,7 +86,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src)
86 * 86 *
87 */ 87 */
88int ebitmap_netlbl_export(struct ebitmap *ebmap, 88int ebitmap_netlbl_export(struct ebitmap *ebmap,
89 struct netlbl_lsm_secattr_catmap **catmap) 89 struct netlbl_lsm_catmap **catmap)
90{ 90{
91 struct ebitmap_node *e_iter = ebmap->node; 91 struct ebitmap_node *e_iter = ebmap->node;
92 unsigned long e_map; 92 unsigned long e_map;
@@ -100,7 +100,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
100 } 100 }
101 101
102 if (*catmap != NULL) 102 if (*catmap != NULL)
103 netlbl_secattr_catmap_free(*catmap); 103 netlbl_catmap_free(*catmap);
104 *catmap = NULL; 104 *catmap = NULL;
105 105
106 while (e_iter) { 106 while (e_iter) {
@@ -108,10 +108,10 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
108 for (iter = 0; iter < EBITMAP_UNIT_NUMS; iter++) { 108 for (iter = 0; iter < EBITMAP_UNIT_NUMS; iter++) {
109 e_map = e_iter->maps[iter]; 109 e_map = e_iter->maps[iter];
110 if (e_map != 0) { 110 if (e_map != 0) {
111 rc = netlbl_secattr_catmap_setlong(catmap, 111 rc = netlbl_catmap_setlong(catmap,
112 offset, 112 offset,
113 e_map, 113 e_map,
114 GFP_ATOMIC); 114 GFP_ATOMIC);
115 if (rc != 0) 115 if (rc != 0)
116 goto netlbl_export_failure; 116 goto netlbl_export_failure;
117 } 117 }
@@ -123,7 +123,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
123 return 0; 123 return 0;
124 124
125netlbl_export_failure: 125netlbl_export_failure:
126 netlbl_secattr_catmap_free(*catmap); 126 netlbl_catmap_free(*catmap);
127 return -ENOMEM; 127 return -ENOMEM;
128} 128}
129 129
@@ -138,7 +138,7 @@ netlbl_export_failure:
138 * 138 *
139 */ 139 */
140int ebitmap_netlbl_import(struct ebitmap *ebmap, 140int ebitmap_netlbl_import(struct ebitmap *ebmap,
141 struct netlbl_lsm_secattr_catmap *catmap) 141 struct netlbl_lsm_catmap *catmap)
142{ 142{
143 int rc; 143 int rc;
144 struct ebitmap_node *e_iter = NULL; 144 struct ebitmap_node *e_iter = NULL;
@@ -147,7 +147,7 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap,
147 unsigned long bitmap; 147 unsigned long bitmap;
148 148
149 for (;;) { 149 for (;;) {
150 rc = netlbl_secattr_catmap_getlong(catmap, &offset, &bitmap); 150 rc = netlbl_catmap_getlong(catmap, &offset, &bitmap);
151 if (rc < 0) 151 if (rc < 0)
152 goto netlbl_import_failure; 152 goto netlbl_import_failure;
153 if (offset == (u32)-1) 153 if (offset == (u32)-1)
diff --git a/security/selinux/ss/ebitmap.h b/security/selinux/ss/ebitmap.h
index 712c8a7b8e8b..9637b8c71085 100644
--- a/security/selinux/ss/ebitmap.h
+++ b/security/selinux/ss/ebitmap.h
@@ -132,17 +132,17 @@ int ebitmap_write(struct ebitmap *e, void *fp);
132 132
133#ifdef CONFIG_NETLABEL 133#ifdef CONFIG_NETLABEL
134int ebitmap_netlbl_export(struct ebitmap *ebmap, 134int ebitmap_netlbl_export(struct ebitmap *ebmap,
135 struct netlbl_lsm_secattr_catmap **catmap); 135 struct netlbl_lsm_catmap **catmap);
136int ebitmap_netlbl_import(struct ebitmap *ebmap, 136int ebitmap_netlbl_import(struct ebitmap *ebmap,
137 struct netlbl_lsm_secattr_catmap *catmap); 137 struct netlbl_lsm_catmap *catmap);
138#else 138#else
139static inline int ebitmap_netlbl_export(struct ebitmap *ebmap, 139static inline int ebitmap_netlbl_export(struct ebitmap *ebmap,
140 struct netlbl_lsm_secattr_catmap **catmap) 140 struct netlbl_lsm_catmap **catmap)
141{ 141{
142 return -ENOMEM; 142 return -ENOMEM;
143} 143}
144static inline int ebitmap_netlbl_import(struct ebitmap *ebmap, 144static inline int ebitmap_netlbl_import(struct ebitmap *ebmap,
145 struct netlbl_lsm_secattr_catmap *catmap) 145 struct netlbl_lsm_catmap *catmap)
146{ 146{
147 return -ENOMEM; 147 return -ENOMEM;
148} 148}
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index ea1bc5055792..732df7b91227 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -441,10 +441,10 @@ int smk_netlbl_mls(int level, char *catset, struct netlbl_lsm_secattr *sap,
441 for (m = 0x80; m != 0; m >>= 1, cat++) { 441 for (m = 0x80; m != 0; m >>= 1, cat++) {
442 if ((m & *cp) == 0) 442 if ((m & *cp) == 0)
443 continue; 443 continue;
444 rc = netlbl_secattr_catmap_setbit(&sap->attr.mls.cat, 444 rc = netlbl_catmap_setbit(&sap->attr.mls.cat,
445 cat, GFP_ATOMIC); 445 cat, GFP_ATOMIC);
446 if (rc < 0) { 446 if (rc < 0) {
447 netlbl_secattr_catmap_free(sap->attr.mls.cat); 447 netlbl_catmap_free(sap->attr.mls.cat);
448 return rc; 448 return rc;
449 } 449 }
450 } 450 }
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 14f52be78c75..c32bba566df9 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3091,9 +3091,9 @@ static struct smack_known *smack_from_secattr(struct netlbl_lsm_secattr *sap,
3091 break; 3091 break;
3092 } 3092 }
3093 for (acat = -1, kcat = -1; acat == kcat; ) { 3093 for (acat = -1, kcat = -1; acat == kcat; ) {
3094 acat = netlbl_secattr_catmap_walk( 3094 acat = netlbl_catmap_walk(sap->attr.mls.cat,
3095 sap->attr.mls.cat, acat + 1); 3095 acat + 1);
3096 kcat = netlbl_secattr_catmap_walk( 3096 kcat = netlbl_catmap_walk(
3097 skp->smk_netlabel.attr.mls.cat, 3097 skp->smk_netlabel.attr.mls.cat,
3098 kcat + 1); 3098 kcat + 1);
3099 if (acat < 0 || kcat < 0) 3099 if (acat < 0 || kcat < 0)
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index 3198cfe1dcc6..893b06b93f6d 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -777,7 +777,7 @@ static int cipso_seq_show(struct seq_file *s, void *v)
777 struct list_head *list = v; 777 struct list_head *list = v;
778 struct smack_known *skp = 778 struct smack_known *skp =
779 list_entry(list, struct smack_known, list); 779 list_entry(list, struct smack_known, list);
780 struct netlbl_lsm_secattr_catmap *cmp = skp->smk_netlabel.attr.mls.cat; 780 struct netlbl_lsm_catmap *cmp = skp->smk_netlabel.attr.mls.cat;
781 char sep = '/'; 781 char sep = '/';
782 int i; 782 int i;
783 783
@@ -794,8 +794,8 @@ static int cipso_seq_show(struct seq_file *s, void *v)
794 794
795 seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); 795 seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl);
796 796
797 for (i = netlbl_secattr_catmap_walk(cmp, 0); i >= 0; 797 for (i = netlbl_catmap_walk(cmp, 0); i >= 0;
798 i = netlbl_secattr_catmap_walk(cmp, i + 1)) { 798 i = netlbl_catmap_walk(cmp, i + 1)) {
799 seq_printf(s, "%c%d", sep, i); 799 seq_printf(s, "%c%d", sep, i);
800 sep = ','; 800 sep = ',';
801 } 801 }
@@ -916,7 +916,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf,
916 916
917 rc = smk_netlbl_mls(maplevel, mapcatset, &ncats, SMK_CIPSOLEN); 917 rc = smk_netlbl_mls(maplevel, mapcatset, &ncats, SMK_CIPSOLEN);
918 if (rc >= 0) { 918 if (rc >= 0) {
919 netlbl_secattr_catmap_free(skp->smk_netlabel.attr.mls.cat); 919 netlbl_catmap_free(skp->smk_netlabel.attr.mls.cat);
920 skp->smk_netlabel.attr.mls.cat = ncats.attr.mls.cat; 920 skp->smk_netlabel.attr.mls.cat = ncats.attr.mls.cat;
921 skp->smk_netlabel.attr.mls.lvl = ncats.attr.mls.lvl; 921 skp->smk_netlabel.attr.mls.lvl = ncats.attr.mls.lvl;
922 rc = count; 922 rc = count;
@@ -966,14 +966,14 @@ static int cipso2_seq_show(struct seq_file *s, void *v)
966 struct list_head *list = v; 966 struct list_head *list = v;
967 struct smack_known *skp = 967 struct smack_known *skp =
968 list_entry(list, struct smack_known, list); 968 list_entry(list, struct smack_known, list);
969 struct netlbl_lsm_secattr_catmap *cmp = skp->smk_netlabel.attr.mls.cat; 969 struct netlbl_lsm_catmap *cmp = skp->smk_netlabel.attr.mls.cat;
970 char sep = '/'; 970 char sep = '/';
971 int i; 971 int i;
972 972
973 seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl); 973 seq_printf(s, "%s %3d", skp->smk_known, skp->smk_netlabel.attr.mls.lvl);
974 974
975 for (i = netlbl_secattr_catmap_walk(cmp, 0); i >= 0; 975 for (i = netlbl_catmap_walk(cmp, 0); i >= 0;
976 i = netlbl_secattr_catmap_walk(cmp, i + 1)) { 976 i = netlbl_catmap_walk(cmp, i + 1)) {
977 seq_printf(s, "%c%d", sep, i); 977 seq_printf(s, "%c%d", sep, i);
978 sep = ','; 978 sep = ',';
979 } 979 }