Enclose credentials with quotes to escape special characters
Currently, if the admin password contains certain special
characters such as "&", this causes failure on the upgrade
process during data migration. This happens because the upgrade
manifest tries to run a command passing the password as argument
on the CLI and the "&" is interpreted as "run in background" by
the shell instead of as part of the password argument.
This commit encloses the password argument in the failing command
with single quotes, so that special characters are interpreted as
part of the argument string instead of the special effects they
assume on the shell, also single quotes avoid possible variable
expansion when using "$".
Test Plan
PASS: verify that data migration phase completes successfully
with admin password containing "&", "<", ">", "|" and "$"
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/833093 /opendev. org/starlingx/ config/ commit/ 15559ca82b8bb28 6918f1b0069d74c 98c62ba710
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 15559ca82b8bb28 6918f1b0069d74c 98c62ba710
Author: Heitor Matsui <email address hidden>
Date: Thu Mar 10 10:56:43 2022 -0300
Enclose credentials with quotes to escape special characters
Currently, if the admin password contains certain special
characters such as "&", this causes failure on the upgrade
process during data migration. This happens because the upgrade
manifest tries to run a command passing the password as argument
on the CLI and the "&" is interpreted as "run in background" by
the shell instead of as part of the password argument.
This commit encloses the password argument in the failing command
with single quotes, so that special characters are interpreted as
part of the argument string instead of the special effects they
assume on the shell, also single quotes avoid possible variable
expansion when using "$".
Test Plan
PASS: verify that data migration phase completes successfully
with admin password containing "&", "<", ">", "|" and "$"
Closes-bug: 1964478 21f8cad69c9015e 74e3e0ff7ee
Change-Id: Id486490e46ab00
Signed-off-by: Heitor Matsui <email address hidden>