]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
user-util: simplify paths retrieved from $HOME and $SHELL
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Mar 2019 09:54:11 +0000 (10:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 Mar 2019 15:10:55 +0000 (16:10 +0100)
Let's add some extra paranoia, after #11910

src/basic/user-util.c

index 47d6763f1c917f82db0ee6606b0aa5a16e4c79c3..5f1bd5f5a2000b98d86ce84e765ae556e9a0b484 100644 (file)
@@ -463,7 +463,7 @@ int get_home_dir(char **_h) {
                 if (!h)
                         return -ENOMEM;
 
-                *_h = h;
+                *_h = path_simplify(h, true);
                 return 0;
         }
 
@@ -501,7 +501,7 @@ int get_home_dir(char **_h) {
         if (!h)
                 return -ENOMEM;
 
-        *_h = h;
+        *_h = path_simplify(h, true);
         return 0;
 }
 
@@ -520,7 +520,7 @@ int get_shell(char **_s) {
                 if (!s)
                         return -ENOMEM;
 
-                *_s = s;
+                *_s = path_simplify(s, true);
                 return 0;
         }
 
@@ -558,7 +558,7 @@ int get_shell(char **_s) {
         if (!s)
                 return -ENOMEM;
 
-        *_s = s;
+        *_s = path_simplify(s, true);
         return 0;
 }