summaryrefslogtreecommitdiffstats
path: root/third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c')
-rw-r--r--third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c
new file mode 100644
index 0000000000..12b6ce78c9
--- /dev/null
+++ b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c
@@ -0,0 +1,12 @@
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main()
+{
+ FILE *file = fopen("/sandbox/../outside.txt", "r");
+ assert(file == NULL);
+ assert(errno == ENOTCAPABLE);
+
+ return 0;
+}