[dovecot/core] a6c326: lib-storage: Deduplicate code into mailbox_list_se...

GitHub noreply at github.com
Sat Dec 17 10:00:14 UTC 2016


  Branch: refs/heads/master-2.2
  Home:   https://github.com/dovecot/core
  Commit: a6c32606655cf7fa370f19a2ae5fdf1e2a992549
      https://github.com/dovecot/core/commit/a6c32606655cf7fa370f19a2ae5fdf1e2a992549
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-storage/index/imapc/imapc-list.c
    M src/lib-storage/mail-storage.c
    M src/lib-storage/mailbox-list-private.h
    M src/lib-storage/mailbox-list.c

  Log Message:
  -----------
  lib-storage: Deduplicate code into mailbox_list_settings_init_defaults()


  Commit: ff6dc2d92f84eb4ead6da33ff254653969f70079
      https://github.com/dovecot/core/commit/ff6dc2d92f84eb4ead6da33ff254653969f70079
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-storage/list/mailbox-list-index.c
    M src/lib-storage/list/mailbox-list-index.h
    M src/lib-storage/mailbox-list-private.h
    M src/lib-storage/mailbox-list.c
    M src/lib-storage/mailbox-list.h

  Log Message:
  -----------
  lib-storage: Make dovecot.list.index's filename configurable.

This is useful when there are multiple namespaces pointing to the same mail
root directory. For example mdbox with lazy-expunge:

namespace {
  prefix = Expunged/
  location = mdbox:~/mdbox:MAILBOXDIR=expunged:LISTINDEX=expunged.list.index
  ..
}


  Commit: 201c1ef337be3bfbff680dc0216233b708fbd9e6
      https://github.com/dovecot/core/commit/201c1ef337be3bfbff680dc0216233b708fbd9e6
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/master/common.h
    M src/master/main.c
    M src/master/service-process.c

  Log Message:
  -----------
  master: Removed unused process_exec(extra_args) parameter

Removes unnecessarily complicated code marked with @UNSAFE.


  Commit: d75ed2777ab9ab1e0049dc3a07fef76fffcf7bee
      https://github.com/dovecot/core/commit/d75ed2777ab9ab1e0049dc3a07fef76fffcf7bee
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib/data-stack.h
    M src/lib/test-data-stack.c

  Log Message:
  -----------
  lib: Remove t_buffer_*_type()

The t_buffer_*() shouldn't normally be used anyway except in some low-level
string/buffer manipulation code, so there's not much point in trying to make
easier to use versions of them.


  Commit: bbc11b4a44233cfbc8ba66bfde78d044f0cc37c1
      https://github.com/dovecot/core/commit/bbc11b4a44233cfbc8ba66bfde78d044f0cc37c1
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib/Makefile.am
    M src/lib/lib.h
    A src/lib/malloc-overflow.h
    M src/lib/test-lib.c
    M src/lib/test-lib.h
    A src/lib/test-malloc-overflow.c

  Log Message:
  -----------
  lib: Add MALLOC_MULTIPLY() and MALLOC_ADD()

These can be used for calculating memory allocation sizes. If there's an
overflow, the macro panics.


  Commit: 95ed21ee318c0c948d27c129dd0594154a92bb5e
      https://github.com/dovecot/core/commit/95ed21ee318c0c948d27c129dd0594154a92bb5e
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib/data-stack.h
    M src/lib/mempool.h

  Log Message:
  -----------
  lib: *_new(): Use the new MALLOC_MULTIPLY() macro to avoid overflows

Cast the sizeof() result to unsigned int, because it's definitely always
enough and in many cases this allows optimizing away the wrap-check.


  Commit: 94a510926a97ae9065c22d4724035ceab4b3f870
      https://github.com/dovecot/core/commit/94a510926a97ae9065c22d4724035ceab4b3f870
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib/strfuncs.c

  Log Message:
  -----------
  lib: Optimization - p_strconcat() doesn't need to allocate from data stack

