Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Options:
run command (or edit file) as specified user name or ID
-v, --validate
validate a root login
--run0-extra-arg <RUN0_EXTRA_ARGS>
an extra argument to pass to run0 (can be specified multiple times)
-h, --help
Print help
-V, --version
Expand Down
4 changes: 4 additions & 0 deletions src/run0-sudo-shim/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ pub struct Cli {
#[clap(long, short = 'v', default_value_t = false)]
pub validate: bool,

/// an extra argument to pass to run0 (can be specified multiple times)
#[clap(long = "run0-extra-arg", allow_hyphen_values = true)]
pub run0_extra_args: Vec<String>,

/// command to be executed
#[arg(last(false), allow_hyphen_values = true)]
pub command: Vec<String>,
Expand Down
3 changes: 3 additions & 0 deletions src/run0-sudo-shim/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ fn main() {
.file_descriptor_limit
.map(|limit_nofile| format!("--property=LimitNOFILE={limit_nofile}"));

let run0_extra_args = cli.run0_extra_args;

if command.is_empty() && !cli.login {
let mut cmd = clap::Command::new(env!("CARGO_PKG_NAME"));
cmd.print_help().ok();
Expand All @@ -84,6 +86,7 @@ fn main() {
.args(user.iter())
.args(nofile.iter())
.args(env_flags)
.args(run0_extra_args.iter())
.args(command)
.exec();

Expand Down
Loading