From: Yu Watanabe Date: Thu, 11 May 2023 10:13:51 +0000 (+0900) Subject: Revert "core/mount: replace invalid UTF-8 code points in "what" and "options"" X-Git-Tag: v254-rc1~507^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcf58ff5598d916521d89182aadbfcffe21d648f;p=thirdparty%2Fsystemd.git Revert "core/mount: replace invalid UTF-8 code points in "what" and "options"" This reverts commit aaf7b0e41105d7b7cf30912cdac32820f011a219. Not only /proc/mountinfo, .mount units not started yet may contain invalid UTF-8 chars. --- diff --git a/src/core/mount.c b/src/core/mount.c index b87b57b7ad2..549d7dbf986 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -34,7 +34,6 @@ #include "strv.h" #include "unit-name.h" #include "unit.h" -#include "utf8.h" #define RETRY_UMOUNT_MAX 32 @@ -275,35 +274,13 @@ static int update_parameters_proc_self_mountinfo( p = &m->parameters_proc_self_mountinfo; - if (what && !utf8_is_valid(what)) { - _cleanup_free_ char *what_escaped = NULL; - - what_escaped = utf8_escape_invalid(what); - if (!what_escaped) - return -ENOMEM; - - r = !streq_ptr(p->what, what_escaped); - free_and_replace(p->what, what_escaped); - } else { - r = free_and_strdup(&p->what, what); - if (r < 0) - return r; - } - - if (options && !utf8_is_valid(options)) { - _cleanup_free_ char *options_escaped = NULL; - - options_escaped = utf8_escape_invalid(options); - if (!options_escaped) - return -ENOMEM; + r = free_and_strdup(&p->what, what); + if (r < 0) + return r; - q = !streq_ptr(p->options, options_escaped); - free_and_replace(p->options, options_escaped); - } else { - q = free_and_strdup(&p->options, options); - if (q < 0) - return q; - } + q = free_and_strdup(&p->options, options); + if (q < 0) + return q; w = free_and_strdup(&p->fstype, fstype); if (w < 0)