From: Yu Watanabe Date: Mon, 8 Mar 2021 02:54:05 +0000 (+0900) Subject: core: drop meaningless parse_syscall_and_errno() calls X-Git-Tag: v248-rc3~30^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=696a13bab779b060a8254c9a1e74eee9d28ac5e1;p=thirdparty%2Fsystemd.git core: drop meaningless parse_syscall_and_errno() calls parse_syscall_and_errno() does not check the validity of syscall name or syscall group name, but it just split into syscall name and errno. So, it is not necessary to call it for SystemCallLog=. --- diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index b664bbffa67..399986db4a4 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -2315,15 +2315,8 @@ int bus_exec_context_set_transient_property( } STRV_FOREACH(s, l) { - _cleanup_free_ char *n = NULL; - int e; - - r = parse_syscall_and_errno(*s, &n, &e); - if (r < 0) - return r; - - r = seccomp_parse_syscall_filter(n, - 0, /* errno not used */ + r = seccomp_parse_syscall_filter(*s, + -1, /* errno not used */ c->syscall_log, SECCOMP_PARSE_LOG | SECCOMP_PARSE_PERMISSIVE | invert_flag | diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index f9c334cc65e..41ee7b64380 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -3280,8 +3280,7 @@ int config_parse_syscall_log( p = rvalue; for (;;) { - _cleanup_free_ char *word = NULL, *name = NULL; - int num; + _cleanup_free_ char *word = NULL; r = extract_first_word(&p, &word, NULL, 0); if (r == 0) @@ -3293,14 +3292,8 @@ int config_parse_syscall_log( return 0; } - r = parse_syscall_and_errno(word, &name, &num); - if (r < 0 || num >= 0) { /* errno code not allowed */ - log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse syscall, ignoring: %s", word); - continue; - } - r = seccomp_parse_syscall_filter( - name, 0, c->syscall_log, + word, -1, c->syscall_log, SECCOMP_PARSE_LOG|SECCOMP_PARSE_PERMISSIVE| (invert ? SECCOMP_PARSE_INVERT : 0)| (c->syscall_log_allow_list ? SECCOMP_PARSE_ALLOW_LIST : 0),