From 19fe925c31160d4fdb5ced8c8c1e137af72b1786 Mon Sep 17 00:00:00 2001 From: Root <175176948+RKNF404@users.noreply.github.com> Date: Thu, 3 Apr 2025 20:10:40 -0400 Subject: [PATCH] fix: only bind ld.so.preload if it exists --- build/trivalent.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/trivalent.sh b/build/trivalent.sh index eacbc371..c6d9d123 100755 --- a/build/trivalent.sh +++ b/build/trivalent.sh @@ -82,4 +82,9 @@ exec < /dev/null exec > >(exec cat) exec 2> >(exec cat >&2) -exec /usr/bin/bwrap --dev-bind / / --ro-bind /dev/null /etc/ld.so.preload "$HERE/$CHROMIUM_NAME" $CHROMIUM_FLAGS "$@" +BWRAP_ARGS="--dev-bind / /" +if [ -f "/etc/ld.so.preload" ]; then + BWRAP_ARGS+=" --ro-bind /dev/null /etc/ld.so.preload" +fi + +exec /usr/bin/bwrap $BWRAP_ARGS "$HERE/$CHROMIUM_NAME" $CHROMIUM_FLAGS "$@"