In both cases, the value of debuglevel is wrongly used: the debug string
is printed only if debuglevel is below IMAP_LOG_PASS or
MUTT_SOCK_LOG_FULL. But the debug is supposed to be more verbose as
debuglevel increases.

To fix that, comparisons with debuglevel are removed, and we just rely
on the debug level passed as the first parameter of dprint.
---
 imap/auth_login.c | 8 ++------
 pop_auth.c        | 7 +------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/imap/auth_login.c b/imap/auth_login.c
index 3e40d4d..83c0932 100644
--- a/imap/auth_login.c
+++ b/imap/auth_login.c
@@ -50,12 +50,8 @@ imap_auth_res_t imap_auth_login (IMAP_DATA* idata, const 
char* method)
   imap_quote_string (q_pass, sizeof (q_pass), idata->conn->account.pass);
 
 #ifdef DEBUG
-  /* don't print the password unless we're at the ungodly debugging level
-   * of 5 or higher */
-
-  if (debuglevel < IMAP_LOG_PASS)
-    dprint (2, (debugfile, "Sending LOGIN command for %s...\n",
-      idata->conn->account.user));
+  dprint (2, (debugfile, "Sending LOGIN command for %s...\n",
+          idata->conn->account.user));
 #endif
 
   snprintf (buf, sizeof (buf), "LOGIN %s %s", q_user, q_pass);
diff --git a/pop_auth.c b/pop_auth.c
index 8d8650e..8619735 100644
--- a/pop_auth.c
+++ b/pop_auth.c
@@ -270,12 +270,7 @@ static pop_auth_res_t pop_auth_user (POP_DATA *pop_data, 
const char *method)
   if (ret == 0)
   {
     snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
-    ret = pop_query_d (pop_data, buf, sizeof (buf), 
-#ifdef DEBUG
-       /* don't print the password unless we're at the ungodly debugging level 
*/
-       debuglevel < MUTT_SOCK_LOG_FULL ? "PASS *\r\n" :
-#endif
-       NULL);
+    ret = pop_query_d (pop_data, buf, sizeof (buf), "PASS *\r\n"); 
   }
 
   switch (ret)
-- 
2.9.0

Reply via email to