nspawn: silence warning about failure in getting fuse version
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Nov 2024 04:42:03 +0000 (13:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Nov 2024 07:54:06 +0000 (16:54 +0900)
Follow-up for dc3223919f663b7c8b8d8d1d6072b4487df7709b.

If nspawn is invoked with DevicePolicy= but DeviceAllow= does not
contain /dev/fuse, nspawn will fail to get fuse version with -EPERM.
Let's silence the warning in that case.

src/nspawn/nspawn.c

index db0d64e62a4921c285d07c18c39bb1e0b71a93c4..18c23b211756eb08cdfc58f4d97093576ac4c4dd 100644 (file)
@@ -2211,7 +2211,8 @@ static bool should_enable_fuse(void) {
                 else if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
                         log_debug_errno(r, "Disabling FUSE: Kernel does not support the fsopen() family of syscalls: %m");
                 else
-                        log_warning_errno(r, "Disabling FUSE: Failed to determine FUSE version: %m");
+                        log_full_errno(ERRNO_IS_NEG_PRIVILEGE(r) ? LOG_DEBUG : LOG_WARNING, r,
+                                       "Disabling FUSE: Failed to determine FUSE version: %m");
                 return false;
         }