Various other parts of the code already rely on p_malloc() not overwriting
t_buffer_get()'ed data. p_strconcat() can do that as well.


  Commit: 3391c9ec14cb663f5b264b1d7c709d3a08a7a85c
      https://github.com/dovecot/core/commit/3391c9ec14cb663f5b264b1d7c709d3a08a7a85c
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/auth/auth-cache.c
    M src/auth/auth-request.c
    M src/auth/auth-request.h
    M src/auth/db-checkpassword.c
    M src/auth/db-ldap.c
    M src/auth/mech-gssapi.c
    M src/auth/mech-scram-sha1.c
    M src/auth/password-scheme.c
    M src/auth/userdb-dict.c
    M src/config/config-parser-private.h
    M src/config/config-parser.c
    M src/config/config-request.c
    M src/config/doveconf.c
    M src/config/old-set-parser.c
    M src/director/director-connection.c
    M src/doveadm/doveadm-auth-server.c
    M src/doveadm/doveadm-auth.c
    M src/doveadm/doveadm-cmd.c
    M src/doveadm/doveadm-fs.c
    M src/doveadm/doveadm-log.c
    M src/doveadm/doveadm-mail-mailbox.c
    M src/doveadm/doveadm-mail.c
    M src/doveadm/doveadm-print-table.c
    M src/doveadm/doveadm-sis.c
    M src/doveadm/doveadm-util.c
    M src/doveadm/doveadm.c
    M src/doveadm/dsync/dsync-brain-mailbox-tree.c
    M src/doveadm/dsync/dsync-mailbox-tree-sync.c
    M src/doveadm/dsync/dsync-mailbox-tree.c
    M src/imap/cmd-list.c
    M src/imap/cmd-notify.c
    M src/imap/cmd-rename.c
    M src/imap/cmd-subscribe.c
    M src/imap/imap-list.c
    M src/imap/imap-notify.c
    M src/imap/imap-status.c
    M src/imap/main.c
    M src/ipc/main.c
    M src/lib-compression/compression.c
    M src/lib-compression/ostream-bzlib.c
    M src/lib-compression/ostream-lzma.c
    M src/lib-compression/ostream-zlib.c
    M src/lib-dict/dict-db.c
    M src/lib-dict/dict-file.c
    M src/lib-dict/dict-memcached.c
    M src/lib-dict/dict-sql-settings.c
    M src/lib-dict/dict-sql.c
    M src/lib-fs/fs-dict.c
    M src/lib-fs/fs-posix.c
    M src/lib-fs/fs-test.c
    M src/lib-fts/fts-filter-english-possessive.c
    M src/lib-fts/fts-icu.c
    M src/lib-fts/fts-tokenizer-address.c
    M src/lib-fts/test-fts-tokenizer.c
    M src/lib-http/http-client-request.c
    M src/lib-imap-client/imapc-connection.c
    M src/lib-imap/imap-match.c
    M src/lib-imap/imap-parser.c
    M src/lib-imap/imap-quote.c
    M src/lib-imap/imap-utf7.c
    M src/lib-lda/lmtp-client.c
    M src/lib-mail/istream-binary-converter.c
    M src/lib-mail/message-decoder.c
    M src/lib-mail/message-header-decode.c
    M src/lib-mail/test-istream-attachment.c
    M src/lib-mail/test-istream-dot.c
    M src/lib-mail/test-istream-header-filter.c
    M src/lib-mail/test-istream-qp-decoder.c
    M src/lib-mail/test-mbox-from.c
    M src/lib-mail/test-message-header-parser.c
    M src/lib-master/master-login.c
    M src/lib-master/master-service.c
    M src/lib-storage/index/cydir/cydir-save.c
    M src/lib-storage/index/cydir/cydir-sync.h
    M src/lib-storage/index/dbox-common/dbox-file-fix.c
    M src/lib-storage/index/dbox-multi/mdbox-map.c
    M src/lib-storage/index/dbox-multi/mdbox-purge.c
    M src/lib-storage/index/imapc/imapc-list.c
    M src/lib-storage/index/imapc/imapc-search.c
    M src/lib-storage/index/imapc/imapc-storage.c
    M src/lib-storage/index/index-attribute.c
    M src/lib-storage/index/index-mail-headers.c
    M src/lib-storage/index/index-search.c
    M src/lib-storage/index/index-sort.c
    M src/lib-storage/index/maildir/maildir-filename-flags.c
    M src/lib-storage/index/maildir/maildir-save.c
    M src/lib-storage/index/maildir/maildir-uidlist.c
    M src/lib-storage/index/mbox/mbox-storage.c
    M src/lib-storage/index/shared/shared-list.c
    M src/lib-storage/list/mailbox-list-delete.c
    M src/lib-storage/list/mailbox-list-fs-iter.c
    M src/lib-storage/list/mailbox-list-index-backend.c
    M src/lib-storage/list/mailbox-list-index.h
    M src/lib-storage/list/mailbox-list-iter.c
    M src/lib-storage/list/mailbox-list-maildir-iter.c
    M src/lib-storage/list/mailbox-list-maildir.c
    M src/lib-storage/list/mailbox-list-notify-tree.c
    M src/lib-storage/list/mailbox-list-subscriptions.c
    M src/lib-storage/mail-namespace.c
    M src/lib-storage/mail-storage-service.c
    M src/lib-storage/mail-storage.c
    M src/lib-storage/mail-user.c
    M src/lib-storage/mailbox-list.c
    M src/lib-storage/mailbox-tree.c
    M src/lib-storage/mailbox-uidvalidity.c
    M src/lib/array.c
    M src/lib/env-util.c
    M src/lib/failures.c
    M src/lib/istream-base64-encoder.c
    M src/lib/json-parser.c
    M src/lib/module-dir.c
    M src/lib/net.c
    M src/lib/ostream-file.c
    M src/lib/printf-format-fix.c
    M src/lib/printf-format-fix.h
    M src/lib/str-find.c
    M src/lib/str-sanitize.c
    M src/lib/str.c
    M src/lib/strfuncs.c
    M src/lib/test-printf-format-fix.c
    M src/lib/unlink-old-files.c
    M src/lib/var-expand.c
    M src/lmtp/commands.c
    M src/log/log-error-buffer.c
    M src/login-common/client-common-auth.c
    M src/login-common/client-common.c
    M src/login-common/login-proxy-state.c
    M src/master/master-settings.c
    M src/master/service-process.c
    M src/plugins/acl/acl-lookup-dict.c
    M src/plugins/acl/acl-mailbox-list.c
    M src/plugins/dict-ldap/dict-ldap.c
    M src/plugins/fts-solr/fts-backend-solr-old.c
    M src/plugins/fts-solr/fts-backend-solr.c
    M src/plugins/fts-squat/squat-test.c
    M src/plugins/fts/fts-api.c
    M src/plugins/fts/fts-search-args.c
    M src/plugins/imap-acl/imap-acl-plugin.c
    M src/plugins/imap-stats/imap-stats-plugin.c
    M src/plugins/mail-crypt/mail-crypt-pluginenv.c
    M src/plugins/mail-crypt/mail-crypt-userenv.c
    M src/plugins/quota/quota-dirsize.c
    M src/replication/aggregator/replicator-connection.c

  Log Message:
  -----------
  global: Change string position/length from unsigned int to size_t

