Skip to content

Commit

Permalink
seccomp: error on unrecognized actions
Browse files Browse the repository at this point in the history
Be more strict about unrecognized actions. Previously the
parser would happily accept lines with typos like:

  kexec_load errrno 1

(note the extra 'r')

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
  • Loading branch information
Blub authored and Christian Brauner committed May 25, 2018
1 parent 3ce8c63 commit 3b09ea5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lxc/seccomp.c
Expand Up @@ -114,6 +114,9 @@ static uint32_t get_v2_default_action(char *line)
ret_action = SCMP_ACT_ALLOW;
} else if (strncmp(line, "trap", 4) == 0) {
ret_action = SCMP_ACT_TRAP;
} else if (line[0]) {
ERROR("Unrecognized seccomp action: %s", line);
return -2;
}

return ret_action;
Expand Down

0 comments on commit 3b09ea5

Please sign in to comment.