chiark / gitweb /
path: add new "systemd-path" utility for querying paths described in file-hierarchy(7)
[elogind.git] / src / shared / util.c
index 9b5a47ab6fb6d3735937945c156d7a526171adfe..a1c8baf237f12999d65268e6e6973283def34783 100644 (file)
@@ -5226,8 +5226,8 @@ int get_home_dir(char **_h) {
         assert(_h);
 
         /* Take the user specified one */
-        e = getenv("HOME");
-        if (e) {
+        e = secure_getenv("HOME");
+        if (e && path_is_absolute(e)) {
                 h = strdup(e);
                 if (!h)
                         return -ENOMEM;