[arch-commits] Commit in dovecot/repos (7 files)

Evangelos Foutras foutrelis at archlinux.org
Tue Mar 27 21:28:01 UTC 2018


    Date: Tuesday, March 27, 2018 @ 21:27:59
  Author: foutrelis
Revision: 312939

archrelease: copy trunk to community-staging-x86_64

Added:
  dovecot/repos/community-staging-x86_64/
  dovecot/repos/community-staging-x86_64/PKGBUILD
    (from rev 312938, dovecot/trunk/PKGBUILD)
  dovecot/repos/community-staging-x86_64/dovecot-0001-fix-segfault-imap-zlib.patch
    (from rev 312938, dovecot/trunk/dovecot-0001-fix-segfault-imap-zlib.patch)
  dovecot/repos/community-staging-x86_64/dovecot-0002-fix-segfault-quota-exceeded.patch
    (from rev 312938, dovecot/trunk/dovecot-0002-fix-segfault-quota-exceeded.patch)
  dovecot/repos/community-staging-x86_64/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch
    (from rev 312938, dovecot/trunk/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch)
  dovecot/repos/community-staging-x86_64/dovecot.sysusersd
    (from rev 312938, dovecot/trunk/dovecot.sysusersd)
  dovecot/repos/community-staging-x86_64/dovecot.tmpfilesd
    (from rev 312938, dovecot/trunk/dovecot.tmpfilesd)

---------------------------------------------------------------+
 PKGBUILD                                                      |  117 +++++++
 dovecot-0001-fix-segfault-imap-zlib.patch                     |   28 +
 dovecot-0002-fix-segfault-quota-exceeded.patch                |  162 ++++++++++
 dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch |   49 +++
 dovecot.sysusersd                                             |    2 
 dovecot.tmpfilesd                                             |    1 
 6 files changed, 359 insertions(+)

