~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/lib-storage/index/mbox/mbox-sync-parse.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2004-2011 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2004-2012 Dovecot authors, see the included COPYING file */
2
2
 
3
3
/* MD5 header summing logic was pretty much copy&pasted from popa3d by
4
4
   Solar Designer */
468
468
        ctx->content_length = (uoff_t)-1;
469
469
        str_truncate(ctx->header, 0);
470
470
 
471
 
        mbox_md5_ctx = mbox_md5_init();
 
471
        mbox_md5_ctx = ctx->sync_ctx->mbox->md5_v.init();
472
472
 
473
473
        line_start_pos = 0;
474
474
        hdr_ctx = message_parse_header_init(input, NULL, 0);
507
507
                        buffer_append(ctx->header, hdr->full_value,
508
508
                                      hdr->full_value_len);
509
509
                } else {
510
 
                        mbox_md5_continue(mbox_md5_ctx, hdr);
 
510
                        ctx->sync_ctx->mbox->md5_v.more(mbox_md5_ctx, hdr);
511
511
                        buffer_append(ctx->header, hdr->value,
512
512
                                      hdr->value_len);
513
513
                }
520
520
        i_assert(ret != 0);
521
521
        message_parse_header_deinit(&hdr_ctx);
522
522
 
523
 
        mbox_md5_finish(mbox_md5_ctx, ctx->hdr_md5_sum);
 
523
        ctx->sync_ctx->mbox->md5_v.finish(mbox_md5_ctx, ctx->hdr_md5_sum);
524
524
 
525
525
        if ((ctx->seq == 1 && !ctx->seen_imapbase) ||
526
526
            (ctx->seq > 1 && sync_ctx->dest_first_mail)) {
559
559
 
560
560
        mail_index_lookup_uid(view, seq, &uid);
561
561
        memset(&ctx, 0, sizeof(ctx));
562
 
        mbox_md5_ctx = mbox_md5_init();
 
562
        mbox_md5_ctx = mbox->md5_v.init();
563
563
 
564
564
        hdr_ctx = message_parse_header_init(mbox->mbox_stream, NULL, 0);
565
565
        while ((ret = message_parse_header_next(hdr_ctx, &hdr)) > 0) {
581
581
                                        break;
582
582
                        }
583
583
                } else {
584
 
                        mbox_md5_continue(mbox_md5_ctx, hdr);
 
584
                        mbox->md5_v.more(mbox_md5_ctx, hdr);
585
585
                }
586
586
        }
587
587
        i_assert(ret != 0);
588
588
        message_parse_header_deinit(&hdr_ctx);
589
589
 
590
 
        mbox_md5_finish(mbox_md5_ctx, ctx.hdr_md5_sum);
 
590
        mbox->md5_v.finish(mbox_md5_ctx, ctx.hdr_md5_sum);
591
591
 
592
592
        if (ctx.mail.uid == uid)
593
593
                return TRUE;