iceweasel-uxp-private.bash 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. set -euo pipefail
  3. (exec bwrap \
  4. --proc /proc \
  5. --dev /dev \
  6. --tmpfs /tmp \
  7. --dev-bind /dev/dri /dev/dri \
  8. --dev-bind /dev/snd /dev/snd \
  9. --ro-bind /etc/fonts /etc/fonts \
  10. --ro-bind /etc/ssl/certs /etc/ssl/certs \
  11. --ro-bind /etc/resolv.conf /etc/resolv.conf \
  12. --ro-bind /lib /lib \
  13. --ro-bind /lib64 /lib64 \
  14. --ro-bind /sys/dev/char /sys/dev/char \
  15. --ro-bind /sys/devices /sys/devices \
  16. --ro-bind /usr/bin /usr/bin \
  17. --ro-bind /usr/include/fontconfig /usr/include/fontconfig \
  18. --ro-bind /usr/lib /usr/lib \
  19. --ro-bind /usr/lib64 /usr/lib64 \
  20. --ro-bind /usr/share/alsa /usr/share/alsa \
  21. --ro-bind /usr/share/applications /usr/share/applications \
  22. --ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
  23. --ro-bind /usr/share/fonts /usr/share/fonts \
  24. --ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
  25. --ro-bind /usr/share/icons /usr/share/icons \
  26. --ro-bind /usr/share/libdrm /usr/share/libdrm \
  27. --ro-bind /usr/share/mime /usr/share/mime \
  28. --ro-bind /usr/share/X11/xkb /usr/share/X11/xkb \
  29. --ro-bind /var/cache/fontconfig /var/cache/fontconfig \
  30. --ro-bind /var/lib/alsa /var/lib/alsa \
  31. --bind-try /tmp/sndio /tmp/sndio \
  32. --bind-try /tmp/sndio-"$(id -u)" /tmp/sndio-"$(id -u)" \
  33. --bind-try "${HOME}/.sndio" "${HOME}/.sndio" \
  34. --bind "$(xdg-user-dir DOWNLOAD)" "$(xdg-user-dir DOWNLOAD)" \
  35. --chdir "${HOME}" \
  36. --unshare-all \
  37. --share-net \
  38. --die-with-parent \
  39. --hostname RESTRICTED \
  40. --setenv SHELL /bin/false \
  41. --setenv PATH /usr/bin \
  42. --file 11 /etc/passwd \
  43. --file 12 /etc/group \
  44. --new-session \
  45. /usr/bin/iceweasel-uxp) \
  46. 11< <(getent passwd $UID 65534 audio) \
  47. 12< <(getent group "$(id -g)" 65534 audio)
  48. # note: running iceweasel-uxp on private mode sanbox