diff options
-rw-r--r-- | src/basic/fs-util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 32b1fb605..7a05e22ea 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -39,6 +39,7 @@ #include "mkdir.h" #include "parse-util.h" #include "path-util.h" +//#include "process-util.h" #include "stat-util.h" #include "stdio-util.h" #include "string-util.h" @@ -672,6 +673,14 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags, * specified path. */ if (original_root) { + if (isempty(original_root)) /* What's this even supposed to mean? */ + return -EINVAL; + + if (path_equal(original_root, "/")) /* A root directory of "/" is identical to none */ + original_root = NULL; + } + + if (original_root) { r = path_make_absolute_cwd(original_root, &root); if (r < 0) return r; |