]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: avoid discarded-qualifiers warnings with SELinux 3.5
authorBernhard Voelker <mail@bernhard-voelker.de>
Thu, 16 Mar 2023 22:11:47 +0000 (23:11 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Thu, 16 Mar 2023 23:12:18 +0000 (00:12 +0100)
commitf346fc01445b7192bb129ee12bd505d3ae07d777
tree9be5cfae59ccf8cc297970a904090d8d685426d1
parent1d03781daa034b77f82c1dac7c0095ce65b1cb63
maint: avoid discarded-qualifiers warnings with SELinux 3.5

Since SELinux version 3.5, the return value of context_str(3) is
declared as const; see:
  https://github.com/SELinuxProject/selinux/commit/dd98fa322766
Therefore, GCC complains (here with -Werror):
  src/selinux.c: In function 'defaultcon':
  src/selinux.c:152:16: error: assignment discards 'const' qualifier \
    from pointer target type [-Werror=discarded-qualifiers]
    152 |   if (!(constr = context_str (tcontext)))
        |                ^
  src/selinux.c: In function 'restorecon_private':
  src/selinux.c:252:16: error: assignment discards 'const' qualifier \
    from pointer target type [-Werror=discarded-qualifiers]
    252 |   if (!(constr = context_str (tcontext)))
      |                ^

* src/selinux.c (defaultcon): Define CONSTR as const.
(restorecon_private): Likewise.
src/selinux.c