Skip to content

Commit

Permalink
api: use EACCESS over EPERM
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pcmoore committed Jun 16, 2020
1 parent c39bf39 commit 83989be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/11-basic-basic_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 83989be

Please sign in to comment.