diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-01-25 17:14:12 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2022-01-26 03:59:52 +0300 |
commit | 08df49054f311ca04954cf24d1216d3b5ddfd0a6 (patch) | |
tree | 6a4b006a8f24d5c90350ce3cff71be7bd0bd3a36 /security/selinux/ss | |
parent | bcb62828e3e8c813b6613db6eb7fd9657db248fc (diff) | |
download | linux-08df49054f311ca04954cf24d1216d3b5ddfd0a6.tar.xz |
selinux: declare path parameters of _genfs_sid const
The path parameter is only read from in security_genfs_sid(),
selinux_policy_genfs_sid() and __security_genfs_sid(). Since a string
literal is passed as argument, declare the parameter const.
Also align the parameter names in the declaration and definition.
Reported by clang [-Wwrite-strings]:
security/selinux/hooks.c:553:60: error: passing 'const char [2]'
to parameter of type 'char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
rc = security_genfs_sid(&selinux_state, ... , /,
^~~
./security/selinux/include/security.h:389:36: note: passing
argument to parameter 'name' here
const char *fstype, char *name, u16 sclass,
^
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: wrapped description]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss')
-rw-r--r-- | security/selinux/ss/services.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 8e92af7dd284..5a7df45bdab1 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -2875,7 +2875,7 @@ out_unlock: */ static inline int __security_genfs_sid(struct selinux_policy *policy, const char *fstype, - char *path, + const char *path, u16 orig_sclass, u32 *sid) { @@ -2928,7 +2928,7 @@ static inline int __security_genfs_sid(struct selinux_policy *policy, */ int security_genfs_sid(struct selinux_state *state, const char *fstype, - char *path, + const char *path, u16 orig_sclass, u32 *sid) { @@ -2952,7 +2952,7 @@ int security_genfs_sid(struct selinux_state *state, int selinux_policy_genfs_sid(struct selinux_policy *policy, const char *fstype, - char *path, + const char *path, u16 orig_sclass, u32 *sid) { |