]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: remove redundant utf8-validity check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 3 Jun 2018 15:36:46 +0000 (00:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 3 Jun 2018 16:38:54 +0000 (01:38 +0900)
src/core/load-fragment.c
src/shared/conf-parser.c
src/test/test-conf-parser.c

index 32a4249278c026c21cc105228e6a209c5818330f..0953355dce4c970b0a52726c35b98cde66439a87 100644 (file)
@@ -58,7 +58,6 @@
 #include "unit-name.h"
 #include "unit-printf.h"
 #include "user-util.h"
-#include "utf8.h"
 #include "web-util.h"
 
 static int supported_socket_protocol_from_string(const char *s) {
@@ -3829,11 +3828,6 @@ int config_parse_namespace_path_strv(
                         return 0;
                 }
 
-                if (!utf8_is_valid(word)) {
-                        log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, word);
-                        continue;
-                }
-
                 w = word;
                 if (startswith(w, "-")) {
                         ignore_enoent = true;
index 1057c59a1104a7422573c82a2217a9df3528ecba..8dc35d42065b622586ae3318ba3710549ef13a46 100644 (file)
@@ -688,11 +688,6 @@ int config_parse_string(
         assert(rvalue);
         assert(data);
 
-        if (!utf8_is_valid(rvalue)) {
-                log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
-                return 0;
-        }
-
         if (free_and_strdup(s, empty_to_null(rvalue)) < 0)
                 return log_oom();
 
@@ -777,12 +772,6 @@ int config_parse_strv(
                         break;
                 }
 
-                if (!utf8_is_valid(word)) {
-                        log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, word);
-                        free(word);
-                        continue;
-                }
-
                 r = strv_consume(sv, word);
                 if (r < 0)
                         return log_oom();
index f0e3d6c07ea4a866870e6e240ab8d1b3c1a93574..aa6e4f1a953e91b1bef5fbe9606648d4a5914ba7 100644 (file)
@@ -171,7 +171,7 @@ static void test_config_parse_strv(void) {
         test_config_parse_strv_one("foo bar foo", STRV_MAKE("foo", "bar", "foo"));
         test_config_parse_strv_one("\"foo bar\" foo", STRV_MAKE("foo bar", "foo"));
         test_config_parse_strv_one("\xc3\x80", STRV_MAKE("\xc3\x80"));
-        test_config_parse_strv_one("\xc3\x7f", STRV_MAKE_EMPTY);
+        test_config_parse_strv_one("\xc3\x7f", STRV_MAKE("\xc3\x7f"));
 }
 
 static void test_config_parse_mode(void) {