Copied: dovecot/repos/community-staging-x86_64/PKGBUILD (from rev 312938, dovecot/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1,117 @@
+# $Id$
+# Maintainer: Johannes Löthberg <johannes at kyriasis.com>
+# Maintainer: Thore Bödecker <foxxx0 at archlinux.org>
+# Contributor:  Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+# Contributor: Andreas Radke <andyrtr at archlinux.org>
+# Contributor: Paul Mattal <paul at mattal.com>
+# Contributor: Federico Quagliata (quaqo) <quaqo at despammed.com>
+# Contributor: GARETTE Emmanuel <gnunux at laposte dot net>
+
+# --->>> remember to rebuild/bump pigeonhole in one step <<<---
+
+pkgname=dovecot
+pkgver=2.3.0.1
+pkgrel=4
+
+pkgdesc="An IMAP and POP3 server written with security primarily in mind"
+url="http://dovecot.org/"
+arch=('x86_64')
+license=("LGPL")
+
+depends=('krb5' 'openssl' 'sqlite' 'libmariadbclient' 'libsodium'
+         'postgresql-libs' 'bzip2' 'lz4' 'expat' 'curl' 'pam')
+makedepends=('libcap' 'libldap' 'clucene' 'libsodium')
+optdepends=('libldap: ldap plugin'
+            'xz: imap zlib  plugin'
+            'clucene: alternative FTS indexer')
+
+provides=('imap-server' 'pop3-server')
+
+source=("https://dovecot.org/releases/2.3/${pkgname}-${pkgver}.tar.gz"{,.sig}
+        'dovecot.sysusersd'
+        'dovecot.tmpfilesd'
+        # to be checked if upcoming 2.3.1 release has merged them:
+        'dovecot-0001-fix-segfault-imap-zlib.patch'
+        'dovecot-0002-fix-segfault-quota-exceeded.patch'
+        'dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch')
+
+sha256sums=('ab772b3e214683aba347203c9391295552255c4d69afb324c7b8c8fc5ad6f153'
+            'SKIP'
+            'c5e3a8ffe23e5deb4f7893d9877d972347c2ee45c4ebf713de85c537e47cfcaf'
+            'bb7620be7fc0217d77fcac940441c2abbd9efc6ef660153288d09ba412e27e06'
+            'b8a7b6e324b8b03c02d1e43b700fdb21ca791699bbb046dcc0042f8e6489b2ed'
+            'e6ef27938a384a54b28c0ce57626dcd738f659465293f2cbb71712cbd5592136'
+            '4946a6cf44d707d2d9c86f4f39c081cbd0373bbfeee7e26fcc9c3033abda7aef')
+validpgpkeys=(
+  'E643F0BDFDCD04D9FFCB6279C948525140558AC9' # Timo Sirainen <tss at iki.fi>
+  '2BE74AAB3EE754DFB9C80D3318A348AEED409DA1' # Dovecot Community Edition
+)
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  local filename
+  for filename in "${source[@]}"; do
+    if [[ "$filename" =~ \.patch$ ]]; then
+      msg2 "Applying patch ${filename##*/}"
+      patch -p1 -N -i "$srcdir/${filename##*/}"
+    fi
+  done
+
+  # fix path in helper script
+  sed -i 's:OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}:OPENSSLCONFIG=${OPENSSLCONFIG- /etc/ssl/dovecot-openssl.cnf}:' doc/mkcert.sh
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  ./configure --prefix=/usr --sysconfdir=/etc \
+    --sbindir=/usr/bin \
+    --localstatedir=/var \
+    --libexecdir=/usr/lib \
+    --with-moduledir=/usr/lib/dovecot/modules \
+    --with-systemdsystemunitdir=/usr/lib/systemd/system \
+    --disable-static \
+    --with-nss \
+    --with-pam \
+    --with-mysql \
+    --with-pgsql \
+    --with-sqlite \
+    --with-ssl=openssl \
+    --with-ssldir=/etc/ssl \
+    --with-gssapi \
+    --with-ldap=plugin \
+    --with-zlib \
+    --with-bzlib \
+    --with-lzma \
+    --with-lz4 \
+    --with-libcap \
+    --with-solr \
+    --with-lucene \
+    --with-sodium \
+    --with-docs
+
+  make
+}
+
+check() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make check
+}
+
+package() {
+  # system user/group dovenull - 74
+  # system user/group dovecot  - 76
+
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make DESTDIR="$pkgdir" install
+  install -Dm644 "${srcdir}/dovecot.sysusersd" \
+    "${pkgdir}/usr/lib/sysusers.d/dovecot.conf"
+  install -Dm644 "${srcdir}/dovecot.tmpfilesd" \
+    "${pkgdir}/usr/lib/tmpfiles.d/dovecot.conf"
+  install -d -m755 "${pkgdir}/etc/dovecot/conf.d"
+  rm -f "${pkgdir}/etc/dovecot/README"
+
+  # install mkcert helper script
+  install -m 755  doc/mkcert.sh "${pkgdir}/usr/lib/dovecot/mkcert.sh"
+}

Copied: dovecot/repos/community-staging-x86_64/dovecot-0001-fix-segfault-imap-zlib.patch (from rev 312938, dovecot/trunk/dovecot-0001-fix-segfault-imap-zlib.patch)
===================================================================
--- community-staging-x86_64/dovecot-0001-fix-segfault-imap-zlib.patch	                        (rev 0)
+++ community-staging-x86_64/dovecot-0001-fix-segfault-imap-zlib.patch	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1,28 @@
+From 23da0fa1b30cc11bcc1d467674a0950c527e9ff1 Mon Sep 17 00:00:00 2001
+From: Timo Sirainen <timo.sirainen at dovecot.fi>
+Date: Sat, 6 Jan 2018 21:22:11 +0200
+Subject: [PATCH] ostream-zlib: Ignore missing finish if parent stream is
+ ignoring errors
+
+This fixes panic with imap_zlib plugin when client enables the IMAP COMPRESS
+extension and disconnects:
+
+Panic: file ostream-zlib.c: line 36 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0)
+---
+ src/lib-compression/ostream-zlib.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib-compression/ostream-zlib.c b/src/lib-compression/ostream-zlib.c
+index 848ecb7b89..e0b9a91416 100644
+--- a/src/lib-compression/ostream-zlib.c
++++ b/src/lib-compression/ostream-zlib.c
+@@ -33,7 +33,8 @@ static void o_stream_zlib_close(struct iostream_private *stream,
+ 	struct zlib_ostream *zstream = (struct zlib_ostream *)stream;
+ 
+ 	i_assert(zstream->ostream.finished ||
+-		 zstream->ostream.ostream.stream_errno != 0);
++		 zstream->ostream.ostream.stream_errno != 0 ||
++		 zstream->ostream.error_handling_disabled);
+ 	(void)deflateEnd(&zstream->zs);
+ 	if (close_parent)
+ 		o_stream_close(zstream->ostream.parent);

