]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
seccomp: fix comment and change variable name
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Mar 2021 02:10:54 +0000 (11:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Mar 2021 12:25:54 +0000 (21:25 +0900)
src/shared/seccomp-util.c

index ab24baaf9e65fb95f677836ed35745ece2d99430..009992cfbfc2a739d0f146c7aeb173fe7ab0f3f8 100644 (file)
@@ -1059,14 +1059,14 @@ int seccomp_load_syscall_filter_set(uint32_t default_action, const SyscallFilter
         return 0;
 }
 
-int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* set, uint32_t action, bool log_missing) {
+int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* filter, uint32_t action, bool log_missing) {
         uint32_t arch;
         int r;
 
-        /* Similar to seccomp_load_syscall_filter_set(), but takes a raw Set* of syscalls, instead of a
-         * SyscallFilterSet* table. */
+        /* Similar to seccomp_load_syscall_filter_set(), but takes a raw Hashmap* of syscalls, instead
+         * of a SyscallFilterSet* table. */
 
-        if (hashmap_isempty(set) && default_action == SCMP_ACT_ALLOW)
+        if (hashmap_isempty(filter) && default_action == SCMP_ACT_ALLOW)
                 return 0;
 
         SECCOMP_FOREACH_LOCAL_ARCH(arch) {
@@ -1079,7 +1079,7 @@ int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* set, u
                 if (r < 0)
                         return r;
 
-                HASHMAP_FOREACH_KEY(val, syscall_id, set) {
+                HASHMAP_FOREACH_KEY(val, syscall_id, filter) {
                         uint32_t a = action;
                         int id = PTR_TO_INT(syscall_id) - 1;
                         int error = PTR_TO_INT(val);
@@ -1095,7 +1095,8 @@ int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* set, u
 
                         r = seccomp_rule_add_exact(seccomp, a, id, 0);
                         if (r < 0) {
-                                /* If the system call is not known on this architecture, then that's fine, let's ignore it */
+                                /* If the system call is not known on this architecture, then that's
+                                 * fine, let's ignore it */
                                 _cleanup_free_ char *n = NULL;
                                 bool ignore;
 
@@ -1113,7 +1114,8 @@ int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* set, u
                 if (ERRNO_IS_SECCOMP_FATAL(r))
                         return r;
                 if (r < 0)
-                        log_debug_errno(r, "Failed to install filter set for architecture %s, skipping: %m", seccomp_arch_to_string(arch));
+                        log_debug_errno(r, "Failed to install systemc call filter for architecture %s, skipping: %m",
+                                        seccomp_arch_to_string(arch));
         }
 
         return 0;