From d97f0f7300a5be2263d61e6db31db7c3a56ce3a6 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 15 May 2024 08:05:00 +0000 Subject: [PATCH] sanebox: implement --sanebox-home-path and --sanebox-run-path flags --- pkgs/additional/sanebox/sanebox | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/additional/sanebox/sanebox b/pkgs/additional/sanebox/sanebox index 48d316e9..d5837d98 100644 --- a/pkgs/additional/sanebox/sanebox +++ b/pkgs/additional/sanebox/sanebox @@ -119,6 +119,11 @@ usage() { echo ' do not unshare the provided linux namespace' echo ' --sanebox-path ' echo ' allow access to the host within the sandbox' + echo ' path is interpreted relative to the working directory if not absolute' + echo ' --sanebox-home-path ' + echo ' allow access to the host , relative to HOME' + echo ' --sanebox-run-path ' + echo ' allow access to the host , relative to XDG_RUNTIME_DIR' echo ' --sanebox-add-pwd' echo ' shorthand for `--sanebox-path $PWD`' echo ' --sanebox-profile ' @@ -548,6 +553,16 @@ parseArgs() { relativeToPwd _absPath "$path" paths+=("$_absPath") ;; + (--sanebox-home-path) + local path="$1" + shift + paths+=("$HOME/$path") + ;; + (--sanebox-run-path) + local path="$1" + shift + paths+=("$XDG_RUNTIME_DIR/$path") + ;; (--sanebox-add-pwd) paths+=("$PWD") ;;