From 4195370e9a4915b338962f7035feda9f0a7c430b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 11 Feb 2001 05:41:31 +0000 Subject: Try to get around the CRAM-MD5 bug. svn path=/trunk/; revision=3044 --- cram.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'cram.c') diff --git a/cram.c b/cram.c index ae8800d1..fb908832 100644 --- a/cram.c +++ b/cram.c @@ -129,22 +129,13 @@ int do_cram_md5 (int sock, struct query *ctl) report (stdout, "CRAM> %s\n", buf1); } + /* ship the authentication back, accept the server's responses */ /* PMDF5.2 IMAP has a bug that requires this to be a single write */ - strcat (buf1, "\r\n"); - SockWrite (sock, buf1, strlen (buf1)); - - if ((result = gen_recv (sock, buf1, sizeof (buf1)))) - return result; - - /* - * Ugh. This has to recognize all kinds of success lines. - * These two tests will catch IMAP and POP OK or SMTP-like - * protocols that use 2xx as a success indication. - */ - if (buf1[0] = '2' || strstr(buf1, "OK")) + result = gen_transact(sock, buf1, sizeof(buf1)); + if (result) + return(result); + else return(PS_SUCCESS); - else - return(PS_AUTHFAIL); } /* cram.c ends here */ -- cgit v1.2.3