chiark / gitweb /
shared: include root when canonicalizing conf paths
authorMichael Marineau <michael.marineau@coreos.com>
Fri, 31 Jan 2014 23:35:04 +0000 (15:35 -0800)
committerLennart Poettering <lennart@poettering.net>
Thu, 13 Feb 2014 23:58:00 +0000 (00:58 +0100)
commit112cfb181453e38d3ef4a74fba23abbb53392002
tree29bed2d262a751a8297712f71123a5fb7e75c1b4
parentb58b227a53ee2b9feba8433a1558b51132ffb18b
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.
src/shared/conf-files.c
src/shared/path-lookup.c
src/shared/path-util.c
src/shared/path-util.h
src/shared/util.c