richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
8d86bd
From aa93c2acd6c9ed4eb0152be9002f59ecd9cc277e Mon Sep 17 00:00:00 2001
8d86bd
From: David Tardon <dtardon@redhat.com>
8d86bd
Date: Fri, 24 Jun 2022 09:13:42 +0200
8d86bd
Subject: [PATCH] =?UTF-8?q?tree-wide:=20allow=20ASCII=20fallback=20for=20?=
8d86bd
 =?UTF-8?q?=E2=86=92=20in=20logs?=
8d86bd
MIME-Version: 1.0
8d86bd
Content-Type: text/plain; charset=UTF-8
8d86bd
Content-Transfer-Encoding: 8bit
8d86bd
8d86bd
(cherry picked from commit e2341b6bc325932b3f9f10874956952cbdbd6361)
8d86bd
8d86bd
Resolves: #2093479
8d86bd
---
8d86bd
 src/basic/mount-util.c           |  5 +++--
8d86bd
 src/core/dbus.c                  |  4 +++-
8d86bd
 src/core/namespace.c             |  7 +++++--
8d86bd
 src/core/socket.c                |  4 +++-
8d86bd
 src/libsystemd/sd-bus/sd-bus.c   |  4 +++-
8d86bd
 src/login/logind-acl.c           |  5 +++--
8d86bd
 src/resolve/resolved-dns-query.c | 11 +++++++++--
8d86bd
 src/shared/dns-domain.c          |  9 ++++++---
8d86bd
 src/tmpfiles/tmpfiles.c          |  4 +++-
8d86bd
 9 files changed, 38 insertions(+), 15 deletions(-)
8d86bd
8d86bd
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
8d86bd
index 0c709001be..e7f9e514c2 100644
8d86bd
--- a/src/basic/mount-util.c
8d86bd
+++ b/src/basic/mount-util.c
8d86bd
@@ -18,6 +18,7 @@
8d86bd
 #include "fileio.h"
8d86bd
 #include "fs-util.h"
8d86bd
 #include "hashmap.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "mount-util.h"
8d86bd
 #include "parse-util.h"
8d86bd
 #include "path-util.h"
8d86bd
@@ -844,8 +845,8 @@ int mount_verbose(
8d86bd
                 log_debug("Bind-mounting %s on %s (%s \"%s\")...",
8d86bd
                           what, where, strnull(fl), strempty(o));
8d86bd
         else if (f & MS_MOVE)
8d86bd
-                log_debug("Moving mount %s → %s (%s \"%s\")...",
8d86bd
-                          what, where, strnull(fl), strempty(o));
8d86bd
+                log_debug("Moving mount %s %s %s (%s \"%s\")...",
8d86bd
+                          what, special_glyph(ARROW), where, strnull(fl), strempty(o));
8d86bd
         else
8d86bd
                 log_debug("Mounting %s on %s (%s \"%s\")...",
8d86bd
                           strna(type), where, strnull(fl), strempty(o));
8d86bd
diff --git a/src/core/dbus.c b/src/core/dbus.c
8d86bd
index 584a8a1b01..66d838cdb4 100644
8d86bd
--- a/src/core/dbus.c
8d86bd
+++ b/src/core/dbus.c
8d86bd
@@ -31,6 +31,7 @@
8d86bd
 #include "dbus.h"
8d86bd
 #include "fd-util.h"
8d86bd
 #include "fs-util.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "log.h"
8d86bd
 #include "missing.h"
8d86bd
 #include "mkdir.h"
8d86bd
@@ -751,7 +752,8 @@ static int manager_dispatch_sync_bus_names(sd_event_source *es, void *userdata)
8d86bd
                 assert(s);
8d86bd
 
8d86bd
                 if (!streq_ptr(s->bus_name, name)) {
8d86bd
-                        log_unit_warning(u, "Bus name has changed from %s → %s, ignoring.", s->bus_name, name);
8d86bd
+                        log_unit_warning(u, "Bus name has changed from %s %s %s, ignoring.",
8d86bd
+                                         s->bus_name, special_glyph(ARROW), name);
8d86bd
                         continue;
8d86bd
                 }
8d86bd
 
8d86bd
diff --git a/src/core/namespace.c b/src/core/namespace.c
8d86bd
index e4930db15c..3566795d46 100644
8d86bd
--- a/src/core/namespace.c
8d86bd
+++ b/src/core/namespace.c
8d86bd
@@ -15,6 +15,7 @@
8d86bd
 #include "fd-util.h"
8d86bd
 #include "fs-util.h"
8d86bd
 #include "label.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "loop-util.h"
8d86bd
 #include "loopback-setup.h"
8d86bd
 #include "missing.h"
8d86bd
@@ -841,7 +842,8 @@ static int follow_symlink(
8d86bd
                 return -ELOOP;
8d86bd
         }
8d86bd
 
8d86bd
-        log_debug("Followed mount entry path symlink %s → %s.", mount_entry_path(m), target);
8d86bd
+        log_debug("Followed mount entry path symlink %s %s %s.",
8d86bd
+                  mount_entry_path(m), special_glyph(ARROW), target);
8d86bd
 
8d86bd
         free_and_replace(m->path_malloc, target);
8d86bd
         m->has_prefix = true;
8d86bd
@@ -920,7 +922,8 @@ static int apply_mount(
8d86bd
                 if (r < 0)
8d86bd
                         return log_debug_errno(r, "Failed to follow symlinks on %s: %m", mount_entry_source(m));
8d86bd
 
8d86bd
-                log_debug("Followed source symlinks %s → %s.", mount_entry_source(m), chased);
8d86bd
+                log_debug("Followed source symlinks %s %s %s.",
8d86bd
+                          mount_entry_source(m), special_glyph(ARROW), chased);
8d86bd
 
8d86bd
                 free_and_replace(m->source_malloc, chased);
8d86bd
 
8d86bd
diff --git a/src/core/socket.c b/src/core/socket.c
8d86bd
index 6f9a0f7575..bdfeb43a70 100644
8d86bd
--- a/src/core/socket.c
8d86bd
+++ b/src/core/socket.c
8d86bd
@@ -25,6 +25,7 @@
8d86bd
 #include "in-addr-util.h"
8d86bd
 #include "io-util.h"
8d86bd
 #include "label.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "log.h"
8d86bd
 #include "missing.h"
8d86bd
 #include "mkdir.h"
8d86bd
@@ -1355,7 +1356,8 @@ static int socket_symlink(Socket *s) {
8d86bd
                 }
8d86bd
 
8d86bd
                 if (r < 0)
8d86bd
-                        log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s → %s, ignoring: %m", p, *i);
8d86bd
+                        log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s %s %s, ignoring: %m",
8d86bd
+                                               p, special_glyph(ARROW), *i);
8d86bd
         }
