ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
594167
From 72fb11cd3191e7546ff0bae802f5bd6e5e815647 Mon Sep 17 00:00:00 2001
594167
From: David Tardon <dtardon@redhat.com>
594167
Date: Fri, 24 Jun 2022 09:59:44 +0200
594167
Subject: [PATCH] =?UTF-8?q?tree-wide:=20allow=20ASCII=20fallback=20for=20?=
594167
 =?UTF-8?q?=E2=80=A6=20in=20logs?=
594167
MIME-Version: 1.0
594167
Content-Type: text/plain; charset=UTF-8
594167
Content-Transfer-Encoding: 8bit
594167
594167
(cherry picked from commit 28e5e1e97f47067bce190ea6b3404907d63e4320)
594167
594167
Related: #2118297
594167
---
594167
 src/basic/os-util.c                           |  6 +++--
594167
 src/binfmt/binfmt.c                           |  2 +-
594167
 src/boot/bootctl.c                            |  2 +-
594167
 src/core/dbus-manager.c                       |  2 +-
594167
 src/core/manager.c                            |  4 ++--
594167
 .../environment-d-generator.c                 |  3 ++-
594167
 src/home/homectl.c                            | 12 ++++++----
594167
 src/libsystemd/sd-event/sd-event.c            |  4 +++-
594167
 src/nss-resolve/nss-resolve.c                 |  5 ++++-
594167
 src/resolve/resolved-varlink.c                |  5 ++++-
594167
 src/shared/user-record.c                      | 22 ++++++++++++++-----
594167
 src/sysusers/sysusers.c                       | 12 +++++-----
594167
 src/tmpfiles/tmpfiles.c                       |  6 ++---
594167
 13 files changed, 56 insertions(+), 29 deletions(-)
594167
594167
diff --git a/src/basic/os-util.c b/src/basic/os-util.c
594167
index acfff24319..880fb7e6bb 100644
594167
--- a/src/basic/os-util.c
594167
+++ b/src/basic/os-util.c
594167
@@ -8,6 +8,7 @@
594167
 #include "fd-util.h"
594167
 #include "fileio.h"
594167
 #include "fs-util.h"
594167
+#include "glyph-util.h"
594167
 #include "macro.h"
594167
 #include "os-util.h"
594167
 #include "parse-util.h"
