Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #18579: The repo password should be urlencoded on all sles base systems #644

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions scripts/rudder-setup/add-repo.sh
Expand Up @@ -19,14 +19,18 @@ add_repo() {
else
S=""
fi


# On sles we need to urlencode the password or if it contains special chars it won't be able to
# add the repo
if [ "${PM}" = "zypper" ]; then
DOWNLOAD_PASSWORD=$(echo "${DOWNLOAD_PASSWORD}" | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g')
fi

if [ "${DOWNLOAD_USER}" = "" ]; then
USER=""
else
USER="${DOWNLOAD_USER}:${DOWNLOAD_PASSWORD}@"
if [ "${PM}" = "zypper" ] && [ "${OS_VERSION}" -le "12" ] ; then
URLENCODED_PASSWORD=$(echo "${DOWNLOAD_PASSWORD}" | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g')
USER="${DOWNLOAD_USER}:${URLENCODED_PASSWORD}@"
fi
fi

if [ "${USE_CI}" = "yes" ]
Expand Down