Skip to content
Snippets Groups Projects
Commit 2ffd118e authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

_v2-entry-point: Unset LD_PRELOAD before calling external commands


LD_PRELOAD usually contains libraries such as gameoverlayrenderer.so
that can throw a warning if we try to preload them without adjusting
them first.

For this reason we unset LD_PRELOAD and pass its values as arguments for
pressure-vessel-wrap, that will adjust them before launching the
requested program/game.

A similar thing was already done in pressure-vessel-unruntime, but we
should do it at the very first opportunity to avoid preloading warnings
every time we launch an external command.

Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent 75d3322e
No related branches found
No related tags found
1 merge request!60_v2-entry-point: Unset LD_PRELOAD before calling external commands
Pipeline #15176 passed
...@@ -15,6 +15,17 @@ log_to_file= ...@@ -15,6 +15,17 @@ log_to_file=
log_dir=${STEAM_LINUX_RUNTIME_LOG_DIR-"${PRESSURE_VESSEL_VARIABLE_DIR-"${here}/var"}"} log_dir=${STEAM_LINUX_RUNTIME_LOG_DIR-"${PRESSURE_VESSEL_VARIABLE_DIR-"${here}/var"}"}
keep_logs= keep_logs=
use_timestamp= use_timestamp=
ld_preload=
# Arguments for pressure-vessel-wrap
declare -a container_args=()
if [ -n "${LD_PRELOAD-}" ]; then
container_args+=("--env-if-host=LD_PRELOAD=$LD_PRELOAD")
ld_preload="$LD_PRELOAD"
fi
unset LD_PRELOAD
if [ "${STEAM_LINUX_RUNTIME_VERBOSE-}" = 1 ]; then if [ "${STEAM_LINUX_RUNTIME_VERBOSE-}" = 1 ]; then
verbose=yes verbose=yes
...@@ -33,7 +44,7 @@ fi ...@@ -33,7 +44,7 @@ fi
log () { log () {
if [ -n "$use_timestamp" ]; then if [ -n "$use_timestamp" ]; then
timestamp=$(LD_PRELOAD='' date +'%H:%M:%S.%6N') timestamp=$(date +'%H:%M:%S.%6N')
printf '%s\n' "${timestamp}: ${me}[$$]: $*" >&2 printf '%s\n' "${timestamp}: ${me}[$$]: $*" >&2
else else
printf '%s\n' "${me}[$$]: $*" >&2 printf '%s\n' "${me}[$$]: $*" >&2
...@@ -287,14 +298,18 @@ case "${STEAM_RUNTIME-}" in ...@@ -287,14 +298,18 @@ case "${STEAM_RUNTIME-}" in
;; ;;
esac esac
old_IFS="$IFS"
IFS=":"
for word in $ld_preload; do
container_args+=("--ld-preload=$word")
done
IFS="$old_IFS"
unset LD_LIBRARY_PATH unset LD_LIBRARY_PATH
unset STEAM_RUNTIME unset STEAM_RUNTIME
pressure_vessel="${PRESSURE_VESSEL_PREFIX:-"${here}/pressure-vessel"}" pressure_vessel="${PRESSURE_VESSEL_PREFIX:-"${here}/pressure-vessel"}"
# Arguments for pressure-vessel-wrap, currently none
declare -a container_args=()
if [ -z "${suite}" ]; then if [ -z "${suite}" ]; then
run=run run=run
else else
...@@ -387,7 +402,6 @@ fi ...@@ -387,7 +402,6 @@ fi
--lock-file "${rendezvous}/.ref" \ --lock-file "${rendezvous}/.ref" \
-- \ -- \
env \ env \
-u LD_PRELOAD \
-u FONTCONFIG_PATH \ -u FONTCONFIG_PATH \
-u SteamLauncherUI \ -u SteamLauncherUI \
-u SteamAppId \ -u SteamAppId \
...@@ -432,7 +446,6 @@ if [ -n "$is_main" ]; then ...@@ -432,7 +446,6 @@ if [ -n "$is_main" ]; then
else else
launch_args=( \ launch_args=( \
${launch_args[0]+"${launch_args[@]}"} \ ${launch_args[0]+"${launch_args[@]}"} \
--unset-env LD_PRELOAD \
) )
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment