Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 08df4905 authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore
Browse files

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: default avatarChristian Göttsche <cgzones@googlemail.com>
[PM: wrapped description]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent bcb62828
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment