lkml.org 
[lkml]   [2022]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/9] selinux: declare path parameters of _genfs_sid const
On Tue, Jan 25, 2022 at 9:14 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> 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, sb->s_type->name, /,
> ^~~
> ./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>
> ---
> security/selinux/include/security.h | 4 ++--
> security/selinux/ss/services.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)

Merged, thanks!

--
paul-moore.com

\
 
 \ /
  Last update: 2022-01-26 02:05    [W:0.151 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site