Alex Lourie has uploaded a new change for review.

Change subject: packaging: Do not allow using ' in passwords
......................................................................

packaging: Do not allow using ' in passwords

Added a check to password validator that denies using
a ' character in password answers.

Change-Id: I7fa3cf2e17ff8f5da670f901da7c681b8be86e8c
Signed-off-by: Alex Lourie <alou...@redhat.com>
---
M packaging/fedora/setup/engine_validators.py
M packaging/fedora/setup/output_messages.py
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/23/8723/1

diff --git a/packaging/fedora/setup/engine_validators.py 
b/packaging/fedora/setup/engine_validators.py
index 9090e1c..67d011c 100644
--- a/packaging/fedora/setup/engine_validators.py
+++ b/packaging/fedora/setup/engine_validators.py
@@ -161,6 +161,10 @@
     logging.debug("Validating password")
     if not validateStringNotEmpty(param, options):
         return False
+    if "'" in param:
+        logging.error(output_messages.ERR_NOT_ALLOWED_CHAR)
+        print output_messages.ERR_NOT_ALLOWED_CHAR
+        return False
     if re.search("\s", param):
         logging.error(output_messages.ERR_SPACES_IN_PASS)
         print output_messages.ERR_SPACES_IN_PASS
diff --git a/packaging/fedora/setup/output_messages.py 
b/packaging/fedora/setup/output_messages.py
index ecca950..ef44546 100644
--- a/packaging/fedora/setup/output_messages.py
+++ b/packaging/fedora/setup/output_messages.py
@@ -428,3 +428,5 @@
 
 # passwords errors
 ERR_SPACES_IN_PASS = "Error: White spaces are not allowed in passwords"
+ERR_NOT_ALLOWED_CHAR = "Error: The following characters are not allowed in 
passwords:\n'\n\
+Please create a password without these characters"


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fa3cf2e17ff8f5da670f901da7c681b8be86e8c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <alou...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to