Mainly to avoid truncating >4GB strings, which might potentially cause
some security holes. Normally there are other limits, which prevent such
excessive strings from being created in the first place.

I'm sure this didn't find everything. Maybe everything could be found with
compiler warnings. -Wconversion kind of does it, but it gives way too many
unnecessary warnings.

These were mainly found with:

grep " = strlen"
egrep "unsigned int.*(size|len)"


  Commit: 4fcb886f42905880ce673fe070405b199373c14c
      https://github.com/dovecot/core/commit/4fcb886f42905880ce673fe070405b199373c14c
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/auth/auth-request-var-expand.c
    M src/doveadm/doveadm-dump-index.c
    M src/lib-imap/imap-utf7.c
    M src/lib-index/mail-index-transaction-view.c
    M src/lib-index/mail-index.c
    M src/lib-master/master-login.c
    M src/lib-program-client/program-client-local.c
    M src/lib-storage/index/maildir/maildir-save.c
    M src/lib-storage/index/pop3c/pop3c-sync.c
    M src/lib-storage/mailbox-list.c
    M src/lib/data-stack.c
    M src/lib/hex-binary.c
    M src/lib/str-find.c
    M src/lib/strfuncs.c
    M src/log/log-error-buffer.c
    M src/plugins/acl/acl-cache.c
    M src/plugins/acl/acl-cache.h
    M src/pop3/pop3-client.h
    M src/pop3/pop3-commands.c
    M src/stats/mail-command.c
    M src/stats/mail-domain.c
    M src/stats/mail-ip.c
    M src/stats/mail-session.c
    M src/stats/mail-user.c

  Log Message:
  -----------
  global: Make sure *_malloc() calculations won't cause integer overflows.


  Commit: 4dd1b4885668ab9eebdd5349e490262f868552db
      https://github.com/dovecot/core/commit/4dd1b4885668ab9eebdd5349e490262f868552db
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib/test-malloc-overflow.c

  Log Message:
  -----------
  lib: Compiler warning fix for 32bit systems


  Commit: fd2be97ae75bc25983877c65caadfd413ba0a9c5
      https://github.com/dovecot/core/commit/fd2be97ae75bc25983877c65caadfd413ba0a9c5
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-imap-client/imapc-connection.c

  Log Message:
  -----------
  imapc: Fix infinite reconnect loop to remote server that is down

This happened only in some situations. Usually there would have bene some
command in the queue, which would cause the reconnect-check to fail.


  Commit: eb2df28ed4a1daa11437c4f6b99004c64211097f
      https://github.com/dovecot/core/commit/eb2df28ed4a1daa11437c4f6b99004c64211097f
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-imap-client/imapc-connection.c

  Log Message:
  -----------
  imapc: Don't retry a failed reconnection before 10 secs have passed

This mainly avoids a lot of unnecessary connect attempts within a short
time period, for example if the caller attempts to perform some work for
all the mailboxes.


  Commit: 7bebbde574bcf7bc722fec90dddcc43d0a2e4ca1
      https://github.com/dovecot/core/commit/7bebbde574bcf7bc722fec90dddcc43d0a2e4ca1
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-imap-client/imapc-connection.c

  Log Message:
  -----------
  imapc: Minor debug logging improvement


  Commit: 613ab472b6adf9934c9192770ef90e864561f692
      https://github.com/dovecot/core/commit/613ab472b6adf9934c9192770ef90e864561f692
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/lib-storage/index/imapc/imapc-list.c
    M src/lib-storage/index/imapc/imapc-search.c
    M src/lib-storage/index/imapc/imapc-storage.c

  Log Message:
  -----------
  imapc: Log server disconnection error only once.


  Commit: eed2ab4b426f435b0c8520e212200223c8b78c66
      https://github.com/dovecot/core/commit/eed2ab4b426f435b0c8520e212200223c8b78c66
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/master/master-client.c

  Log Message:
  -----------
  master: PROCESS-STATUS output was duplicated many times


Compare: https://github.com/dovecot/core/compare/ab6166287ed5...eed2ab4b426f


More information about the dovecot-cvs mailing list