Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: Fail if db credentials contain quotes
......................................................................

packaging: setup: Fail if db credentials contain quotes

Bug-Url: https://bugzilla.redhat.com/1052202
Change-Id: Id385fd2dc8c84c165289835a2724988ea320aa19
Signed-off-by: Yedidyah Bar David <d...@redhat.com>
---
M packaging/ovirt-engine-dwh-setup.py
1 file changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/54/24454/1

diff --git a/packaging/ovirt-engine-dwh-setup.py 
b/packaging/ovirt-engine-dwh-setup.py
index 690b3df..bb68cd5 100755
--- a/packaging/ovirt-engine-dwh-setup.py
+++ b/packaging/ovirt-engine-dwh-setup.py
@@ -272,7 +272,19 @@
             ):
                 s = handler.getParam(v)
                 if s is not None:
-                    db_dict[k] = s.strip('"')
+                    if s[0]=='"' and s[-1]=='"':
+                        s = s[1:-1]
+                    if '"' in s:
+                        logging.debug(
+                            'disallowed quotes: {file}:{param}'.format(
+                                file=file,
+                                param=v,
+                            )
+                        )
+                        msg = 'double quotes are not allowed in db credentials'
+                        print msg
+                        raise RuntimeError(msg)
+                    db_dict[k] = s
             handler.close()
 
     return db_dict


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id385fd2dc8c84c165289835a2724988ea320aa19
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-dwh
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to