aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2022-10-31 11:46:08 -0500
committerjhh <jorge.hernandez-herrero@att.com>2022-10-31 11:46:08 -0500
commitbb7d3828707bcdba59903fc979b87e3824ac6626 (patch)
tree941e5948471f995595ef0002f6f0f9959f55afaa /packages
parentba8849bf2b20c3aecacfca2a5c614bb07dcfb0b9 (diff)
Fix mishandling of special characters in passwords
OperationsHistory creation is skipped in OOM settings since cannot process passwords with containing "=". Issue-ID: POLICY-4429 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I41ba9cf451aecd62fb0090d721685da9ce6e2f2e
Diffstat (limited to 'packages')
-rw-r--r--packages/policy-xacmlpdp-tarball/src/main/resources/mysql/bin/create-guard-table.sh2
-rw-r--r--packages/policy-xacmlpdp-tarball/src/main/resources/postgres/bin/create-guard-table-pg.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/mysql/bin/create-guard-table.sh b/packages/policy-xacmlpdp-tarball/src/main/resources/mysql/bin/create-guard-table.sh
index 85350c46..33e67977 100644
--- a/packages/policy-xacmlpdp-tarball/src/main/resources/mysql/bin/create-guard-table.sh
+++ b/packages/policy-xacmlpdp-tarball/src/main/resources/mysql/bin/create-guard-table.sh
@@ -38,7 +38,7 @@ fi
# Extract Maria DB Credential properties from xacml.properties file
DB_HOSTNAME=$(awk -F[/:] '$1 == "javax.persistence.jdbc.url=jdbc" { print $3 $5 }' /tmp/temp.xacml.properties)
DB_USERNAME=$(awk -F= '$1 == "javax.persistence.jdbc.user" { print $2 }' /tmp/temp.xacml.properties)
-DB_PASSWORD=$(awk -F= '$1 == "javax.persistence.jdbc.password" { print $2 }' /tmp/temp.xacml.properties)
+DB_PASSWORD=$(awk -F= '$1 == "javax.persistence.jdbc.password" { st = index($0,"="); print substr($0,st+1) }' /tmp/temp.properties)
# Remove temp file
rm /tmp/temp.xacml.properties
diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/postgres/bin/create-guard-table-pg.sh b/packages/policy-xacmlpdp-tarball/src/main/resources/postgres/bin/create-guard-table-pg.sh
index bb2f2034..b8fba4ed 100644
--- a/packages/policy-xacmlpdp-tarball/src/main/resources/postgres/bin/create-guard-table-pg.sh
+++ b/packages/policy-xacmlpdp-tarball/src/main/resources/postgres/bin/create-guard-table-pg.sh
@@ -37,7 +37,7 @@ fi
# Extract Maria DB Credential properties from xacml.properties file
DB_HOSTNAME=$(awk -F[/:] '$1 == "javax.persistence.jdbc.url=jdbc" { print $3 $5 }' /tmp/temp.xacml-pg.properties)
DB_USERNAME=$(awk -F= '$1 == "javax.persistence.jdbc.user" { print $2 }' /tmp/temp.xacml-pg.properties)
-DB_PASSWORD=$(awk -F= '$1 == "javax.persistence.jdbc.password" { print $2 }' /tmp/temp.xacml-pg.properties)
+DB_PASSWORD=$(awk -F= '$1 == "javax.persistence.jdbc.password" { st = index($0,"="); print substr($0,st+1) }' /tmp/temp.properties)
# Remove temp file
rm /tmp/temp.xacml-pg.properties