]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: fix const correctness warnings with security_context_t
authorPádraig Brady <P@draigBrady.com>
Tue, 1 Jul 2014 01:44:10 +0000 (02:44 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 1 Jul 2014 14:45:53 +0000 (15:45 +0100)
commit8e764584fda9c153c1e1387b9f8fa2f2591c28ad
tree9382b0d74081b7b83171ef85dce5de65a32f7d29
parent3106de5c789834cc9ee01fbc27b83b217e45e2ef
maint: fix const correctness warnings with security_context_t

The security_context_t type was always an artificial separation
from a standard char* string, and various libselinux using code
assumed both were synonymous.  In addition, prior to libselinux 2.3
function declarations were incorrect wrt constness of this type.
Here we replace security_context_t with char*, and also
provide a wrapper function to cater for the const issue on
older libselinux.

* src/system.h (se_const): A new function to avoid and identify
the const issue on older libselinux.
* src/copy.c: s/security_context_t/char */.
* src/cp.c: Likewise.
* src/id.c: Likewise.
* src/install.c: Likewise.
* src/ls.c: Likewise.
* src/mkdir.c: Likewise.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.
* src/runcon.c: Likewise.
* src/selinux.c: Likewise.
* tests/cp/no-ctx.sh: Likewise.
* src/chcon.c: Likesize.
13 files changed:
src/chcon.c
src/copy.c
src/cp.c
src/id.c
src/install.c
src/ls.c
src/mkdir.c
src/mkfifo.c
src/mknod.c
src/runcon.c
src/selinux.c
src/system.h
tests/cp/no-ctx.sh