From cc532ddc666d6ba83f2e4d6b38c41ba1b95acb5d Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 9 Oct 2025 09:36:17 -0400 Subject: util: Only accept common space characters Specifically, systemd only permits " \t\n" and we should stick to the same set of permitted space characters. See also https://github.com/systemd/systemd/issues/17378 Backported from https://gitlab.gnome.org/GNOME/gnome-session/-/commit/fe22c4ee12922d790478bfe8b5b2e7c1313ca2f0 --- mate-session/gsm-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mate-session/gsm-util.c') diff --git a/mate-session/gsm-util.c b/mate-session/gsm-util.c index a760fc3..8269148 100644 --- a/mate-session/gsm-util.c +++ b/mate-session/gsm-util.c @@ -525,7 +525,7 @@ gsm_util_export_activation_environment (GError **error) return FALSE; } - value_regex = g_regex_new ("^([[:blank:]]|[^[:cntrl:]])*$", G_REGEX_OPTIMIZE, 0, error); + value_regex = g_regex_new ("^([ \t\n]|[^[:cntrl:]])*$", G_REGEX_OPTIMIZE, 0, error); if (value_regex == NULL) { return FALSE; @@ -597,7 +597,7 @@ gsm_util_export_user_environment (GError **error) return FALSE; } - regex = g_regex_new ("^[a-zA-Z_][a-zA-Z0-9_]*=([[:blank:]]|[^[:cntrl:]])*$", G_REGEX_OPTIMIZE, 0, error); + regex = g_regex_new ("^[a-zA-Z_][a-zA-Z0-9_]*=([ \t\n]|[^[:cntrl:]])*$", G_REGEX_OPTIMIZE, 0, error); if (regex == NULL) { return FALSE; -- cgit v1.2.1