Timo Sirainen [Mon, 23 Oct 2017 10:34:56 +0000 (13:34 +0300)]
lib-master: Change instances.lock settings to make it less likely to fail
With use_io_notify it's spending less time usleep()ing. Use also a slightly
longer timeout just in case.
If a lot of instances were started at the same time, some of them could have
failed with:
master: Error: file_dotlock_open(.../instances) failed: Resource temporarily unavailable
Timo Sirainen [Thu, 19 Oct 2017 10:26:27 +0000 (13:26 +0300)]
lib: printf_format_fix*() - Use the same 4 digits as maximum precision length
I forgot the precision can also be used to truncate strings, not just
specify the precision for floating point numbers. So it makes more sense
that the limit is the same as for minimum field width.
Timo Sirainen [Tue, 17 Oct 2017 14:39:32 +0000 (17:39 +0300)]
lib: printf_format_fix*() - Be over-strict in what format strings are allowed
The checks could have been bypassed by some invalid format strings that were
handled differently by the printf_format_fix*() code and libc. For example
"%**%n" was passed through as ok, but glibc handled the %n in it.
Stephan Bosch [Tue, 17 Oct 2017 01:19:19 +0000 (03:19 +0200)]
doveadm-server: http: Fixed lingering connections after the request is sent.
Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference.
Timo Sirainen [Mon, 16 Oct 2017 11:49:56 +0000 (14:49 +0300)]
cassandra: Fix using bigint types with unprepared statements
This reverts the code to not using the statements with binding at all.
Alternative fix would be to start using explicit int32 or int64 parameter
types, but that breaks backwards compatibility a bit.
Bill Cole [Tue, 10 Oct 2017 21:40:04 +0000 (17:40 -0400)]
Added "ULL" to the hex literals that needed it.
On 32-bit platforms with older compilers (e.g. gcc 4.2 on MacOS 10.6
running on a 1st-gen Core Duo) a 'long' is 4 bytes and the compiler does
not automatically use a 'long long' when needed, but instead generates
an error. e.g.:
libtool: compile: /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib-mail -I../../../src/lib-index -I../../../src/lib-storage -I../../../src/plugins/fts -I../../../src/doveadm -I/opt/local/include/openssl -I/opt/local/include -I/opt/local/include/CLucene/ext -pipe -Os -arch i386 -D__STDC_LIMIT_MACROS -MT lucene-wrapper.lo -MD -MP -MF .deps/lucene-wrapper.Tpo -c lucene-wrapper.cc -fno-common -DPIC -o .libs/lucene-wrapper.o
In file included from ../../../src/lib/lib.h:33,
from lucene-wrapper.cc:4:
../../../src/lib/byteorder.h:94: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:95: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:96: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:97: error: integer constant is too large for ‘long’ type
make[4]: *** [lucene-wrapper.lo] Error 1
Adding the 'ULL' to the end of the 16-digit hex literals that are used
to test the structure of 64-bit integers fixes this and avoids any
problem which could arise from the compiler using a 32-bit type for
those literals that could fit in 32 bites.
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.