summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-08-13 12:39:40 -0300
committerTomás Touceda <chiiph@leap.se>2013-08-13 12:39:40 -0300
commit518b79bd19fc00b6509b6cb7868a385497deb494 (patch)
treed5f2a03105dde6550063d793bc93cf2bb63d7ede
parent8c6e5995ef9d21c9993cbdd9a2bc0bb0dc52d65c (diff)
parent0f96314e14f26c2a4aeebba90b4896edaff745e5 (diff)
Merge remote-tracking branch 'kali/bug/3416_do_not_log_pass' into develop
-rw-r--r--changes/bug_3416-do-not-log-pass1
-rw-r--r--src/leap/mail/imap/server.py4
-rw-r--r--src/leap/mail/imap/service/imap.py10
3 files changed, 14 insertions, 1 deletions
diff --git a/changes/bug_3416-do-not-log-pass b/changes/bug_3416-do-not-log-pass
new file mode 100644
index 0000000..137b7a3
--- /dev/null
+++ b/changes/bug_3416-do-not-log-pass
@@ -0,0 +1 @@
+ o Avoid logging dummy password on imap server. Closes: #3416
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py
index 813d850..51df86e 100644
--- a/src/leap/mail/imap/server.py
+++ b/src/leap/mail/imap/server.py
@@ -121,6 +121,9 @@ class IndexedDB(object):
leap_assert_type(self.INDEXES, dict)
# Ask the database for currently existing indexes.
+ if not self._soledad:
+ logger.debug("NO SOLEDAD ON IMAP INITIALIZATION")
+ return
db_indexes = dict(self._soledad.list_indexes())
for name, expression in SoledadBackedAccount.INDEXES.items():
if name not in db_indexes:
@@ -788,6 +791,7 @@ class LeapMessage(WithMsgFields):
"""
return self._doc.content.get(key, None)
+
class MessageCollection(WithMsgFields, IndexedDB):
"""
A collection of messages, surprisingly.
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py
index a4ffed6..1a8c15c 100644
--- a/src/leap/mail/imap/service/imap.py
+++ b/src/leap/mail/imap/service/imap.py
@@ -17,6 +17,8 @@
"""
Imap service initialization
"""
+from copy import copy
+
import logging
logger = logging.getLogger(__name__)
@@ -71,7 +73,13 @@ class LeapIMAPServer(imap4.IMAP4Server):
#self.theAccount = theAccount
def lineReceived(self, line):
- log.msg('rcv: %s' % line)
+ if "login" in line:
+ # avoid to log the pass, even though we are using a dummy auth
+ # by now.
+ msg = line[:7] + " [...]"
+ else:
+ msg = copy(line)
+ log.msg('rcv: %s' % msg)
imap4.IMAP4Server.lineReceived(self, line)
def authenticateLogin(self, username, password):