Copied: dovecot/repos/community-staging-x86_64/dovecot-0002-fix-segfault-quota-exceeded.patch (from rev 312938, dovecot/trunk/dovecot-0002-fix-segfault-quota-exceeded.patch)
===================================================================
--- community-staging-x86_64/dovecot-0002-fix-segfault-quota-exceeded.patch	                        (rev 0)
+++ community-staging-x86_64/dovecot-0002-fix-segfault-quota-exceeded.patch	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1,162 @@
+From 2bf919786518d138cc07d9cc21e14ad5e07e5e56 Mon Sep 17 00:00:00 2001
+From: Stephan Bosch <stephan.bosch at dovecot.fi>
+Date: Wed, 17 Jan 2018 21:26:44 +0100
+Subject: [PATCH] lmtp: local: Fix segfault occurring when quota is exceeded.
+
+---
+ src/lmtp/lmtp-local.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c
+index fa1ce5d869..5b5fe51a95 100644
+--- a/src/lmtp/lmtp-local.c
++++ b/src/lmtp/lmtp-local.c
+@@ -133,7 +133,7 @@ static void
+ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *rcpt,
+ 				const char *error)
+ {
+-	struct smtp_address *address = rcpt->rcpt.rcpt->path;
++	struct smtp_address *address = rcpt->rcpt.path;
+ 	struct lda_settings *lda_set =
+ 		mail_storage_service_user_get_set(rcpt->service_user)[2];
+ 
+From cdbcc8db8e0a04b2cbf6ca9f20b3ee7f7173552d Mon Sep 17 00:00:00 2001
+From: Stephan Bosch <stephan.bosch at dovecot.fi>
+Date: Wed, 31 Jan 2018 10:30:23 +0100
+Subject: [PATCH 1/3] lmtp: local: Make local variable for rcpt->rcpt.rcpt_cmd
+ in lmtp_local_rcpt_check_quota().
+
+---
+ src/lmtp/lmtp-local.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c
+index c770e35e5b..d0ee4b312e 100644
+--- a/src/lmtp/lmtp-local.c
++++ b/src/lmtp/lmtp-local.c
+@@ -195,6 +195,7 @@ static int
+ lmtp_local_rcpt_check_quota(struct lmtp_local_recipient *rcpt)
+ {
+ 	struct client *client = rcpt->rcpt.client;
++	struct smtp_server_cmd_ctx *cmd = rcpt->rcpt.rcpt_cmd;
+ 	struct smtp_address *address = rcpt->rcpt.path;
+ 	struct mail_user *user;
+ 	struct mail_namespace *ns;
+@@ -245,10 +246,10 @@ lmtp_local_rcpt_check_quota(struct lmtp_local_recipient *rcpt)
+ 	}
+ 
+ 	if (ret < 0 &&
+-		!smtp_server_command_is_replied(rcpt->rcpt.rcpt_cmd->cmd)) {
+-		smtp_server_reply(rcpt->rcpt.rcpt_cmd,
+-			451, "4.3.0", "<%s> Temporary internal error",
+-			smtp_address_encode(address));
++		!smtp_server_command_is_replied(cmd->cmd)) {
++		smtp_server_reply(cmd, 451, "4.3.0",
++				  "<%s> Temporary internal error",
++				  smtp_address_encode(address));
+ 	}
+ 	return ret;
+ }
+
+From c23717da4af9d3275cb45cbc67faaa8daa353ec1 Mon Sep 17 00:00:00 2001
+From: Stephan Bosch <stephan.bosch at dovecot.fi>
+Date: Wed, 31 Jan 2018 10:34:11 +0100
+Subject: [PATCH 2/3] lmtp: local: Add explicit cmd parameter to
+ lmtp_local_rcpt_reply_overquota().
+
+Using the RCPT cmd is only valid for the RCPT command and not when quota excess
+is detected during DATA. That would cause a segmentation fault, since
+rcpt->rcpt.rcpt_cmd == NULL.
+---
+ src/lmtp/lmtp-local.c | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c
+index d0ee4b312e..c19c449e61 100644
+--- a/src/lmtp/lmtp-local.c
++++ b/src/lmtp/lmtp-local.c
+@@ -134,6 +134,7 @@ lmtp_local_rcpt_deinit(struct lmtp_local_recipient *rcpt)
+ 
+ static void
+ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *rcpt,
++				struct smtp_server_cmd_ctx *cmd,
+ 				const char *error)
+ {
+ 	struct smtp_address *address = rcpt->rcpt.path;
+@@ -141,13 +142,11 @@ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *rcpt,
+ 		mail_storage_service_user_get_set(rcpt->service_user)[2];
+ 
+ 	if (lda_set->quota_full_tempfail) {
+-		smtp_server_reply(rcpt->rcpt.rcpt_cmd,
+-			452, "4.2.2", "<%s> %s",
+-			smtp_address_encode(address), error);
++		smtp_server_reply(cmd, 452, "4.2.2", "<%s> %s",
++				  smtp_address_encode(address), error);
+ 	} else {
+-		smtp_server_reply(rcpt->rcpt.rcpt_cmd,
+-			552, "5.2.2", "<%s> %s",
+-			smtp_address_encode(address), error);
++		smtp_server_reply(cmd, 552, "5.2.2", "<%s> %s",
++				  smtp_address_encode(address), error);
+ 	}
+ }
+ 
+@@ -232,7 +231,7 @@ lmtp_local_rcpt_check_quota(struct lmtp_local_recipient *rcpt)
+ 		if (ret < 0) {
+ 			error = mailbox_get_last_error(box, &mail_error);
+ 			if (mail_error == MAIL_ERROR_NOQUOTA) {
+-				lmtp_local_rcpt_reply_overquota(rcpt, error);
++				lmtp_local_rcpt_reply_overquota(rcpt, cmd, error);
+ 			} else {
+ 				i_error("mailbox_get_status(%s, STATUS_CHECK_OVER_QUOTA) "
+ 					"failed: %s",
+@@ -623,7 +622,7 @@ lmtp_local_deliver(struct lmtp_local *local,
+ 	} else if (storage != NULL) {
+ 		error = mail_storage_get_last_error(storage, &mail_error);
+ 		if (mail_error == MAIL_ERROR_NOQUOTA) {
+-			lmtp_local_rcpt_reply_overquota(rcpt, error);
++			lmtp_local_rcpt_reply_overquota(rcpt, cmd, error);
+ 		} else {
+ 			smtp_server_reply_index(cmd, rcpt_idx,
+ 				451, "4.2.0", "<%s> %s",
+
+From f8d9e6c977847a411af9986c9be62f74e4b06143 Mon Sep 17 00:00:00 2001
+From: Stephan Bosch <stephan.bosch at dovecot.fi>
+Date: Wed, 31 Jan 2018 10:27:54 +0100
+Subject: [PATCH 3/3] lmtp: local: Use recipient index in
+ lmtp_local_rcpt_reply_overquota().
+
+When used during the DATA command, it should send a reply for the correct
+recipient. During the RCPT command there is only one reply due. Added assert
+that checks this.
+---
+ src/lmtp/lmtp-local.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c
+index c19c449e61..0b5e7e06ec 100644
+--- a/src/lmtp/lmtp-local.c
++++ b/src/lmtp/lmtp-local.c
+@@ -138,15 +138,18 @@ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *rcpt,
+ 				const char *error)
+ {
+ 	struct smtp_address *address = rcpt->rcpt.path;
++	unsigned int rcpt_idx = rcpt->rcpt.index;
+ 	struct lda_settings *lda_set =
+ 		mail_storage_service_user_get_set(rcpt->service_user)[2];
+ 
++	i_assert(rcpt_idx == 0 || rcpt->rcpt.rcpt_cmd == NULL);
++
+ 	if (lda_set->quota_full_tempfail) {
+-		smtp_server_reply(cmd, 452, "4.2.2", "<%s> %s",
+-				  smtp_address_encode(address), error);
++		smtp_server_reply_index(cmd, rcpt_idx, 452, "4.2.2", "<%s> %s",
++					smtp_address_encode(address), error);
+ 	} else {
+-		smtp_server_reply(cmd, 552, "5.2.2", "<%s> %s",
+-				  smtp_address_encode(address), error);
++		smtp_server_reply_index(cmd, rcpt_idx, 552, "5.2.2", "<%s> %s",
++					smtp_address_encode(address), error);
+ 	}
+ }
+ 

Copied: dovecot/repos/community-staging-x86_64/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch (from rev 312938, dovecot/trunk/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch)
===================================================================
--- community-staging-x86_64/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch	                        (rev 0)
+++ community-staging-x86_64/dovecot-0003-dsync-Revert-to-tmp-if-home-does-not-exist.patch	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1,49 @@
+From f46b7c33c884b41a614a18187268db351c9d6722 Mon Sep 17 00:00:00 2001
+From: Aki Tuomi <aki.tuomi at dovecot.fi>
+Date: Mon, 19 Mar 2018 18:39:27 +0200
+Subject: [PATCH] dsync: Revert to /tmp if home does not exist
+
+Fixes doveadm: Error: Couldn't lock .dovecot-sync.lock: safe_mkstemp(.dovecot-sync.lock) failed: No such file or directory
+---
+ src/doveadm/dsync/dsync-brain.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/doveadm/dsync/dsync-brain.c b/src/doveadm/dsync/dsync-brain.c
+index cb4a411..03afdcd 100644
+--- a/src/doveadm/dsync/dsync-brain.c
++++ b/src/doveadm/dsync/dsync-brain.c
+@@ -391,6 +391,7 @@ dsync_brain_lock(struct dsync_brain *brain, const char *remote_hostname)
+ 		.lock_method = FILE_LOCK_METHOD_FCNTL,
+ 	};
+ 	const char *home, *error;
++	struct stat st;
+ 	bool created;
+ 	int ret;
+ 
+@@ -415,8 +416,21 @@ dsync_brain_lock(struct dsync_brain *brain, const char *remote_hostname)
+ 
+ 	if (brain->verbose_proctitle)
+ 		process_title_set(dsync_brain_get_proctitle_full(brain, DSYNC_BRAIN_TITLE_LOCKING));
+-	brain->lock_path = p_strconcat(brain->pool, home,
+-				       "/"DSYNC_LOCK_FILENAME, NULL);
++
++	/* if homedir does not yet exist, create lock under tmpdir */
++	if (stat(home, &st) < 0) {
++		if (errno != ENOENT) {
++			i_error("stat(%s) failed: %m", home);
++			return -1;
++		}
++		brain->lock_path = p_strdup_printf(brain->pool, "%s/%s-%s",
++						   brain->user->set->mail_temp_dir,
++						   brain->user->username,
++						   "/"DSYNC_LOCK_FILENAME);
++	} else {
++		brain->lock_path = p_strconcat(brain->pool, home,
++					       "/"DSYNC_LOCK_FILENAME, NULL);
++	}
+ 	brain->lock_fd = file_create_locked(brain->lock_path, &lock_set,
+ 					    &brain->lock, &created, &error);
+ 	if (brain->lock_fd == -1)
+-- 
+2.1.4
+

Copied: dovecot/repos/community-staging-x86_64/dovecot.sysusersd (from rev 312938, dovecot/trunk/dovecot.sysusersd)
===================================================================
--- community-staging-x86_64/dovecot.sysusersd	                        (rev 0)
+++ community-staging-x86_64/dovecot.sysusersd	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1,2 @@
+u dovenull 74 "Dovecot user for completely untrustworthy processes" -
+u dovecot  76 "Dovecot user" -

Copied: dovecot/repos/community-staging-x86_64/dovecot.tmpfilesd (from rev 312938, dovecot/trunk/dovecot.tmpfilesd)
===================================================================
--- community-staging-x86_64/dovecot.tmpfilesd	                        (rev 0)
+++ community-staging-x86_64/dovecot.tmpfilesd	2018-03-27 21:27:59 UTC (rev 312939)
@@ -0,0 +1 @@
+d /var/run/dovecot 0755 root dovecot -



More information about the arch-commits mailing list