8d86bd
 
8d86bd
         return 0;
8d86bd
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
8d86bd
index 803f3f50d6..21e54591f7 100644
8d86bd
--- a/src/libsystemd/sd-bus/sd-bus.c
8d86bd
+++ b/src/libsystemd/sd-bus/sd-bus.c
8d86bd
@@ -31,6 +31,7 @@
8d86bd
 #include "cgroup-util.h"
8d86bd
 #include "def.h"
8d86bd
 #include "fd-util.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "hexdecoct.h"
8d86bd
 #include "hostname-util.h"
8d86bd
 #include "macro.h"
8d86bd
@@ -518,7 +519,8 @@ void bus_set_state(sd_bus *bus, enum bus_state state) {
8d86bd
         if (state == bus->state)
8d86bd
                 return;
8d86bd
 
8d86bd
-        log_debug("Bus %s: changing state %s → %s", strna(bus->description), table[bus->state], table[state]);
8d86bd
+        log_debug("Bus %s: changing state %s %s %s", strna(bus->description),
8d86bd
+                  table[bus->state], special_glyph(ARROW), table[state]);
8d86bd
         bus->state = state;
8d86bd
 }
8d86bd
 
8d86bd
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c
8d86bd
index cafeb8822f..fe17eac0e6 100644
8d86bd
--- a/src/login/logind-acl.c
8d86bd
+++ b/src/login/logind-acl.c
8d86bd
@@ -9,6 +9,7 @@
8d86bd
 #include "escape.h"
8d86bd
 #include "fd-util.h"
8d86bd
 #include "format-util.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "logind-acl.h"
8d86bd
 #include "set.h"
8d86bd
 #include "string-util.h"
