backend/server/rhnSQL/__init__.py | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit cf722531cf89fb6f1c04b63f0dcb3ae4190e0df6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 3 13:34:46 2011 +0100
hide cleartext password from traceback
diff --git a/backend/server/rhnSQL/__init__.py b/backend/server/rhnSQL/__init__.py
index ebc0880..29fd23f 100644
--- a/backend/server/rhnSQL/__init__.py
+++ b/backend/server/rhnSQL/__init__.py
@@ -94,6 +94,7 @@ def initDB(dsn=None, backend=None, host="localhost",
port=None, username=None,
# the code in a uniform fashion for all database backends:
(username, temp) = dsn.split("/")
(password, database) = temp.split("@")
+ del temp
if backend == POSTGRESQL:
host = None
@@ -101,6 +102,7 @@ def initDB(dsn=None, backend=None, host="localhost",
port=None, username=None,
dsn = CFG.DEFAULT_DB
(username, temp) = dsn.split("/")
(password, dsn) = temp.split("@")
+ del temp
for i in dsn.split(';'):
(k, v) = i.split('=')
if k == 'dbname':
@@ -114,6 +116,7 @@ def initDB(dsn=None, backend=None, host="localhost",
port=None, username=None,
# Hide the password
add_to_seclist(dsn)
+ add_to_seclist(password)
try:
__init__DB(backend, host, port, username, password, database)
# except (rhnException, SQLError):
Show replies by date