Bug 40901: (QA follow-up) Quote path/option values in koha-generate-env env files

systemd EnvironmentFile parsing treats unquoted values as ending at the
first whitespace.  PLACK_PSGIFILE and Z3950_CONFIGDIR are paths that
could in principle contain spaces; Z3950_ADDITIONAL_OPTS routinely holds
multiple flags separated by spaces (e.g. "--port 9999 --verbose").

Wrap these three values in double-quotes in the generated env file so
systemd reads the full value even when it contains spaces.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-05-22 07:26:12 +01:00 committed by Pedro Amorim
parent 6d3b026d91
commit 868947cb55
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ case "$SERVICE" in
PLACK_WORKERS=${WORKERS:-2}
PLACK_MAX_REQUESTS=${MAX_REQUESTS:-50}
PLACK_ENVIRONMENT=${ENVIRONMENT}
PLACK_PSGIFILE=${PSGIFILE}
PLACK_PSGIFILE="${PSGIFILE}"
EOF
;;
@ -104,8 +104,8 @@ EOF
fi
cat > "$ENVFILE" <<EOF
Z3950_CONFIGDIR=${CONFIGDIR}
Z3950_ADDITIONAL_OPTS=${Z3950_OPTS}
Z3950_CONFIGDIR="${CONFIGDIR}"
Z3950_ADDITIONAL_OPTS="${Z3950_OPTS}"
EOF
;;
esac