diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-07-01 02:44:10 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-07-01 15:45:53 +0100 |
commit | 8e764584fda9c153c1e1387b9f8fa2f2591c28ad (patch) | |
tree | 9382b0d74081b7b83171ef85dce5de65a32f7d29 /src/copy.c | |
parent | 3106de5c789834cc9ee01fbc27b83b217e45e2ef (diff) | |
download | coreutils-8e764584fda9c153c1e1387b9f8fa2f2591c28ad.tar.xz |
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.
Diffstat (limited to 'src/copy.c')
-rw-r--r-- | src/copy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c index eee918a81..26d5bdd29 100644 --- a/src/copy.c +++ b/src/copy.c @@ -779,7 +779,7 @@ set_process_security_ctx (char const *src_name, char const *dst_name, /* Set the default context for the process to match the source. */ bool all_errors = !x->data_copy_required || x->require_preserve_context; bool some_errors = !all_errors && !x->reduce_diagnostics; - security_context_t con; + char *con; if (0 <= lgetfilecon (src_name, &con)) { |