diff options
author | Paul Moore <paul@paul-moore.com> | 2020-04-02 20:37:32 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2020-06-16 11:21:28 -0400 |
commit | 83989be027341a1add3c12f2e3690ee1032beba1 (patch) | |
tree | 7f165c8b03b8006ace7607ce7cbad4277e95ca43 | |
parent | c39bf39eb723d37e988fc913e0aee689fa043204 (diff) | |
download | libseccomp-83989be027341a1add3c12f2e3690ee1032beba1.tar.gz |
api: use EACCESS over EPERM
This is part of our error code cleanup and API promise.
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | src/api.c | 4 | ||||
-rw-r--r-- | tests/11-basic-basic_errors.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -449,7 +449,7 @@ API int seccomp_rule_add_array(scmp_filter_ctx ctx, if (rc < 0) return rc; if (action == col->attr.act_default) - return -EPERM; + return -EACCES; return db_col_rule_add(col, 0, action, syscall, arg_cnt, arg_array); } @@ -498,7 +498,7 @@ API int seccomp_rule_add_exact_array(scmp_filter_ctx ctx, if (rc < 0) return rc; if (action == col->attr.act_default) - return -EPERM; + return -EACCES; if (col->filter_cnt > 1) return -EOPNOTSUPP; diff --git a/tests/11-basic-basic_errors.c b/tests/11-basic-basic_errors.c index ddd9e38..a41b7b5 100644 --- a/tests/11-basic-basic_errors.c +++ b/tests/11-basic-basic_errors.c @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) return -1; else { rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0); - if (rc != -EPERM) + if (rc != -EACCES) return -1; rc = seccomp_rule_add(ctx, SCMP_ACT_KILL - 1, SCMP_SYS(read), 0); if (rc != -EINVAL) |