2019-10-04 21:04:37 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
(
|
|
|
|
exec bwrap \
|
2020-08-31 13:10:03 +02:00
|
|
|
--ro-bind /usr/bin/vlc /usr/bin/vlc \
|
2019-10-04 21:04:37 +02:00
|
|
|
--ro-bind /usr/share /usr/share \
|
|
|
|
--ro-bind /usr/lib /usr/lib \
|
|
|
|
--ro-bind /usr/lib64 /usr/lib64 \
|
|
|
|
--symlink /usr/lib64 /lib64 \
|
|
|
|
--symlink /usr/bin /bin \
|
|
|
|
--proc /proc \
|
|
|
|
--dev-bind /dev /dev \
|
|
|
|
--ro-bind /tmp/.X11-unix /tmp/.X11-unix \
|
|
|
|
--ro-bind /etc /etc \
|
2020-08-31 13:10:03 +02:00
|
|
|
--ro-bind ~/.config/vlc ~/.config/vlc \
|
|
|
|
--ro-bind "${@: -1}" ~/"$(basename "${@: -1}")" \
|
|
|
|
--chdir ~/ \
|
2019-10-04 21:04:37 +02:00
|
|
|
--unsetenv DBUS_SESSION_BUS_ADDRESS \
|
2020-08-31 13:10:03 +02:00
|
|
|
--unshare-user-try \
|
2019-10-04 21:04:37 +02:00
|
|
|
--unshare-pid \
|
|
|
|
--unshare-net \
|
|
|
|
--unshare-uts \
|
2020-08-31 13:10:03 +02:00
|
|
|
--unshare-cgroup-try \
|
2019-10-04 21:04:37 +02:00
|
|
|
--new-session \
|
|
|
|
--seccomp 10 \
|
|
|
|
10< /usr/local/bin/seccomp_default_filter.bpf \
|
2020-08-31 13:10:03 +02:00
|
|
|
/usr/bin/vlc "$(basename "${@: -1}")"
|
2019-10-04 21:04:37 +02:00
|
|
|
)
|
2020-08-31 13:10:03 +02:00
|
|
|
|
|
|
|
# warning: still uses read-only X11 socket
|