From 21d3066101486356d0d9f9d168c43b20a832272a Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Fri, 5 Aug 2016 19:20:23 +0200 Subject: [PATCH] Prefix executed commands with the snap path when necessary --- src/anbox/container.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/anbox/container.cpp b/src/anbox/container.cpp index 470a010..f41add2 100644 --- a/src/anbox/container.cpp +++ b/src/anbox/container.cpp @@ -69,7 +69,7 @@ void Container::start() { "-m", "u:1:100000:65536", "-m", "g:1:100000:65536", "--", - "/usr/bin/anbox-container", + utils::string_format("%s/usr/bin/anbox-container", utils::get_env_value("SNAP", "")), "--bind", spec_.rootfs_path, "/", "--dev", "/dev", "--proc", "/proc", @@ -112,7 +112,9 @@ void Container::start() { { "PATH", "/usr/bin" }, }; - child_ = core::posix::exec("/usr/bin/lxc-usernsexec", args, env, core::posix::StandardStream::empty); + child_ = core::posix::exec( + utils::string_format("%s/usr/bin/lxc-usernsexec", utils::get_env_value("SNAP", "")), + args, env, core::posix::StandardStream::empty); child_group_ = child_.process_group_or_throw(); }