diff options
author | Paul Moore <pmoore@redhat.com> | 2015-12-17 19:07:47 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2016-02-09 08:32:15 -0500 |
commit | f16f405f61ecdbad202257b61004b85fce64d75c (patch) | |
tree | 2f7d4969994f44bcd4dfe4bc66a72b850647e8c6 /src/arch.c | |
parent | a4478ddcd4e3b34fcd9c526dcf54f0d79b33ac16 (diff) | |
download | libseccomp-f16f405f61ecdbad202257b61004b85fce64d75c.tar.gz |
db: store the rules used to build the filter
This will be useful in future patches for rebuilding and manipulating
the filter.
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/arch.c')
-rw-r--r-- | src/arch.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -441,8 +441,7 @@ int arch_syscall_rewrite(const struct arch_def *arch, int *syscall) * Rewrite a filter rule to match the architecture specifics * @param arch the architecture definition * @param strict strict flag - * @param syscall the syscall number - * @param chain the argument filter chain + * @param rule the filter rule * * Syscalls can vary across different architectures so this function handles * the necessary seccomp rule rewrites to ensure the right thing is done @@ -453,11 +452,11 @@ int arch_syscall_rewrite(const struct arch_def *arch, int *syscall) * @arch, and negative values on failure. * */ -int arch_filter_rewrite(const struct arch_def *arch, - bool strict, int *syscall, struct db_api_arg *chain) +int arch_filter_rewrite(const struct arch_def *arch, bool strict, + struct db_api_rule_list *rule) { int rc; - int sys = *syscall; + int sys = rule->syscall; if (sys >= 0) { /* we shouldn't be here - no rewrite needed */ @@ -469,7 +468,7 @@ int arch_filter_rewrite(const struct arch_def *arch, /* rewritable syscalls */ switch (arch->token) { case SCMP_ARCH_X86: - rc = x86_filter_rewrite(arch, strict, syscall, chain); + rc = x86_filter_rewrite(arch, strict, rule); /* we still want to catch invalid rewrites */ if (rc == -EINVAL) return -EINVAL; @@ -477,7 +476,7 @@ int arch_filter_rewrite(const struct arch_def *arch, } /* syscalls not defined on this architecture */ - if ((*syscall) < 0) + if (rule->syscall < 0) return -EDOM; return 0; } |