]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-invoke: fix ProtectHostname= value in log message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 15 Dec 2024 01:00:06 +0000 (10:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Dec 2024 14:55:44 +0000 (23:55 +0900)
Follow-up for cf48bde7aea52b18ac3fa218d3f60fd3d533ef66.

src/core/exec-invoke.c

index 8af0addcc92e30ac9c836d2574f17deb7d8c892c..fe1ee884dae8d1349dda17ad2e500c72ebebe7cd 100644 (file)
@@ -1708,22 +1708,17 @@ static int apply_protect_hostname(const ExecContext *c, const ExecParameters *p,
                 if (unshare(CLONE_NEWUTS) < 0) {
                         if (!ERRNO_IS_NOT_SUPPORTED(errno) && !ERRNO_IS_PRIVILEGE(errno)) {
                                 *ret_exit_status = EXIT_NAMESPACE;
-                                return log_exec_error_errno(c,
-                                                            p,
-                                                            errno,
-                                                            "Failed to set up UTS namespacing: %m");
+                                return log_exec_error_errno(c, p, errno, "Failed to set up UTS namespacing: %m");
                         }
 
-                        log_exec_warning(c,
-                                         p,
-                                         "ProtectHostname=yes is configured, but UTS namespace setup is "
-                                         "prohibited (container manager?), ignoring namespace setup.");
+                        log_exec_warning(c, p,
+                                         "ProtectHostname=%s is configured, but UTS namespace setup is prohibited (container manager?), ignoring namespace setup.",
+                                         protect_hostname_to_string(c->protect_hostname));
                 }
         } else
-                log_exec_warning(c,
-                                 p,
-                                 "ProtectHostname=yes is configured, but the kernel does not "
-                                 "support UTS namespaces, ignoring namespace setup.");
+                log_exec_warning(c, p,
+                                 "ProtectHostname=%s is configured, but the kernel does not support UTS namespaces, ignoring namespace setup.",
+                                 protect_hostname_to_string(c->protect_hostname));
 
 #if HAVE_SECCOMP
         if (c->protect_hostname == PROTECT_HOSTNAME_YES) {