From af7bfc16aa88b77de84c6124aeb43d57082533bc Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Tue, 5 Dec 2017 15:44:53 +0100 Subject: [PATCH] config.cc: set exec_file only if arg0 is set --- config.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.cc b/config.cc index df73e4c..0b2a54c 100644 --- a/config.cc +++ b/config.cc @@ -286,6 +286,7 @@ static bool configParseInternal(struct nsjconf_t* nsjconf, const nsjail::NsJailC static std::vector argv; if (njc.exec_bin().has_arg0()) { argv.push_back(njc.exec_bin().arg0().c_str()); + nsjconf->exec_file = njc.exec_bin().path().c_str(); } else { argv.push_back(njc.exec_bin().path().c_str()); } @@ -293,7 +294,6 @@ static bool configParseInternal(struct nsjconf_t* nsjconf, const nsjail::NsJailC argv.push_back(njc.exec_bin().arg(i).c_str()); } argv.push_back(nullptr); - nsjconf->exec_file = DUP_IF_SET(njc.exec_bin(), path); nsjconf->argv = argv.data(); nsjconf->use_execveat = njc.exec_bin().exec_fd(); } -- 2.7.4