~ubuntu-branches/ubuntu/precise/exim4/precise-security

« back to all changes in this revision

Viewing changes to src/auths/dovecot.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-07-25 02:00:42 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100725020042-bk1uw1p7ysmnsn9f
Tags: 4.72-1ubuntu1
* Merge with Debian unstable (LP: #609620). Remaining changes:
  + debian/patches/71_exiq_grep_error_on_messages_without_size.dpatch:
    Improve handling of broken messages when "exim4 -bp" (mailq) reports
    lines without size info.
  + Don't declare a Provides: default-mta; in Ubuntu, we want postfix to be
    the default.
  + debian/control: Change build dependencies to MySQL 5.1.
  + debian/{control,rules}: add and enable hardened build for PIE
    (Closes: #542726).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.11 2009/10/26 13:18:54 nm4 Exp $ */
 
1
/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.12 2010/03/05 16:11:11 nm4 Exp $ */
2
2
 
3
3
/*
4
4
 * Copyright (c) 2004 Andrey Panin <pazke@donpac.ru>
209
209
               HDEBUG(D_auth) debug_printf("received: %s\n", buffer);
210
210
               nargs = strcut(buffer, args, sizeof(args) / sizeof(args[0]));
211
211
 
212
 
               switch (toupper(*args[0])) {
213
 
               case 'C':
 
212
               /* Code below rewritten by Kirill Miazine (km@krot.org). Only check commands that
 
213
                  Exim will need. Original code also failed if Dovecot server sent unknown
 
214
                  command. E.g. COOKIE in version 1.1 of the protocol would cause troubles. */
 
215
               if (Ustrcmp(args[0], US"CUID") == 0) {
214
216
                       CHECK_COMMAND("CUID", 1, 1);
215
217
                       cuid = Uatoi(args[1]);
216
 
                       break;
217
 
 
218
 
               case 'D':
219
 
                       CHECK_COMMAND("DONE", 0, 0);
220
 
                       cont = 0;
221
 
                       break;
222
 
 
223
 
               case 'M':
 
218
               } else if (Ustrcmp(args[0], US"VERSION") == 0) {
 
219
                       CHECK_COMMAND("VERSION", 2, 2);
 
220
                       if (Uatoi(args[1]) != VERSION_MAJOR)
 
221
                               OUT("authentication socket protocol version mismatch");
 
222
               } else if (Ustrcmp(args[0], US"MECH") == 0) {
224
223
                       CHECK_COMMAND("MECH", 1, INT_MAX);
225
224
                       if (strcmpic(US args[1], ablock->public_name) == 0)
226
225
                               found = 1;
227
 
                       break;
228
 
 
229
 
               case 'S':
230
 
                       CHECK_COMMAND("SPID", 1, 1);
231
 
                       break;
232
 
 
233
 
               case 'V':
234
 
                       CHECK_COMMAND("VERSION", 2, 2);
235
 
                       if (Uatoi(args[1]) != VERSION_MAJOR)
236
 
                               OUT("authentication socket protocol version mismatch");
237
 
                       break;
238
 
 
239
 
               default:
240
 
                       goto out;
 
226
               } else if (Ustrcmp(args[0], US"DONE") == 0) {
 
227
                       CHECK_COMMAND("DONE", 0, 0);
 
228
                       cont = 0;
241
229
               }
242
230
       }
243
231