Created
December 5, 2016 14:40
-
-
Save mrdomino/9d16947229cd50c7ef0ef045fbc769a4 to your computer and use it in GitHub Desktop.
run firefox as a separate user in openbsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
tmpfile=$(mktemp) | |
xauth -q -f $tmpfile generate $DISPLAY . untrusted | |
xauth_data=$(xauth -f $tmpfile nlist $DISPLAY) | |
rm -f $tmpfile | |
DOAS_XAUTH="xauth -q remove $DISPLAY ; echo $xauth_data | xauth nmerge - ;" | |
export DOAS_XAUTH | |
doas -u firefox sh -c 'export HOME=/home/firefox ; eval $DOAS_XAUTH ; unset DOAS_XAUTH ; /usr/local/bin/firefox' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment