From bb7d3828707bcdba59903fc979b87e3824ac6626 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 31 Oct 2022 11:46:08 -0500 Subject: 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 Change-Id: I41ba9cf451aecd62fb0090d721685da9ce6e2f2e --- .../src/main/resources/mysql/bin/create-guard-table.sh | 2 +- .../src/main/resources/postgres/bin/create-guard-table-pg.sh | 2 +- 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 -- cgit 1.2.3-korg