594167
@@ -146,8 +147,9 @@ int open_extension_release(const char *root, const char *extension, char **ret_p
594167
                                 if (k != 0)
594167
                                         continue;
594167
 
594167
-                                log_debug("%s/%s: 'user.extension-release.strict' attribute is false…",
594167
-                                          extension_release_dir_path, de->d_name);
594167
+                                log_debug("%s/%s: 'user.extension-release.strict' attribute is false%s",
594167
+                                          extension_release_dir_path, de->d_name,
594167
+                                          special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                                 /* We already found what we were looking for, but there's another candidate?
594167
                                  * We treat this as an error, as we want to enforce that there are no ambiguities
594167
diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
594167
index 817ee387ff..71cb56aa4a 100644
594167
--- a/src/binfmt/binfmt.c
594167
+++ b/src/binfmt/binfmt.c
594167
@@ -83,7 +83,7 @@ static int apply_file(const char *filename, bool ignore_enoent) {
594167
                 return log_error_errno(r, "Failed to open file '%s': %m", filename);
594167
         }
594167
 
594167
-        log_debug("Applying %s…", pp);
594167
+        log_debug("Applying %s%s", pp, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
         for (unsigned line = 1;; line++) {
594167
                 _cleanup_free_ char *text = NULL;
594167
                 char *p;
594167
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
594167
index c1adae4962..292907eb4a 100644
594167
--- a/src/boot/bootctl.c
594167
+++ b/src/boot/bootctl.c
594167
@@ -1404,7 +1404,7 @@ static int are_we_installed(void) {
594167
         if (!p)
594167
                 return log_oom();
594167
 
594167
-        log_debug("Checking whether %s contains any files…", p);
594167
+        log_debug("Checking whether %s contains any files%s", p, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
         r = dir_is_empty(p);
594167
         if (r < 0 && r != -ENOENT)
594167
                 return log_error_errno(r, "Failed to check whether %s contains any files: %m", p);
594167
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
594167
index efba6331b9..0ce2d73857 100644
594167
--- a/src/core/dbus-manager.c
594167
+++ b/src/core/dbus-manager.c
594167
@@ -1886,7 +1886,7 @@ static int method_enqueue_marked_jobs(sd_bus_message *message, void *userdata, s
594167
         if (r == 0)
594167
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
594167
 
594167
-        log_info("Queuing reload/restart jobs for marked units…");
594167
+        log_info("Queuing reload/restart jobs for marked units%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
594167
         r = sd_bus_message_new_method_return(message, &reply);
594167
diff --git a/src/core/manager.c b/src/core/manager.c
594167
index c01128adb4..5b7f5f55aa 100644
594167
--- a/src/core/manager.c
594167
+++ b/src/core/manager.c
594167
@@ -1593,7 +1593,7 @@ static void manager_coldplug(Manager *m) {
594167
 
594167
         assert(m);
594167
 
594167
-        log_debug("Invoking unit coldplug() handlers…");
594167
+        log_debug("Invoking unit coldplug() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
         /* Let's place the units back into their deserialized state */
594167
         HASHMAP_FOREACH_KEY(u, k, m->units) {
594167
@@ -1614,7 +1614,7 @@ static void manager_catchup(Manager *m) {
594167
 
594167
         assert(m);
594167
 
594167
-        log_debug("Invoking unit catchup() handlers…");
594167
+        log_debug("Invoking unit catchup() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
         /* Let's catch up on any state changes that happened while we were reloading/reexecing */
594167
         HASHMAP_FOREACH_KEY(u, k, m->units) {
594167
diff --git a/src/environment-d-generator/environment-d-generator.c b/src/environment-d-generator/environment-d-generator.c
594167
index 39c46c7c2b..12aafbc7d9 100644
594167
--- a/src/environment-d-generator/environment-d-generator.c
594167
+++ b/src/environment-d-generator/environment-d-generator.c
594167
@@ -6,6 +6,7 @@
594167
 #include "def.h"
594167
 #include "env-file.h"
594167
 #include "escape.h"
594167
+#include "glyph-util.h"
594167
 #include "log.h"
594167
 #include "path-lookup.h"
594167
 #include "strv.h"
594167
@@ -55,7 +56,7 @@ static int load_and_print(void) {
594167
          * that in case of failure, a partial update is better than none. */
594167
 
594167
         STRV_FOREACH(i, files) {
594167
-                log_debug("Reading %s…", *i);
594167
+                log_debug("Reading %s%s", *i, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                 r = merge_env_file(&env, NULL, *i);
594167
                 if (r == -ENOMEM)
594167
diff --git a/src/home/homectl.c b/src/home/homectl.c
594167
index f0d1dac6ab..23bf17f5cf 100644
594167
--- a/src/home/homectl.c
594167
+++ b/src/home/homectl.c
594167
@@ -1683,9 +1683,13 @@ static int passwd_home(int argc, char *argv[], void *userdata) {
594167
         int r;
594167
 
594167
         if (arg_pkcs11_token_uri)
594167
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "To change the PKCS#11 security token use 'homectl update --pkcs11-token-uri=…'.");
594167
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
594167
+                                       "To change the PKCS#11 security token use 'homectl update --pkcs11-token-uri=%s'.",
594167
+                                       special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
         if (arg_fido2_device)
594167
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "To change the FIDO2 security token use 'homectl update --fido2-device=…'.");
594167
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
594167
+                                       "To change the FIDO2 security token use 'homectl update --fido2-device=%s'.",
594167
+                                       special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
         if (identity_properties_specified())
594167
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The 'passwd' verb does not permit changing other record properties at the same time.");
594167
 
594167
@@ -3600,8 +3604,8 @@ static int parse_argv(int argc, char *argv[]) {
594167
                                         return log_error_errno(r, "Failed to parse --rebalance-weight= argument: %s", optarg);
594167
 
594167
                                 if (u < REBALANCE_WEIGHT_MIN || u > REBALANCE_WEIGHT_MAX)
594167
-                                        return log_error_errno(SYNTHETIC_ERRNO(ERANGE), "Rebalancing weight out of valid range %" PRIu64 "…%" PRIu64 ": %s",
594167
-                                                               REBALANCE_WEIGHT_MIN, REBALANCE_WEIGHT_MAX, optarg);
594167
+                                        return log_error_errno(SYNTHETIC_ERRNO(ERANGE), "Rebalancing weight out of valid range %" PRIu64 "%s%" PRIu64 ": %s",
594167
+                                                               REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX, optarg);
594167
                         }
594167
 
594167
                         /* Drop from per machine stuff and everywhere */
594167
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
594167
index dd257eadfe..b491033ca7 100644
594167
--- a/src/libsystemd/sd-event/sd-event.c
594167
+++ b/src/libsystemd/sd-event/sd-event.c
594167
@@ -13,6 +13,7 @@
594167
 #include "event-source.h"
594167
 #include "fd-util.h"
594167
 #include "fs-util.h"
594167
+#include "glyph-util.h"
594167
 #include "hashmap.h"
594167
 #include "list.h"
594167
 #include "macro.h"
594167
@@ -405,7 +406,8 @@ _public_ int sd_event_new(sd_event** ret) {
594167
         e->epoll_fd = fd_move_above_stdio(e->epoll_fd);
594167
 
594167
         if (secure_getenv("SD_EVENT_PROFILE_DELAYS")) {
594167
-                log_debug("Event loop profiling enabled. Logarithmic histogram of event loop iterations in the range 2^0 … 2^63 us will be logged every 5s.");
594167
+                log_debug("Event loop profiling enabled. Logarithmic histogram of event loop iterations in the range 2^0 %s 2^63 us will be logged every 5s.",
594167
+                          special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 e->profile_delays = true;
594167
         }
594167
 
594167
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c
594167
index e857d42db6..9ed2945a1e 100644
594167
--- a/src/nss-resolve/nss-resolve.c
594167
+++ b/src/nss-resolve/nss-resolve.c
594167
@@ -10,6 +10,7 @@
594167
 
594167
 #include "env-util.h"
594167
 #include "errno-util.h"
594167
+#include "glyph-util.h"
594167
 #include "in-addr-util.h"
594167
 #include "macro.h"
594167
 #include "nss-util.h"
594167
@@ -180,7 +181,9 @@ static int json_dispatch_address(const char *name, JsonVariant *variant, JsonDis
594167
 
594167
                 b = json_variant_integer(i);
594167
                 if (b < 0 || b > 0xff)
594167
-                        return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is out of range 0…255.", k, strna(name));
594167
+                        return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
594167
+                                        "Element %zu of JSON field '%s' is out of range 0%s255.",
594167
+                                        k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                 buf.bytes[k++] = (uint8_t) b;
594167
         }
594167
diff --git a/src/resolve/resolved-varlink.c b/src/resolve/resolved-varlink.c
594167
index cc684608a6..a00dfee5dd 100644
594167
--- a/src/resolve/resolved-varlink.c
594167
+++ b/src/resolve/resolved-varlink.c
594167
@@ -1,5 +1,6 @@
594167
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
594167
 
594167
+#include "glyph-util.h"
594167
 #include "in-addr-util.h"
594167
 #include "resolved-dns-synthesize.h"
594167
 #include "resolved-varlink.h"
594167
@@ -371,7 +372,9 @@ static int json_dispatch_address(const char *name, JsonVariant *variant, JsonDis
594167
 
594167
                 b = json_variant_integer(i);
594167
                 if (b < 0 || b > 0xff)
594167
-                        return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is out of range 0…255.", k, strna(name));
594167
+                        return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
594167
+                                        "Element %zu of JSON field '%s' is out of range 0%s255.",
594167
+                                        k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                 buf.bytes[k++] = (uint8_t) b;
594167
         }
594167
diff --git a/src/shared/user-record.c b/src/shared/user-record.c
594167
index 5b406d1f42..eae0915fc7 100644
594167
--- a/src/shared/user-record.c
594167
+++ b/src/shared/user-record.c
594167
@@ -6,6 +6,7 @@
594167
 #include "dns-domain.h"
594167
 #include "env-util.h"
594167
 #include "fs-util.h"
594167
+#include "glyph-util.h"
594167
 #include "hexdecoct.h"
594167
 #include "hostname-util.h"
594167
 #include "memory-util.h"
594167
@@ -467,7 +468,9 @@ static int json_dispatch_umask(const char *name, JsonVariant *variant, JsonDispa
594167
 
594167
         k = json_variant_unsigned(variant);
594167
         if (k > 0777)
594167
-                return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' outside of valid range 0…0777.", strna(name));
594167
+                return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
594167
+                                "JSON field '%s' outside of valid range 0%s0777.",
594167
+                                strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
         *m = (mode_t) k;
594167
         return 0;
594167
@@ -487,7 +490,9 @@ static int json_dispatch_access_mode(const char *name, JsonVariant *variant, Jso
594167
 
594167
         k = json_variant_unsigned(variant);
594167
         if (k > 07777)
594167
-                return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' outside of valid range 0…07777.", strna(name));
594167
+                return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
594167
+                                "JSON field '%s' outside of valid range 0%s07777.",
594167
+                                strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
         *m = (mode_t) k;
594167
         return 0;
594167
@@ -578,7 +583,9 @@ static int json_dispatch_tasks_or_memory_max(const char *name, JsonVariant *vari
594167
 
594167
         k = json_variant_unsigned(variant);
594167
         if (k <= 0 || k >= UINT64_MAX)
594167
-                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "JSON field '%s' is not in valid range %" PRIu64 "…%" PRIu64 ".", strna(name), (uint64_t) 1, UINT64_MAX-1);
594167
+                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
594167
+                                "JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".",
594167
+                                strna(name), (uint64_t) 1, special_glyph(SPECIAL_GLYPH_ELLIPSIS), UINT64_MAX-1);
594167
 
594167
         *limit = k;
594167
         return 0;
594167
@@ -597,7 +604,10 @@ static int json_dispatch_weight(const char *name, JsonVariant *variant, JsonDisp
594167
 
594167
         k = json_variant_unsigned(variant);
594167
         if (k <= CGROUP_WEIGHT_MIN || k >= CGROUP_WEIGHT_MAX)
594167
-                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "JSON field '%s' is not in valid range %" PRIu64 "…%" PRIu64 ".", strna(name), (uint64_t) CGROUP_WEIGHT_MIN, (uint64_t) CGROUP_WEIGHT_MAX);
594167
+                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
594167
+                                "JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".",
594167
+                                strna(name), (uint64_t) CGROUP_WEIGHT_MIN,
594167
+                                special_glyph(SPECIAL_GLYPH_ELLIPSIS), (uint64_t) CGROUP_WEIGHT_MAX);
594167
 
594167
         *weight = k;
594167
         return 0;
594167
@@ -1010,7 +1020,9 @@ static int dispatch_rebalance_weight(const char *name, JsonVariant *variant, Jso
594167
         else if (u == 0)
594167
                 *rebalance_weight = REBALANCE_WEIGHT_OFF;
594167
         else
594167
-                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "Rebalance weight is out of valid range %" PRIu64 "…%" PRIu64 ".", REBALANCE_WEIGHT_MIN, REBALANCE_WEIGHT_MAX);
594167
+                return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
594167
+                                "Rebalance weight is out of valid range %" PRIu64 "%s%" PRIu64 ".",
594167
+                                REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX);
594167
 
594167
         return 0;
594167
 }
594167
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
594167
index 6a2ca1afbb..05e2591b6a 100644
594167
--- a/src/sysusers/sysusers.c
594167
+++ b/src/sysusers/sysusers.c
594167
@@ -405,7 +405,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char
594167
                 return 0;
594167
 
594167
         if (arg_dry_run) {
594167
-                log_info("Would write /etc/passwd…");
594167
+                log_info("Would write /etc/passwd%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 return 0;
594167
         }
594167
 
594167
@@ -529,7 +529,7 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char
594167
                 return 0;
594167
 
594167
         if (arg_dry_run) {
594167
-                log_info("Would write /etc/shadow…");
594167
+                log_info("Would write /etc/shadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 return 0;
594167
         }
594167
 
594167
@@ -667,7 +667,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char **
594167
                 return 0;
594167
 
594167
         if (arg_dry_run) {
594167
-                log_info("Would write /etc/group…");
594167
+                log_info("Would write /etc/group%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 return 0;
594167
         }
594167
 
594167
@@ -773,7 +773,7 @@ static int write_temporary_gshadow(const char * gshadow_path, FILE **tmpfile, ch
594167
                 return 0;
594167
 
594167
         if (arg_dry_run) {
594167
-                log_info("Would write /etc/gshadow…");
594167
+                log_info("Would write /etc/gshadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 return 0;
594167
         }
594167
 
594167
@@ -2002,13 +2002,13 @@ static int read_config_files(char **args) {
594167
 
594167
         STRV_FOREACH(f, files)
594167
                 if (p && path_equal(*f, p)) {
594167
-                        log_debug("Parsing arguments at position \"%s\"…", *f);
594167
+                        log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                         r = parse_arguments(args);
594167
                         if (r < 0)
594167
                                 return r;
594167
                 } else {
594167
-                        log_debug("Reading config file \"%s\"…", *f);
594167
+                        log_debug("Reading config file \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                         /* Just warn, ignore result otherwise */
594167
                         (void) read_config_file(*f, true);
594167
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
594167
index 023207bc60..c6019ae2c8 100644
594167
--- a/src/tmpfiles/tmpfiles.c
594167
+++ b/src/tmpfiles/tmpfiles.c
594167
@@ -3509,7 +3509,7 @@ static int read_config_file(char **config_dirs, const char *fn, bool ignore_enoe
594167
         assert(fn);
594167
 
594167
         if (streq(fn, "-")) {
594167
-                log_debug("Reading config from stdin…");
594167
+                log_debug("Reading config from stdin%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 fn = "<stdin>";
594167
                 f = stdin;
594167
         } else {
594167
@@ -3523,7 +3523,7 @@ static int read_config_file(char **config_dirs, const char *fn, bool ignore_enoe
594167
                         return log_error_errno(r, "Failed to open '%s': %m", fn);
594167
                 }
594167
 
594167
-                log_debug("Reading config file \"%s\"…", pp);
594167
+                log_debug("Reading config file \"%s\"%s", pp, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
                 fn = pp;
594167
                 f = _f;
594167
         }
594167
@@ -3626,7 +3626,7 @@ static int read_config_files(char **config_dirs, char **args, bool *invalid_conf
594167
 
594167
         STRV_FOREACH(f, files)
594167
                 if (p && path_equal(*f, p)) {
594167
-                        log_debug("Parsing arguments at position \"%s\"…", *f);
594167
+                        log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
594167
 
594167
                         r = parse_arguments(config_dirs, args, invalid_config);
594167
                         if (r < 0)