diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-07-28 17:54:56 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-08-03 22:19:57 -0400 |
commit | c50e125d057152bc68dfd5669b73611343653eb7 (patch) | |
tree | 5fb485f54bce01b64598669f33e76112ff430b42 /security/selinux/selinuxfs.c | |
parent | fd5a90ff1e95671e5b22dfa88d7359729b6c42b7 (diff) | |
download | linux-c50e125d057152bc68dfd5669b73611343653eb7.tar.gz linux-c50e125d057152bc68dfd5669b73611343653eb7.tar.bz2 linux-c50e125d057152bc68dfd5669b73611343653eb7.zip |
selinux: avoid implicit conversions in services code
Use u32 as the output parameter type in security_get_classes() and
security_get_permissions(), based on the type of the symtab nprim
member.
Declare the read-only class string parameter of
security_get_permissions() const.
Avoid several implicit conversions by using the identical type for the
destination.
Use the type identical to the source for local variables.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: cleanup extra whitespace in subject]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index f79e96f0f221..b969e87fd870 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1798,7 +1798,8 @@ static int sel_make_perm_files(struct selinux_policy *newpolicy, char *objclass, int classvalue, struct dentry *dir) { - int i, rc, nperms; + u32 i, nperms; + int rc; char **perms; rc = security_get_permissions(newpolicy, objclass, &perms, &nperms); @@ -1868,8 +1869,8 @@ static int sel_make_classes(struct selinux_policy *newpolicy, struct dentry *class_dir, unsigned long *last_class_ino) { - - int rc, nclasses, i; + u32 i, nclasses; + int rc; char **classes; rc = security_get_classes(newpolicy, &classes, &nclasses); |