[dovecot/core] bb444f: lib-index: Fix mail_index_get_modification_time() ...

GitHub noreply at github.com
Tue Jul 18 15:30:08 EEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: bb444f746dc6c15a8d0af67ef81bfa48c28471d0
      https://github.com/dovecot/core/commit/bb444f746dc6c15a8d0af67ef81bfa48c28471d0
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M src/lib-index/mail-index.c
    M src/lib-index/mail-index.h
    M src/lib-index/mail-transaction-log.c
    M src/lib-index/mail-transaction-log.h

  Log Message:
  -----------
  lib-index: Fix mail_index_get_modification_time() to work when index isn't open.

index->filepath may be NULL after a failed index open, and it's a bit unsafe
to trust that index->log->filepath isn't NULL either.  So just build the full
path from elements that are definitely non-NULL.

Also stat() only dovecot.index.log, because it's always supposed to exist.
If it doesn't, something's broken and stat()ing dovecot.index doesn't make
much sense.

This commit removes mail_transaction_log_get_mtime(), which is no longer
needed.

Fixes:
Panic: file mail-index.c: line 931 (mail_index_file_set_syscall_error): assertion failed: (filepath != NULL)




More information about the dovecot-cvs mailing list