Timo Sirainen [Wed, 4 Oct 2017 18:45:18 +0000 (21:45 +0300)]
global: Use check-local in Makefile.am instead of overriding check directly
This helps with dependency problems, like running "make check" in
lib-storage without "make" first would try to compile the test programs
too early and fail.
Timo Sirainen [Mon, 9 Oct 2017 10:19:32 +0000 (13:19 +0300)]
lib: ostream-multiplex - set ostream_private.parent
Unlike with istream-multiplex, there are no issues with I/Os. Only the
parent stream will have the I/O. Using the default parent adds the
missing methods that otherwise would have needed to be implemented:
- cork
- flush_pending
- switch_ioloop
Timo Sirainen [Mon, 9 Oct 2017 10:14:23 +0000 (13:14 +0300)]
lib: istream-multiplex - Forward i_stream_switch_ioloop() to parent
Most istreams do this because istream_private.parent is set to the parent
stream, but this can't be done with istream-multiplex. The main problem
with attempting to do the same with istream-multiplex is that the different
channels don't share the same I/O. Just because one channel received data
doesn't mean that other channels received any data. (It would be possible
to solve this by implementing a new method that allows overriding
i_stream_set_io(), but I'm not sure if that's a good idea either.)
Timo Sirainen [Fri, 6 Oct 2017 13:55:28 +0000 (16:55 +0300)]
acl: Fix checking create (k) permission in global acl-file
Just because the global ACL file hasn't changed since it was last refreshed
for another ACL object, it doesn't mean that those ACLs don't need to be
applied to this ACL object.
This didn't usually cause problems, because the initial ACL object refresh
was always done due to local-path refresh returning "needs a refresh".
The only exception was when acl_object_init_from_parent() was called,
because it added an empty non-NULL validity for the local-path, so the
"needs a refresh" wasn't returned. This happened only when trying to
CREATE or RENAME mailbox under a parent where user didn't have create
permissions.
This affected only when using a single global acl-file, not when using
global acl directory containing per-mailbox files.
lib: don't use foo_real()-style symbols in a header file
While there is precedent for symbols getting _real suffix to hide
implementation details, all the existing symbols were static until
the recent i_fd_close*() changes. This commit makes this true again.
Timo Sirainen [Thu, 5 Oct 2017 08:46:55 +0000 (11:46 +0300)]
director: Don't crash if DIRECTOR-REMOVE is received for itself
This triggers the director removal from the ring, which causes the
connection to be destroyed. But since we're still in the middle of handling
the connection it needs refcounting.
Timo Sirainen [Wed, 4 Oct 2017 12:08:07 +0000 (15:08 +0300)]
lib: istream-file/unix - don't ignore EINTR for blocking istream reads
Just fail the istream read entirely. Although there's a small possibility
that this interrupt was unwanted and should be retried, it's more likely
that a blocking istream is hanging and admin wants to stop the process.
If the EINTR is ignored all the time, it's not possible to abort a
blocking read with ^C or anything else than SIGKILL.
Stephan Bosch [Wed, 13 Sep 2017 23:32:17 +0000 (01:32 +0200)]
lib-lda: Moved most of mail_deliver_save_open() to lib-storage.
This prevents the need to link Pigeonhole lib-sieve to lib-lda, which makes no sense for IMAPSIEVE.
This also allows lib-sieve to have more control over how mailboxes are opened.
Timo Sirainen [Wed, 4 Oct 2017 12:41:03 +0000 (15:41 +0300)]
director: Fix HOST-RESET-USERS when all hosts are down
If there were a lot of users being kicked, the host was flushed after the
initial round of user kills. This caused the rest of the user connections to
be just discarded instead of actually being killed.
Timo Sirainen [Wed, 4 Oct 2017 12:39:08 +0000 (15:39 +0300)]
director: Fix tracking user move count when user is freed early
users_moving_count wasn't updated if the user was freed before killing it
finished. This caused "doveadm director flush" to hang while waiting for
the move count to drop to 0, which it never did. Also following flushes
were doing less work in parallel, or possibly even nothing since director
thought there were too many users already being moved.
Timo Sirainen [Wed, 4 Oct 2017 07:46:47 +0000 (10:46 +0300)]
quota: quota_get_resource() - return enum to make the result more exact
This is mainly to differentiate between "resource name unknown" and
"unlimited quota".
This also fixes quota_clone plugin to update quota even when quota is
unlimited. It was supposed to have been skipped only when the resource
names weren't known.
The private quota.get_resource() API is unchanged. The backends were
already returning 0 only when the resource name was unknown.
Timo Sirainen [Tue, 3 Oct 2017 11:51:16 +0000 (14:51 +0300)]
lib-master: master_service_init_log() - Switch log handlers only on the first call
The secondary calls were only done by mail_storage_service_*() calls. They
want to initialize the logging once, but afterwards they only care about
changing the log prefix. Switch to this behavior now explicitly.
This fixes behavior if logging functions are changed between
mail_storage_service_*() calls, so they don't get reset.
It is like i_close_fd() but takes an argument with the name of the file
that's being closed. The name is only used when printing the error
message due to a failed close() syscall.