summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2022-10-31 11:46:08 -0500
committerJorge Hernandez <jorge.hernandez-herrero@att.com>2022-11-01 17:34:02 +0000
commit5c76c5003d38b8300eafd517be49ceece46e38b1 (patch)
tree2a3d5e0e40c587b9ea2c8e0e7a30155e2d562202 /packages
parent62903aced60d382c1c0dd1ee2a7008d965ed7ca9 (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 (cherry picked from commit bb7d3828707bcdba59903fc979b87e3824ac6626)
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