From 00c4485a1d8f69c54a51b01f4ac9b5d13165bf14 Mon Sep 17 00:00:00 2001 From: Gavin Hayes Date: Sun, 5 Feb 2023 00:49:42 -0500 Subject: [PATCH] zipos sysv execve add non-resource leaking method of running APE proof of concept --- test/libc/calls/execve_test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/libc/calls/execve_test.c b/test/libc/calls/execve_test.c index 3a05b9fda..6477ced0e 100644 --- a/test/libc/calls/execve_test.c +++ b/test/libc/calls/execve_test.c @@ -72,3 +72,15 @@ TEST(execve, ziposELF) { notpossible; EXITS(42); } + +TEST(execve, ziposAPE) { + if (!IsLinux()) { + EXPECT_EQ(-1, execve("/zip/life-nomod.com", (char *const[]){0}, + (char *const[]){0})); + return; + } + SPAWN(fork); + execve("/zip/life-nomod.com", (char *const[]){0}, (char *const[]){0}); + notpossible; + EXITS(42); +}