bunpen: --bunpen-drop-shell: specify argv0 more correctly
This commit is contained in:
@@ -13,7 +13,7 @@ fn do_exec(name: str, args: []str) (os::exec::error | void) = {
|
||||
{
|
||||
let joined = strings::join(" ", args...);
|
||||
defer free(joined);
|
||||
log::printfln("exec: {}", joined);
|
||||
log::printfln("exec ({}): {}", name, joined);
|
||||
};
|
||||
|
||||
let path = args[0];
|
||||
@@ -50,7 +50,8 @@ export fn main() void = {
|
||||
restrict::namespace_restrict(&what);
|
||||
restrict::landlock_restrict(&what);
|
||||
if (opts.drop_shell) {
|
||||
rtext::check_error("exec /bin/sh", do_exec(name, ["/bin/sh"]));
|
||||
// TODO: respect the user's $SHELL
|
||||
rtext::check_error("exec /bin/sh", do_exec("sh", ["/bin/sh"]));
|
||||
} else {
|
||||
rtext::check_error("exec <user command>", do_exec(name, opts.cmd));
|
||||
};
|
||||
|
Reference in New Issue
Block a user