diff options
author | netblue30 <netblue30@protonmail.com> | 2021-12-18 19:07:08 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2021-12-18 19:07:08 -0500 |
commit | 3fc2b91a82c2ddc780d8b6b11390ec9ce4e4255c (patch) | |
tree | 47720cc27dc5181623456ce2fdb0a66632b6de2a /test/filters | |
parent | Merge pull request #4782 from jose1711/nextcloud_usrshare (diff) | |
download | firejail-3fc2b91a82c2ddc780d8b6b11390ec9ce4e4255c.tar.gz firejail-3fc2b91a82c2ddc780d8b6b11390ec9ce4e4255c.tar.zst firejail-3fc2b91a82c2ddc780d8b6b11390ec9ce4e4255c.zip |
testing
Diffstat (limited to 'test/filters')
-rwxr-xr-x | test/filters/memwrexe | bin | 17096 -> 17096 bytes | |||
-rwxr-xr-x | test/filters/memwrexe-32 | bin | 6678 -> 15800 bytes | |||
-rw-r--r-- | test/filters/memwrexe.c | 14 |
3 files changed, 12 insertions, 2 deletions
diff --git a/test/filters/memwrexe b/test/filters/memwrexe index 669f0d320..1173cdc07 100755 --- a/test/filters/memwrexe +++ b/test/filters/memwrexe | |||
Binary files differ | |||
diff --git a/test/filters/memwrexe-32 b/test/filters/memwrexe-32 index 70c98b796..bdf71dcb4 100755 --- a/test/filters/memwrexe-32 +++ b/test/filters/memwrexe-32 | |||
Binary files differ | |||
diff --git a/test/filters/memwrexe.c b/test/filters/memwrexe.c index 4fbf05f78..d8bf4edaa 100644 --- a/test/filters/memwrexe.c +++ b/test/filters/memwrexe.c | |||
@@ -42,6 +42,11 @@ int main(int argc, char **argv) { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); | 44 | void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); |
45 | if (p == MAP_FAILED) { | ||
46 | printf("mmap failed\n"); | ||
47 | return 0; | ||
48 | } | ||
49 | |||
45 | printf("mmap successful\n"); | 50 | printf("mmap successful\n"); |
46 | 51 | ||
47 | // wait for expect to timeout | 52 | // wait for expect to timeout |
@@ -70,7 +75,12 @@ int main(int argc, char **argv) { | |||
70 | return 1; | 75 | return 1; |
71 | } | 76 | } |
72 | 77 | ||
73 | mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); | 78 | int rv = mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); |
79 | if (rv) { | ||
80 | printf("mprotect failed\n"); | ||
81 | return 1; | ||
82 | } | ||
83 | |||
74 | printf("mprotect successful\n"); | 84 | printf("mprotect successful\n"); |
75 | 85 | ||
76 | // wait for expect to timeout | 86 | // wait for expect to timeout |
@@ -82,7 +92,7 @@ int main(int argc, char **argv) { | |||
82 | else if (strcmp(argv[1], "memfd_create") == 0) { | 92 | else if (strcmp(argv[1], "memfd_create") == 0) { |
83 | int fd = syscall(SYS_memfd_create, "memfd_create", 0); | 93 | int fd = syscall(SYS_memfd_create, "memfd_create", 0); |
84 | if (fd == -1) { | 94 | if (fd == -1) { |
85 | fprintf(stderr, "TESTING ERROR: cannot run memfd_create test\n"); | 95 | printf("memfd_create failed\n"); |
86 | return 1; | 96 | return 1; |
87 | } | 97 | } |
88 | printf("memfd_create successful\n"); | 98 | printf("memfd_create successful\n"); |