Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: do not allow special characters in database 
password
......................................................................

packaging: setup: do not allow special characters in database password

jasper build system is a mess in this regard, there is no consistent
escaping that can be added.

Change-Id: I0b48a282368e4cb936d912ca2e5163e6497e1890
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M packaging/legacy-setup/ovirt-engine-reports-setup.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/17/23417/1

diff --git a/packaging/legacy-setup/ovirt-engine-reports-setup.py 
b/packaging/legacy-setup/ovirt-engine-reports-setup.py
index f96078f..d0dcee3 100755
--- a/packaging/legacy-setup/ovirt-engine-reports-setup.py
+++ b/packaging/legacy-setup/ovirt-engine-reports-setup.py
@@ -331,6 +331,13 @@
     if not db_dict['password']:
         raise OSError("Cannot find password for db")
 
+    # jasper build system places password in property file
+    # sometime with escape and sometime without
+    # do not allow special characters of property files
+    for c in db_dict['password']:
+        if c in ':=\\ $':
+            raise OSError("Database password contains charecters that are not 
supported by jasper")
+
     fd, f = tempfile.mkstemp()
     os.close(fd)
 
@@ -348,7 +355,7 @@
             '@REPORTS_DB_HOST@': db_dict["host"],
             '@REPORTS_DB_PORT@': db_dict["port"],
             '@REPORTS_DB_USER@': db_dict["username"],
-            '@REPORTS_DB_PASSWORD@': db_dict["password"].replace("$", "$$"),
+            '@REPORTS_DB_PASSWORD@': db_dict["password"],
         },
     )
 


-- 
To view, visit http://gerrit.ovirt.org/23417
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b48a282368e4cb936d912ca2e5163e6497e1890
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to