add dup / dup2 / dup3

This commit is contained in:
virusdefender 2019-03-21 07:55:22 +08:00
parent 3b46596ed9
commit 74f801c485

View File

@ -46,6 +46,15 @@ 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(dup), 0) != 0) {
return LOAD_SECCOMP_FAILED;
}
if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup2), 0) != 0) {
return LOAD_SECCOMP_FAILED;
}
if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup3), 0) != 0) {
return LOAD_SECCOMP_FAILED;
}
}
if (seccomp_load(ctx) != 0) {
return LOAD_SECCOMP_FAILED;