[dovecot/core] 5c2b8a: lib: Add file_lock_get_path()

GitHub noreply at github.com
Mon Jul 3 15:30:14 EEST 2017


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

  Changed paths:
    M src/lib/file-lock.c
    M src/lib/file-lock.h

  Log Message:
  -----------
  lib: Add file_lock_get_path()

This allows getting the file path from the lock without having to preserve
it separately.


  Commit: 56ae8963806026ad5ff4a8f54584d7d8f9a040de
      https://github.com/dovecot/core/commit/56ae8963806026ad5ff4a8f54584d7d8f9a040de
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/file-lock.c
    M src/lib/file-lock.h

  Log Message:
  -----------
  lib: Add file_lock_set_path()


  Commit: 104e4cdcfef79119c797ba40d997b9764c6d6a28
      https://github.com/dovecot/core/commit/104e4cdcfef79119c797ba40d997b9764c6d6a28
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/file-create-locked.c

  Log Message:
  -----------
  lib: file_create_locked() - update lock path after link()


  Commit: c11879778dfef8c8399c882c3db642e33da6f541
      https://github.com/dovecot/core/commit/c11879778dfef8c8399c882c3db642e33da6f541
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/file-lock.c
    M src/lib/file-lock.h

  Log Message:
  -----------
  lib: Add file_lock_set_unlink_on_free()


  Commit: d9781e2511d916ef5ae899bd5de91f665cd6649a
      https://github.com/dovecot/core/commit/d9781e2511d916ef5ae899bd5de91f665cd6649a
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/file-lock.c
    M src/lib/file-lock.h

  Log Message:
  -----------
  lib: Add file_lock_set_close_on_free()


  Commit: 8336d087aaafde12df8d67735addb87f80a9b488
      https://github.com/dovecot/core/commit/8336d087aaafde12df8d67735addb87f80a9b488
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/Makefile.am
    A src/lib/test-file-create-locked.c
    M src/lib/test-lib.c
    M src/lib/test-lib.h

  Log Message:
  -----------
  lib: Add unit test for file_create_locked()


  Commit: faafc88b11390824c9f4dfaa8fe98ef0b14586fd
      https://github.com/dovecot/core/commit/faafc88b11390824c9f4dfaa8fe98ef0b14586fd
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/file-create-locked.c
    M src/lib/file-create-locked.h
    M src/lib/test-file-create-locked.c

  Log Message:
  -----------
  lib: file_create_locked() - Add settings to mkdir() missing parent directories


  Commit: 466f4272cbef5a857f9c900fe6750d2185ec3c36
      https://github.com/dovecot/core/commit/466f4272cbef5a857f9c900fe6750d2185ec3c36
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/index-mailbox-size.c

  Log Message:
  -----------
  lib-storage: Fix error logging for failing to create .vsize.lock


  Commit: 3a0d8032e1bd25dbba47ec71e2840436ad7eca1a
      https://github.com/dovecot/core/commit/3a0d8032e1bd25dbba47ec71e2840436ad7eca1a
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/index-mailbox-size.c

  Log Message:
  -----------
  lib-storage: Use file_lock_set_*_on_free() for .vsize.lock

This avoids storing the lock_path and lock_fd separately.


  Commit: e48fd415f605c82b648a03b54636a28cda87dc39
      https://github.com/dovecot/core/commit/e48fd415f605c82b648a03b54636a28cda87dc39
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/index-mailbox-size.c

  Log Message:
  -----------
  lib-storage: Move .vsize.lock creation to its own function


  Commit: fa71a58117575b5fe5c536c0d5640543a4ecf252
      https://github.com/dovecot/core/commit/fa71a58117575b5fe5c536c0d5640543a4ecf252
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: Move .vsize.lock creation to a generic mailbox_lock_file_create()


  Commit: 461aafd3a2bf0f44b7f1e7796bed5ed576861d8e
      https://github.com/dovecot/core/commit/461aafd3a2bf0f44b7f1e7796bed5ed576861d8e
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-autoexpunge.c

  Log Message:
  -----------
  lib-storage: Use file_lock_set_*_on_free() for dovecot.autoexpunge.lock


  Commit: b05f66b4de3e76876dc929e9f44296592c3675f9
      https://github.com/dovecot/core/commit/b05f66b4de3e76876dc929e9f44296592c3675f9
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-autoexpunge.c

  Log Message:
  -----------
  lib-storage: mailbox_autoexpunge_lock() - small cleanup

