diff options
Diffstat (limited to 'liblfjail/exec.cc')
| -rw-r--r-- | liblfjail/exec.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/liblfjail/exec.cc b/liblfjail/exec.cc index a1c9a4d..d86559e 100644 --- a/liblfjail/exec.cc +++ b/liblfjail/exec.cc @@ -35,27 +35,27 @@ auto fexecv::exec(this fexecv &self) noexcept -> void { /* * execv() */ -auto execv(std::string file, argv &&argv) -> fexecv { - auto const ret = ::open(file.c_str(), O_EXEC); +auto execv(std::string const &path, argv &&argv) -> fexecv { + auto const ret = ::open(path.c_str(), O_EXEC); if (ret == -1) - throw executable_not_found(file); - return fexecv(fd(ret), std::move(argv)); + throw executable_not_found(path); + return {fd(ret), std::move(argv)}; } /* * execvp() */ -auto execvp(std::string file, argv &&argv) -> fexecv { +auto execvp(std::string const &file, argv &&argv) -> fexecv { auto execfd = find_in_path(file); if (!execfd) throw executable_not_found(file); - return fexecv(std::move(*execfd), std::move(argv)); + return {std::move(*execfd), std::move(argv)}; } /* * shell */ -auto shell(std::string command) -> fexecv { +auto shell(std::string const &command) -> fexecv { return execl("/bin/sh", "sh", "-c", command); } |
