[gnome-session/benzea/check-env-more-strictly: 4/5] util: Only accept common space characters




commit fe22c4ee12922d790478bfe8b5b2e7c1313ca2f0
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Oct 19 16:27:59 2020 +0200

    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
    
    Closes: #70

 gnome-session/gsm-util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
index 18a94700d..9d05fd7b5 100644
--- a/gnome-session/gsm-util.c
+++ b/gnome-session/gsm-util.c
@@ -550,7 +550,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;
@@ -633,7 +633,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]