Skip to contentSkip to conversation

imap-send: suppress warning about cleartext password with CRAM-MD5

PATCH In review Chris Webb 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Chris Webb

author
#0 lore raw

PATCH 1/1 imap-send: suppress warning about cleartext password with CRAM-MD5

If a CRAM-MD5 challenge-response is used to authenticate to the IMAP server, git imap-send shouldn't warn about the password being sent in the clear.

---
 imap-send.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
imap-send.c +3 -3
index aeb2985..7107923 100644
@@ -1226,9 +1226,6 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
 			fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
 			goto bail;
 		}
-		if (!imap->buf.sock.ssl)
-			imap_warn("*** IMAP Warning *** Password is being "
-				  "sent in the clear\n");
 
 		if (srvc->auth_method) {
 			struct imap_cmd_cb cb;
@@ -1253,6 +1250,9 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
 				goto bail;
 			}
 		} else {
+			if (!imap->buf.sock.ssl)
+				imap_warn("*** IMAP Warning *** Password is being "
+					  "sent in the clear\n");
 			if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
 				fprintf(stderr, "IMAP error: LOGIN failed\n");
 				goto bail;
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 5 lines · Chris Webb

If a CRAM-MD5 challenge-response is used to authenticate to the IMAP server, git imap-send shouldn't warn about the password being sent in the clear.

---

Makes sense. Thanks.

Quoted 29 lines
 imap-send.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
imap-send.c +3 -3
index aeb2985..7107923 100644
@@ -1226,9 +1226,6 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
 			fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
 			goto bail;
 		}
-		if (!imap->buf.sock.ssl)
-			imap_warn("*** IMAP Warning *** Password is being "
-				  "sent in the clear\n");
 
 		if (srvc->auth_method) {
 			struct imap_cmd_cb cb;
@@ -1253,6 +1250,9 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
 				goto bail;
 			}
 		} else {
+			if (!imap->buf.sock.ssl)
+				imap_warn("*** IMAP Warning *** Password is being "
+					  "sent in the clear\n");
 			if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
 				fprintf(stderr, "IMAP error: LOGIN failed\n");
 				goto bail;
Signature · 1 line
1.7.0.1
#2 lore raw
Quoted 25 lines · Junio C Hamano
Quoted 5 lines · Chris Webb

If a CRAM-MD5 challenge-response is used to authenticate to the IMAP server, git imap-send shouldn't warn about the password being sent in the clear.

---

Makes sense. Thanks.

Quoted 15 lines
  imap-send.c |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
imap-send.c +0 -3
index aeb2985..7107923 100644
@@ -1226,9 +1226,6 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
  			fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
  			goto bail;
  		}
-		if (!imap->buf.sock.ssl)
-			imap_warn("*** IMAP Warning *** Password is being "
-				  "sent in the clear\n");
 
Quoted 15 lines
Quoted 13 lines
imap-send.c +3 -1
  		if (srvc->auth_method) {
  			struct imap_cmd_cb cb;
@@ -1253,6 +1250,9 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
  				goto bail;
  			}
  		} else {
+			if (!imap->buf.sock.ssl)
+				imap_warn("*** IMAP Warning *** Password is being "
+					  "sent in the clear\n");
  			if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
  				fprintf(stderr, "IMAP error: LOGIN failed\n");
  				goto bail;
--
Quoted 1 line

1.7.0.1

Thanks Chris, this was my mistake.
And thanks for your notify, Junio.

Hitoshi