No functional changes - just reorganizing code and adding comments.


  Commit: 0c4b344f031951a55ac1de5f5f05818bbb07eaf7
      https://github.com/dovecot/core/commit/0c4b344f031951a55ac1de5f5f05818bbb07eaf7
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-autoexpunge.c

  Log Message:
  -----------
  lib-storage: mailbox_autoexpunge_lock() - Don't hide ENOENT error

It means that the user's home directory doesn't exist, which is pretty
unexpected. Home directory is supposed to be created when the storage is
initialized.


  Commit: 620f970cb243f8ebfcf6e4e9f4c2c573a64e6ee5
      https://github.com/dovecot/core/commit/620f970cb243f8ebfcf6e4e9f4c2c573a64e6ee5
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-autoexpunge.c
    M src/lib-storage/mail-user.c
    M src/lib-storage/mail-user.h

  Log Message:
  -----------
  lib-storage: Move autoexpunge lock creation to a generic mail_user_lock_file_create()


  Commit: 5a661d780527af786388b4438bf6ebda39a4fa9c
      https://github.com/dovecot/core/commit/5a661d780527af786388b4438bf6ebda39a4fa9c
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    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-list.h

  Log Message:
  -----------
  lib-storage: Add VOLATILEDIR setting to mail_location

This is useful for creating temporary locks that could exist in tmpfs.
Currently this is used for .vsize.lock and dovecot.autoexpunge.lock.


  Commit: b16614d91d26e494d96d9c73e08501df058ee911
      https://github.com/dovecot/core/commit/b16614d91d26e494d96d9c73e08501df058ee911
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib/test-file-create-locked.c

  Log Message:
  -----------
  lib: Fix file_create_locked() unit test to delete temp file afterwards

Also removed a path string that was never used.


  Commit: 4ff9693044bac1daa2e3433ce98cf8b9bc9d00b4
      https://github.com/dovecot/core/commit/4ff9693044bac1daa2e3433ce98cf8b9bc9d00b4
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-delete.h

  Log Message:
  -----------
  lib-storage: Add comments to mailbox-list-delete.h


  Commit: e1019a065755d6d826ab237622ee05ec421e0911
      https://github.com/dovecot/core/commit/e1019a065755d6d826ab237622ee05ec421e0911
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: Add mailbox_list_get_last_mail_error()


  Commit: 4574408e501c6aded3b8099c596b83e0637a07d4
      https://github.com/dovecot/core/commit/4574408e501c6aded3b8099c596b83e0637a07d4
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: mailbox_list_delete_finish() - Return whether anything was deleted


  Commit: 11767d2a955235c0fd2b468a7826b59f01a20e11
      https://github.com/dovecot/core/commit/11767d2a955235c0fd2b468a7826b59f01a20e11
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: Add mailbox_list_delete_finish_ret()

This simplifies deletion logic for mailbox list backends.


  Commit: e547d6cf2f288c697c49f01d82e16745cf51813d
      https://github.com/dovecot/core/commit/e547d6cf2f288c697c49f01d82e16745cf51813d
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-fs.c
    M src/lib-storage/list/mailbox-list-maildir.c

  Log Message:
  -----------
  lib-storage: Use mailbox_list_delete_finish_ret() for fs & maildir++ layout

