aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-19 18:55:46 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-19 19:10:40 +0100
commit22f9a8a8f1e971dfba2ef5a79585ae00350ff3d9 (patch)
treee712b120a5afa710f94396cb485763391ad6231b
parent32f3104172cebd085e6415fd3c0ab6f6e803c334 (diff)
downloadpaludis-22f9a8a8f1e971dfba2ef5a79585ae00350ff3d9.tar.gz
paludis-22f9a8a8f1e971dfba2ef5a79585ae00350ff3d9.tar.xz
Ban absolute volatile symlinks
-rw-r--r--paludis/repositories/e/do_install_action.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index d80ac01..6fa587b 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -299,11 +299,18 @@ paludis::erepository::do_install_action(
if (volatile_files && phase->option("check_merge")) {
for (auto & v : *volatile_files) {
- if (! (package_builddir / "image" / v).stat().is_regular_file_or_symlink_to_regular_file())
+ auto vabs = (package_builddir / "image" / v);
+ auto vstat = vabs.stat();
+ if (! vstat.is_regular_file_or_symlink_to_regular_file())
throw ActionFailedError("Can't install '" + stringify(*id)
+ "' to destination '" + stringify(install_action.options.destination()->name())
+ "' because '" + stringify(v) + "' was marked using exvolatile, but it is not a regular "
"file or a symlink to a regular file");
+ if (vstat.is_symlink() && 0 == vabs.readlink().compare(0, 1, "/", 0, 1))
+ throw ActionFailedError("Can't install '" + stringify(*id)
+ + "' to destination '" + stringify(install_action.options.destination()->name())
+ + "' because '" + stringify(v) + "' was marked using exvolatile, but volatile symlinks"
+ "must not be absolute");
}
}
}