safe_system: Execute system command safely (no shell injection)

View source: R/utils.R

safe_systemR Documentation

Execute system command safely (no shell injection)

Description

Execute system command safely (no shell injection)

Usage

safe_system(
  command,
  args = character(),
  allowed_commands = c("docker", "aws", "uname", "sysctl", "cat", "nproc"),
  stdin = NULL,
  stdout = "|",
  stderr = "|",
  ...
)

Arguments

command

Command to execute (must be in whitelist)

args

Character vector of arguments

allowed_commands

Commands allowed to be executed

stdin

Optional input to pass to stdin

...

Additional arguments passed to processx::run()

Value

Result from processx::run()


starburst documentation built on March 19, 2026, 5:08 p.m.