diff --git a/container/src/root/common/utility.hh b/container/src/root/common/utility.hh index 20c3daa..b1a2a56 100644 --- a/container/src/root/common/utility.hh +++ b/container/src/root/common/utility.hh @@ -26,8 +26,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -619,11 +621,17 @@ class Pluggable // Load pluggable file ::dfi::common::load(m_plug.path().absolute()); - // Execute pluggable's loader - const std::string s{ + // Prepare pluggable entry + const std::string entry{ "dfi::" + m_plug.space().outer() + "::" + m_plug.space().inner() + "::" + m_plug.space().entry()}; - ::dfi::common::line(s + "::load(\"" + m_plug.args().load() + "\")"); + + // Allow quotations in loader argument + std::stringstream arg; + arg << std::quoted(m_plug.args().load()); + + // Execute pluggable's loader + ::dfi::common::line(entry + "::load(" + arg.str() + ")"); return *this; } @@ -634,11 +642,17 @@ class Pluggable //! \since docker-finance 1.1.0 const auto& unload() const { - // Execute pluggable's unloader - const std::string s{ + // Prepare pluggable entry + const std::string entry{ "dfi::" + m_plug.space().outer() + "::" + m_plug.space().inner() + "::" + m_plug.space().entry()}; - ::dfi::common::line(s + "::unload(\"" + m_plug.args().unload() + "\")"); + + // Allow quotations in unloader argument + std::stringstream arg; + arg << std::quoted(m_plug.args().unload()); + + // Execute pluggable's unloader + ::dfi::common::line(entry + "::unload(" + arg.str() + ")"); // Unload pluggable file ::dfi::common::unload(m_plug.path().absolute());