summaryrefslogtreecommitdiffstats
path: root/security/selinux/include
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-07-28 17:54:56 +0200
committerPaul Moore <paul@paul-moore.com>2023-08-03 22:19:57 -0400
commitc50e125d057152bc68dfd5669b73611343653eb7 (patch)
tree5fb485f54bce01b64598669f33e76112ff430b42 /security/selinux/include
parentfd5a90ff1e95671e5b22dfa88d7359729b6c42b7 (diff)
downloadlinux-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/include')
-rw-r--r--security/selinux/include/security.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 668e393a9709..074d439fe9ad 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -312,9 +312,9 @@ int security_net_peersid_resolve(u32 nlbl_sid, u32 nlbl_type,
u32 *peer_sid);
int security_get_classes(struct selinux_policy *policy,
- char ***classes, int *nclasses);
+ char ***classes, u32 *nclasses);
int security_get_permissions(struct selinux_policy *policy,
- char *class, char ***perms, int *nperms);
+ const char *class, char ***perms, u32 *nperms);
int security_get_reject_unknown(void);
int security_get_allow_unknown(void);