Add support for preventing calls to 'system' in C

This commit is contained in:
Nicolas Setton
2019-02-06 14:35:45 -05:00
parent d8362829d8
commit 5981b64dc5

View File

@@ -3,18 +3,22 @@
#include <unistd.h>
pid_t fork(void) {
fprintf(stdout, "fork not allowed\n");
printf("fork not allowed\n");
_exit(1);
}
pid_t vfork(void) {
fprintf(stdout, "vfork not allowed\n");
printf("vfork not allowed\n");
_exit(1);
}
int system(char* text) {
printf("system not allowed\n");
_exit(1);
}
int execve(const char *filename, char *const argv[],
char *const envp[]) {
fprintf(stdout, "execve not allowed\n");
printf("execve not allowed\n");
_exit(1);
}