From cc47b2823e4334c93bd919ab9336aaf4344cf243 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 11 Aug 2019 21:03:50 +0200 Subject: [PATCH] sandbox: paths must be bind mounted in order of their length --- sandbox/sandbox-linux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sandbox/sandbox-linux.cpp b/sandbox/sandbox-linux.cpp index 2843b59..1ebb002 100644 --- a/sandbox/sandbox-linux.cpp +++ b/sandbox/sandbox-linux.cpp @@ -90,6 +90,7 @@ bool SandboxLinux::bindMountPaths(std::string target_root, std::initializer_list bool SandboxLinux::isolateNamespaces(std::vector fsPaths) { + std::sort(fsPaths.begin(), fsPaths.end(), [](const std::string &a, const std::string &b){ return a.length() < b.length(); }); auto current_uid = getuid(); auto current_gid = getgid();