#include "launcher.h" #include "resource.h" #include "rules/lang.h" #include "sandbox.h" #include "utils/log.h" #include #include void setup_all(void) { char comm[64]; int fd = open("/proc/self/comm", O_RDONLY); ssize_t len = read(fd, comm, sizeof(comm)); len = len > 0 ? len - 1 : 0; comm[len] = '\0'; close(fd); LOG_INFO("Setting up sandbox for %s(%d)", comm, getpid()); if (config[is_valid]) { LOG_INFO("Using config from launcher"); } else { LOG_INFO("Using config from environment"); } register_lang_c_cpp(); setup_rlimit(); setup_seccomp(); }