summaryrefslogtreecommitdiff
path: root/src/shared/path-util.h
diff options
context:
space:
mode:
authorMichael Marineau <michael.marineau@coreos.com>2014-01-31 15:35:04 -0800
committerLennart Poettering <lennart@poettering.net>2014-02-14 00:58:00 +0100
commit112cfb181453e38d3ef4a74fba23abbb53392002 (patch)
tree29bed2d262a751a8297712f71123a5fb7e75c1b4 /src/shared/path-util.h
parentb58b227a53ee2b9feba8433a1558b51132ffb18b (diff)
shared: include root when canonicalizing conf paths
The conf_files_list family accepts an alternate root path to prefix all directories in the list but path_strv_canonicalize_uniq doesn't use it. This results in the suspicious behavior of resolving directory symlinks based on the contents of / instead of the alternate root. This adds a prefix argument to path_strv_canonicalize which will now prepend the prefix, if given, to every path in the list. To avoid answering what a relative path means when called with a root prefix path_strv_canonicalize is now path_strv_canonicalize_absolute and only considers absolute paths. Fortunately all users of already call path_strv_canonicalize with a list of absolute paths.
Diffstat (limited to 'src/shared/path-util.h')
-rw-r--r--src/shared/path-util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/path-util.h b/src/shared/path-util.h
index 178bed5f17..2b8ea0260e 100644
--- a/src/shared/path-util.h
+++ b/src/shared/path-util.h
@@ -46,8 +46,8 @@ char* path_startswith(const char *path, const char *prefix) _pure_;
bool path_equal(const char *a, const char *b) _pure_;
char** path_strv_make_absolute_cwd(char **l);
-char** path_strv_canonicalize(char **l);
-char** path_strv_canonicalize_uniq(char **l);
+char** path_strv_canonicalize_absolute(char **l, const char *prefix);
+char** path_strv_canonicalize_absolute_uniq(char **l, const char *prefix);
int path_is_mount_point(const char *path, bool allow_symlink);
int path_is_read_only_fs(const char *path);