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