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