From 856df4f3cca98d32d3aedbd8457eb7d6e9bebd43 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 11 Oct 2017 09:29:30 +0200 Subject: [PATCH] basic/env-util: drop the validation when deserializing environment The environment variables we've serialized can quite possibly contain characters outside the set allowed by env_assignment_is_valid(). In fact, my environment seems to contain a couple of these: * TERMCAP set by screen contains a '\x7f' character * BASH_FUNC_module%% variable has a '%' character in name Strict check of environment variables name and value certainly makes sense for unit files, but not so much for deserialization of values we already had in our environment. --- src/basic/env-util.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/basic/env-util.c b/src/basic/env-util.c index f533b22ef..95a78ccfb 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -810,11 +810,6 @@ int deserialize_environment(char ***environment, const char *line) { if (r < 0) return r; - if (!env_assignment_is_valid(uce)) { - free(uce); - return -EINVAL; - } - return strv_env_replace(environment, uce); } #endif // 0 -- 2.30.2