summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-07-01 02:44:10 +0100
committerPádraig Brady <P@draigBrady.com>2014-07-01 15:45:53 +0100
commit8e764584fda9c153c1e1387b9f8fa2f2591c28ad (patch)
tree9382b0d74081b7b83171ef85dce5de65a32f7d29 /tests
parent3106de5c789834cc9ee01fbc27b83b217e45e2ef (diff)
downloadcoreutils-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 'tests')
-rwxr-xr-xtests/cp/no-ctx.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/cp/no-ctx.sh b/tests/cp/no-ctx.sh
index 059c84f80..8b1328a47 100755
--- a/tests/cp/no-ctx.sh
+++ b/tests/cp/no-ctx.sh
@@ -30,7 +30,7 @@ cat > k.c <<'EOF' || framework_failure_
#include <selinux/selinux.h>
#include <errno.h>
-int getfilecon (const char *path, security_context_t *con)
+int getfilecon (const char *path, char **con)
{
/* Leave a marker so we can identify if the function was intercepted. */
fclose(fopen("preloaded", "w"));
@@ -39,7 +39,7 @@ int getfilecon (const char *path, security_context_t *con)
return -1;
}
-int lgetfilecon (const char *path, security_context_t *con)
+int lgetfilecon (const char *path, char **con)
{ return getfilecon (path, con); }
EOF