summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-08 03:58:58 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-08 13:28:42 +0100
commit9e29ee407253a605b3fddf852594716564f6b20b (patch)
tree6171501a359057e2917726e25bc3a915e3fc9d6d /src/shared
parentcore,seccomp: refuse to specify errno for allow-listed syscalls (diff)
downloadsystemd-9e29ee407253a605b3fddf852594716564f6b20b.tar.xz
systemd-9e29ee407253a605b3fddf852594716564f6b20b.zip
seccomp: use FLAGS_SET() macro
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/seccomp-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c
index 3354f7bc08..bfb72ce3ed 100644
--- a/src/shared/seccomp-util.c
+++ b/src/shared/seccomp-util.c
@@ -1144,10 +1144,10 @@ int seccomp_parse_syscall_filter(
set = syscall_filter_set_find(name);
if (!set) {
- if (!(flags & SECCOMP_PARSE_PERMISSIVE))
+ if (!FLAGS_SET(flags, SECCOMP_PARSE_PERMISSIVE))
return -EINVAL;
- log_syntax(unit, flags & SECCOMP_PARSE_LOG ? LOG_WARNING : LOG_DEBUG, filename, line, 0,
+ log_syntax(unit, FLAGS_SET(flags, SECCOMP_PARSE_LOG) ? LOG_WARNING : LOG_DEBUG, filename, line, 0,
"Unknown system call group, ignoring: %s", name);
return 0;
}
@@ -1166,10 +1166,10 @@ int seccomp_parse_syscall_filter(
id = seccomp_syscall_resolve_name(name);
if (id == __NR_SCMP_ERROR) {
- if (!(flags & SECCOMP_PARSE_PERMISSIVE))
+ if (!FLAGS_SET(flags, SECCOMP_PARSE_PERMISSIVE))
return -EINVAL;
- log_syntax(unit, flags & SECCOMP_PARSE_LOG ? LOG_WARNING : LOG_DEBUG, filename, line, 0,
+ log_syntax(unit, FLAGS_SET(flags, SECCOMP_PARSE_LOG) ? LOG_WARNING : LOG_DEBUG, filename, line, 0,
"Failed to parse system call, ignoring: %s", name);
return 0;
}
@@ -1181,7 +1181,7 @@ int seccomp_parse_syscall_filter(
if (r < 0)
switch (r) {
case -ENOMEM:
- return flags & SECCOMP_PARSE_LOG ? log_oom() : -ENOMEM;
+ return FLAGS_SET(flags, SECCOMP_PARSE_LOG) ? log_oom() : -ENOMEM;
case -EEXIST:
assert_se(hashmap_update(filter, INT_TO_PTR(id + 1), INT_TO_PTR(errno_num)) == 0);
break;