Fixes a problem where e.g. index directory existed but mail root didn't,
and the mailbox couldn't be fully deleted. This was especially a problem
with ITERINDEX enabled.


  Commit: 0e30932db1f05847ba1103ec2c119760e64279af
      https://github.com/dovecot/core/commit/0e30932db1f05847ba1103ec2c119760e64279af
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-delete.c

  Log Message:
  -----------
  lib-storage: mailbox_list_delete_trash() - Don't ignore errors


  Commit: a00dcef10e757922d8f68a5c6260c7439969c133
      https://github.com/dovecot/core/commit/a00dcef10e757922d8f68a5c6260c7439969c133
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-delete.c

  Log Message:
  -----------
  lib-storage: mailbox_list_delete_mailbox_nonrecursive() - Fix error handling

It should return error on unexpected readdir(), closedir() and unlink()
failures. Also fix handling a race condition with another process deleting
the mailbox at the same time.


  Commit: 13996627cee91114dbf3cab0bcc67fb02e359a02
      https://github.com/dovecot/core/commit/13996627cee91114dbf3cab0bcc67fb02e359a02
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-delete.c

  Log Message:
  -----------
  lib-storage: Fix mailbox delete to not delete childrens' INDEX or CONTROL dirs

If mail_location had separate INDEX and/or CONTROL set, deleting a mailbox
with children caused the childrens' index and/or control directories to be
deleted (but the mail/ALT directories weren't).

I'm not sure why the _FLAG_MAILBOX_FILES was treated as a special case
earlier. It shouldn't make a difference.


  Commit: ea4d5455d3f3e0c717421a0f2d87653cae692bf4
      https://github.com/dovecot/core/commit/ea4d5455d3f3e0c717421a0f2d87653cae692bf4
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/dbox-common/dbox-storage.c
    M src/lib-storage/index/dbox-common/dbox-storage.h
    M src/lib-storage/index/dbox-multi/mdbox-storage.c
    M src/lib-storage/index/dbox-single/sdbox-storage.c

  Log Message:
  -----------
  sdbox: Don't create index directory when trying to open nonexistent mailboxes


  Commit: 6db1823799f6bff65dff7494b2cfc7cc6f50bf3d
      https://github.com/dovecot/core/commit/6db1823799f6bff65dff7494b2cfc7cc6f50bf3d
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/index-storage.c
    M src/lib-storage/list/mailbox-list-fs-flags.c
    M src/lib-storage/list/mailbox-list-fs-iter.c
    M src/lib-storage/list/mailbox-list-fs.c
    M src/lib-storage/list/mailbox-list-maildir-iter.c
    M src/lib-storage/mailbox-list.c
    M src/lib-storage/mailbox-list.h

  Log Message:
  -----------
  lib-storage: Add mail_location=..:ITERINDEX

This changes mailbox list iteration to work using INDEX directory instead of
the normal mail directory. This can be helpful when the indexes are stored
on a faster storage.


  Commit: 7500e3407caf24802e61d99b0e01d3bf102c5984
      https://github.com/dovecot/core/commit/7500e3407caf24802e61d99b0e01d3bf102c5984
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: Add mailbox_permissions_copy()


  Commit: 332d4db8c0696419419af30e68fb3570beb9cb97
      https://github.com/dovecot/core/commit/332d4db8c0696419419af30e68fb3570beb9cb97
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-storage.c
    M src/lib-storage/mailbox-list.c

  Log Message:
  -----------
  lib-storage: Cleanup - Use mailbox_permissions_copy() instead of duplicating it


  Commit: 0bb84b9ee986d3aacac85269b249bb754ef96e28
      https://github.com/dovecot/core/commit/0bb84b9ee986d3aacac85269b249bb754ef96e28
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: Cleanup - move code to mailbox_list_get_permissions_stat()

Comments changed also a bit, but no functional changes.


  Commit: 6887dab8a00f4d6fc12f1e6dc90527fdd8802308
      https://github.com/dovecot/core/commit/6887dab8a00f4d6fc12f1e6dc90527fdd8802308
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: mailbox_list_get_permissions() - Use index dir for storage without mails

The index dir might still exist.


  Commit: cfc2d11922e4c94c8b73ff804dd87566e245f850
      https://github.com/dovecot/core/commit/cfc2d11922e4c94c8b73ff804dd87566e245f850
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

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

  Log Message:
  -----------
  lib-storage: mailbox_list_get_permissions() - Use index dir with ITERINDEX


  Commit: a9f112f91a578295c4290867e83a6905e8dc95ec
      https://github.com/dovecot/core/commit/a9f112f91a578295c4290867e83a6905e8dc95ec
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/mail-storage.c

  Log Message:
  -----------
  lib-storage: Check for storage existence from index dir with ITERINDEX

The root path creation doesn't really even seem to be necessary, because any
mailbox access will automatically mkdir the missing directories anyway.
Although writing other files might not work so well, such as
mail_attribute_dict that points inside the mail directory.

This change simply changes the mailboxes/ directory to be looked up from
index directory instead of the mail root directory. It also mkdirs the
index/mailboxes/ directory afterwards if it didn't exist. So practically
this change shouldn't break anything, since the mailboxes/ directory should
always exist for both root and the indexes.


  Commit: 40aabe3716340763cfa51e998ce7da8ea9e60fcb
      https://github.com/dovecot/core/commit/40aabe3716340763cfa51e998ce7da8ea9e60fcb
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/dbox-common/dbox-storage.c

  Log Message:
  -----------
  dbox: Cleanup - reorganize old temp file cleanup code

No functional changes. In preparation for the next commits.


  Commit: 44fda550ff557a62c7eb19c0b67d5f1dfa1ffced
      https://github.com/dovecot/core/commit/44fda550ff557a62c7eb19c0b67d5f1dfa1ffced
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-index/mail-index-map-hdr.c
    M src/lib-index/mail-index.h
    M src/lib-storage/index/index-storage.c
    M src/lib-storage/index/index-storage.h

  Log Message:
  -----------
  lib-index, lib-storage: Add mail_index_header.last_temp_file_scan

Also add index_mailbox_update_last_temp_file_scan() for easily updating it.

This is reusing an old "sync timestamp" field. Because it was a timestamp,
it doesn't matter if the old data still exists in it. This field could have
been added as an extension, but that's more work and this feature is generic
enough that it should be useful for many of the mail storage backends.


  Commit: 8c2f60b2c9b10ea4a8c452cdfb6e9c810d0bf6c9
      https://github.com/dovecot/core/commit/8c2f60b2c9b10ea4a8c452cdfb6e9c810d0bf6c9
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/dbox-common/dbox-storage.c
    M src/lib-storage/index/dbox-common/dbox-storage.h
    M src/lib-storage/index/dbox-multi/mdbox-storage.c
    M src/lib-storage/index/dbox-single/sdbox-storage.c

  Log Message:
  -----------
  dbox: Use mail_index_header.last_temp_file_scan instead of directory's atime

This will be required for the following ITERINDEX change.


  Commit: ac9f468cfcc51a0878aa19021c0c51cdac7d5184
      https://github.com/dovecot/core/commit/ac9f468cfcc51a0878aa19021c0c51cdac7d5184
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/index/dbox-common/dbox-storage.c

  Log Message:
  -----------
  dbox: Check mailbox existence from index directory with ITERINDEX


  Commit: 643c367f537b0ab42da4799387c01a9e55328294
      https://github.com/dovecot/core/commit/643c367f537b0ab42da4799387c01a9e55328294
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-07-03 (Mon, 03 Jul 2017)

  Changed paths:
    M src/lib-storage/list/mailbox-list-delete.c

  Log Message:
  -----------
  lib-storage: Fix ITERINDEX to leave \NoSelect parents after deleting child mailbox

For example if "a/b" was created and deleted, "a" should be left behind.
(Or at least it shouldn't have left "a" to mail root directory and kept it
invisible since it didn't exist in index dir.)


Compare: https://github.com/dovecot/core/compare/1a14bfc1f386...643c367f537b


More information about the dovecot-cvs mailing list