]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
seccomp: add debug messages to seccomp_protect_hostname()
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 17:59:59 +0000 (18:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Apr 2019 14:56:48 +0000 (16:56 +0200)
src/shared/seccomp-util.c

index ba3f433106bd20ee3c43467df8322e418de14f20..9a8a4cf0aba1b90aea4f96dad09926d560ff7622 100644 (file)
@@ -1776,16 +1776,20 @@ int seccomp_protect_hostname(void) {
                                 SCMP_ACT_ERRNO(EPERM),
                                 SCMP_SYS(sethostname),
                                 0);
-                if (r < 0)
+                if (r < 0) {
+                        log_debug_errno(r, "Failed to add sethostname() rule for architecture %s, skipping: %m", seccomp_arch_to_string(arch));
                         continue;
+                }
 
                 r = seccomp_rule_add_exact(
                                 seccomp,
                                 SCMP_ACT_ERRNO(EPERM),
                                 SCMP_SYS(setdomainname),
                                 0);
-                if (r < 0)
+                if (r < 0) {
+                        log_debug_errno(r, "Failed to add setdomainname() rule for architecture %s, skipping: %m", seccomp_arch_to_string(arch));
                         continue;
+                }
 
                 r = seccomp_load(seccomp);
                 if (IN_SET(r, -EPERM, -EACCES))