From fd92d0365fa38bdc2b22e563c31ec73d49a98584 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Wed, 6 Sep 2023 10:27:18 +0800 Subject: [PATCH] add openat to whitelist, fix https://github.com/QingdaoU/OnlineJudge/issues/449 --- src/rules/c_cpp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rules/c_cpp.c b/src/rules/c_cpp.c index 567641e..866b63e 100644 --- a/src/rules/c_cpp.c +++ b/src/rules/c_cpp.c @@ -47,6 +47,9 @@ int _c_cpp_seccomp_rules(struct config *_config, bool allow_write_file) { if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0) != 0) { return LOAD_SECCOMP_FAILED; } + if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0) != 0) { + return LOAD_SECCOMP_FAILED; + } if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup), 0) != 0) { return LOAD_SECCOMP_FAILED; }