nm4 2010/03/05 16:11:11 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src/auths dovecot.c
Log:
Fix for unknown responses from Dovecot authenticator. Fixes: #954
Revision Changes Path
1.605 +3 -0 exim/exim-doc/doc-txt/ChangeLog
1.12 +12 -24 exim/exim-src/src/auths/dovecot.c
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.604
retrieving revision 1.605
diff -u -r1.604 -r1.605
--- ChangeLog 5 Mar 2010 16:08:15 -0000 1.604
+++ ChangeLog 5 Mar 2010 16:11:11 -0000 1.605
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.604 2010/03/05 16:08:15 nm4 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.605 2010/03/05 16:11:11 nm4 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -18,6 +18,9 @@
NM/03 Bugzilla 955: Documentation fix for max_rcpts.
Patch from Andreas Metzler
+NM/04 Bugzilla 954: Fix for unknown responses from Dovecot authenticator.
+ Patch from Kirill Miazine
+
Exim version 4.71
-----------------
Index: dovecot.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/auths/dovecot.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- dovecot.c 26 Oct 2009 13:18:54 -0000 1.11
+++ dovecot.c 5 Mar 2010 16:11:11 -0000 1.12
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.11 2009/10/26 13:18:54 nm4 Exp $ */
+/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.12 2010/03/05 16:11:11 nm4 Exp $ */
/*
* Copyright (c) 2004 Andrey Panin <pazke@???>
@@ -209,35 +209,23 @@
HDEBUG(D_auth) debug_printf("received: %s\n", buffer);
nargs = strcut(buffer, args, sizeof(args) / sizeof(args[0]));
- switch (toupper(*args[0])) {
- case 'C':
+ /* Code below rewritten by Kirill Miazine (km@???). Only check commands that
+ Exim will need. Original code also failed if Dovecot server sent unknown
+ command. E.g. COOKIE in version 1.1 of the protocol would cause troubles. */
+ if (Ustrcmp(args[0], US"CUID") == 0) {
CHECK_COMMAND("CUID", 1, 1);
cuid = Uatoi(args[1]);
- break;
-
- case 'D':
- CHECK_COMMAND("DONE", 0, 0);
- cont = 0;
- break;
-
- case 'M':
- CHECK_COMMAND("MECH", 1, INT_MAX);
- if (strcmpic(US args[1], ablock->public_name) == 0)
- found = 1;
- break;
-
- case 'S':
- CHECK_COMMAND("SPID", 1, 1);
- break;
-
- case 'V':
+ } else if (Ustrcmp(args[0], US"VERSION") == 0) {
CHECK_COMMAND("VERSION", 2, 2);
if (Uatoi(args[1]) != VERSION_MAJOR)
OUT("authentication socket protocol version mismatch");
- break;
-
- default:
- goto out;
+ } else if (Ustrcmp(args[0], US"MECH") == 0) {
+ CHECK_COMMAND("MECH", 1, INT_MAX);
+ if (strcmpic(US args[1], ablock->public_name) == 0)
+ found = 1;
+ } else if (Ustrcmp(args[0], US"DONE") == 0) {
+ CHECK_COMMAND("DONE", 0, 0);
+ cont = 0;
}
}