mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit c932a7a87722be46876190afc774c01d1ad46221
parent 03aba9fe2c7c9c92239cb4db7b9dcbc322e651be
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Tue, 15 Aug 2023 20:39:17 +0200

Merge branch 'master' of a3nm.net:git/mybin

Diffstat:
sandboxed-browser | 6+-----
sandboxed-browser-mount | 18++++++++++++++++++
2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/sandboxed-browser b/sandboxed-browser @@ -10,11 +10,7 @@ mkdir -p "$ENDPOINT" # replace by ACLs grep -qs " $ENDPOINT " /proc/mounts || ( echo "$ENDPOINT was not mounted, mounting it" - sudo bindfs --create-for-user=$(id -u browser2) \ - --create-for-group=$(id -g browser2) \ - --chown-deny --chgrp-deny --chmod-deny -p '700' \ - -u $(id -u) -g $(id -g) \ - ~browser2 "$ENDPOINT" + sandboxed-browser-mount ) # escape all arguments; is there a better way? diff --git a/sandboxed-browser-mount b/sandboxed-browser-mount @@ -0,0 +1,18 @@ +#!/bin/bash + +# need to create browser2 user +# you may also want to add the local user to the browser2 group + +ENDPOINT="$HOME/mnt/browser2" + +mkdir -p "$ENDPOINT" + +grep -qs " $ENDPOINT " /proc/mounts || ( + echo "$ENDPOINT was not mounted, mounting it" + sudo bindfs --create-for-user=$(id -u browser2) \ + --create-for-group=$(id -g browser2) \ + --chown-deny --chgrp-deny --chmod-deny -p '700' \ + -u $(id -u) -g $(id -g) \ + ~browser2 "$ENDPOINT" +) +