diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2014-01-21 05:41:25 -0800 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2014-01-21 05:41:25 -0800 |
commit | e49c1e1958e863195b01d99c92194289b4034bbb (patch) | |
tree | ee305c933ea7b653f769fe209601ca963938e16d /test/Runtime/POSIX/SELinux/SELinux.c | |
parent | f626bdb1905c4d56fdcca04cd6ee84acb7597431 (diff) | |
parent | ebc387f1181ca39cd72fe8ef27a535cd0c674bcf (diff) | |
download | klee-e49c1e1958e863195b01d99c92194289b4034bbb.tar.gz |
Merge pull request #92 from delcypher/fix_llvm-lit
Move testing infrastructure to llvm-lit and completly remove all DejaGNU support
Diffstat (limited to 'test/Runtime/POSIX/SELinux/SELinux.c')
-rw-r--r-- | test/Runtime/POSIX/SELinux/SELinux.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/SELinux/SELinux.c b/test/Runtime/POSIX/SELinux/SELinux.c new file mode 100644 index 00000000..65dd1a7f --- /dev/null +++ b/test/Runtime/POSIX/SELinux/SELinux.c @@ -0,0 +1,30 @@ +/* Very basic test, as right now SELinux support is extremely basic */ +// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc +// RUN: %klee --posix-runtime --exit-on-error %t1.bc --sym-arg 2 > %t.log +// XFAIL: no-selinux + +#include <selinux/selinux.h> +#include <stdio.h> +#include <assert.h> + +int main(int argc, char** argv) { + + security_context_t con; + + assert(argc == 2); + + int selinux = is_selinux_enabled(); + printf("selinux enabled = %d\n", selinux); + + if (setfscreatecon(argv[1]) < 0) + printf("Error: set\n"); + else printf("Success: set\n"); + + if (getfscreatecon(&con) < 0) + printf("Error: get\n"); + else printf("Success: get\n"); + + printf("create_con = %s\n", con); + + return 0; +} |