fix(ctl): hash passwords with special characters correctly

The password was expanded before eval and parsed again as shell code,
so spaces, $ or ; changed the hashed value or ran extra commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bertrand Gouny
2026-10-13 22:06:15 +02:00
co-authored by Claude Opus 5.5
parent a762bda77d
commit 52b2918ea8
@@ -19,10 +19,9 @@ hash() {
if [ -z "${password}" ]; then
container log fatal "Missing password argument"
exit 1
fi
eval "${OPENLDAP_CTL_PASSWORD_HASH_CMD}" -s "${password}"
eval "${OPENLDAP_CTL_PASSWORD_HASH_CMD}"' -s "${password}"'
}
usage() {