From: Christian Brauner Date: Fri, 25 May 2018 11:26:25 +0000 (+0200) Subject: seccomp: parse_v2_rules() X-Git-Tag: lxc-3.1.0~287^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54a051c1663ad1b3216833eca2e7d309730d50bd;p=thirdparty%2Flxc.git seccomp: parse_v2_rules() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index c7f0dab1c..ab40473e4 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -115,7 +115,7 @@ static uint32_t get_v2_default_action(char *line) } else if (strncmp(line, "trap", 4) == 0) { ret_action = SCMP_ACT_TRAP; } else if (line[0]) { - ERROR("Unrecognized seccomp action: %s", line); + ERROR("Unrecognized seccomp action \"%s\"", line); return -2; } @@ -261,27 +261,27 @@ static int parse_v2_rules(char *line, uint32_t def_action, if (rules->action == -1) { ERROR("Failed to interpret action"); ret = -1; - goto out; + goto on_error; } ret = 0; rules->args_num = 0; if (!strchr(tmp, '[')) - goto out; + goto on_error; ret = -1; for ((key = strtok_r(tmp, "]", &saveptr)), i = 0; key && i < 6; (key = strtok_r(NULL, "]", &saveptr)), i++) { ret = get_seccomp_arg_value(key, &rules->args_value[i]); if (ret < 0) - goto out; + goto on_error; rules->args_num++; } ret = 0; -out: +on_error: free(tmp); return ret;