8d86bd
@@ -260,8 +261,8 @@ int devnode_acl_all(struct udev *udev,
8d86bd
         SET_FOREACH(n, nodes, i) {
8d86bd
                 int k;
8d86bd
 
8d86bd
-                log_debug("Changing ACLs at %s for seat %s (uid "UID_FMT"→"UID_FMT"%s%s)",
8d86bd
-                          n, seat, old_uid, new_uid,
8d86bd
+                log_debug("Changing ACLs at %s for seat %s (uid "UID_FMT"%s"UID_FMT"%s%s)",
8d86bd
+                          n, seat, old_uid, special_glyph(ARROW), new_uid,
8d86bd
                           del ? " del" : "", add ? " add" : "");
8d86bd
 
8d86bd
                 k = devnode_acl(n, flush, del, old_uid, add, new_uid);
8d86bd
diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c
8d86bd
index c921fe841f..573e27d662 100644
8d86bd
--- a/src/resolve/resolved-dns-query.c
8d86bd
+++ b/src/resolve/resolved-dns-query.c
8d86bd
@@ -3,6 +3,7 @@
8d86bd
 #include "alloc-util.h"
8d86bd
 #include "dns-domain.h"
8d86bd
 #include "dns-type.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "hostname-util.h"
8d86bd
 #include "local-addresses.h"
8d86bd
 #include "resolved-dns-query.h"
8d86bd
@@ -942,7 +943,10 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
8d86bd
         if (r < 0)
8d86bd
                 return r;
8d86bd
         else if (r > 0)
8d86bd
-                log_debug("Following CNAME/DNAME %s → %s.", dns_question_first_name(q->question_idna), dns_question_first_name(nq_idna));
8d86bd
+                log_debug("Following CNAME/DNAME %s %s %s.",
8d86bd
+                          dns_question_first_name(q->question_idna),
8d86bd
+                          special_glyph(ARROW),
8d86bd
+                          dns_question_first_name(nq_idna));
8d86bd
 
8d86bd
         k = dns_question_is_equal(q->question_idna, q->question_utf8);
8d86bd
         if (k < 0)
8d86bd
@@ -956,7 +960,10 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
8d86bd
                 if (k < 0)
8d86bd
                         return k;
8d86bd
                 else if (k > 0)
8d86bd
-                        log_debug("Following UTF8 CNAME/DNAME %s → %s.", dns_question_first_name(q->question_utf8), dns_question_first_name(nq_utf8));
8d86bd
+                        log_debug("Following UTF8 CNAME/DNAME %s %s %s.",
8d86bd
+                                  dns_question_first_name(q->question_utf8),
8d86bd
+                                  special_glyph(ARROW),
8d86bd
+                                  dns_question_first_name(nq_utf8));
8d86bd
         }
8d86bd
 
8d86bd
         if (r == 0 && k == 0) /* No actual cname happened? */
8d86bd
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
8d86bd
index de2fcca8b2..59799dec56 100644
8d86bd
--- a/src/shared/dns-domain.c
8d86bd
+++ b/src/shared/dns-domain.c
8d86bd
@@ -17,6 +17,7 @@
8d86bd
 
8d86bd
 #include "alloc-util.h"
8d86bd
 #include "dns-domain.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "hashmap.h"
8d86bd
 #include "hexdecoct.h"
8d86bd
 #include "in-addr-util.h"
8d86bd
@@ -1260,7 +1261,7 @@ int dns_name_apply_idna(const char *name, char **ret) {
8d86bd
 
8d86bd
         r = idn2_lookup_u8((uint8_t*) name, (uint8_t**) &t,
8d86bd
                            IDN2_NFC_INPUT | IDN2_NONTRANSITIONAL);
8d86bd
-        log_debug("idn2_lookup_u8: %s → %s", name, t);
8d86bd
+        log_debug("idn2_lookup_u8: %s %s %s", name, special_glyph(ARROW), t);
8d86bd
         if (r == IDN2_OK) {
8d86bd
                 if (!startswith(name, "xn--")) {
8d86bd
                         _cleanup_free_ char *s = NULL;
8d86bd
@@ -1273,8 +1274,10 @@ int dns_name_apply_idna(const char *name, char **ret) {
8d86bd
                         }
8d86bd
 
8d86bd
                         if (!streq_ptr(name, s)) {
8d86bd
-                                log_debug("idn2 roundtrip failed: \"%s\" → \"%s\" → \"%s\", ignoring.",
8d86bd
-                                          name, t, s);
8d86bd
+                                log_debug("idn2 roundtrip failed: \"%s\" %s \"%s\" %s \"%s\", ignoring.",
8d86bd
+                                          name, special_glyph(ARROW), t,
8d86bd
+                                          special_glyph(ARROW), s);
8d86bd
+                                *ret = NULL;
8d86bd
                                 return 0;
8d86bd
                         }
8d86bd
                 }
8d86bd
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
8d86bd
index 50fada99dd..b3c2aac746 100644
8d86bd
--- a/src/tmpfiles/tmpfiles.c
8d86bd
+++ b/src/tmpfiles/tmpfiles.c
8d86bd
@@ -36,6 +36,7 @@
8d86bd
 #include "fs-util.h"
8d86bd
 #include "glob-util.h"
8d86bd
 #include "io-util.h"
8d86bd
+#include "locale-util.h"
8d86bd
 #include "label.h"
8d86bd
 #include "log.h"
8d86bd
 #include "macro.h"
8d86bd
@@ -2143,7 +2144,8 @@ static int patch_var_run(const char *fname, unsigned line, char **path) {
8d86bd
          * there's no immediate need for action by the user. However, in the interest of making things less confusing
8d86bd
          * to the user, let's still inform the user that these snippets should really be updated. */
8d86bd
 
8d86bd
-        log_notice("[%s:%u] Line references path below legacy directory /var/run/, updating %s → %s; please update the tmpfiles.d/ drop-in file accordingly.", fname, line, *path, n);
8d86bd
+        log_notice("[%s:%u] Line references path below legacy directory /var/run/, updating %s %s %s; please update the tmpfiles.d/ drop-in file accordingly.",
8d86bd
+                   fname, line, *path, special_glyph(ARROW), n);
8d86bd
 
8d86bd
         free(*path);
8d86bd
         *path = n;