]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-server: Fix potential dsync-server panic at deinit
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 27 Nov 2017 16:34:49 +0000 (18:34 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 28 Nov 2017 09:34:52 +0000 (11:34 +0200)
If the ostream is still used (e.g. for logging) after dsync is finished, it
crashed with:

Panic: file ostream.c: line 276 (o_stream_sendv_int): assertion failed: (!_stream->finished)

src/doveadm/doveadm-dsync.c

index 19c5f0b0ede04f4aa9ebc4d2e3d339db1930abb0..f5e437a3dc15e34e8ad56364d30e9c7ec62c964e 100644 (file)
@@ -1159,6 +1159,7 @@ cmd_dsync_server_run(struct doveadm_mail_cmd_context *_ctx,
                ctx->fd_in = ctx->fd_out = -1;
                ctx->input = cctx->input;
                ctx->output = cctx->output;
+               o_stream_set_finish_also_parent(ctx->output, FALSE);
                o_stream_nsend(ctx->output, "\n+\n", 3);
                i_set_failure_prefix("dsync-server(%s): ", user->username);
                name = i_stream_get_name(ctx->input);