From owner-svn-ports-all@freebsd.org Wed Jul 31 11:44:19 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B78DBBF77; Wed, 31 Jul 2019 11:44:19 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zBR66TDhz3DZ2; Wed, 31 Jul 2019 11:44:18 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C01F21016; Wed, 31 Jul 2019 11:44:18 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6VBiIsL083329; Wed, 31 Jul 2019 11:44:18 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6VBiICu083326; Wed, 31 Jul 2019 11:44:18 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201907311144.x6VBiICu083326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Wed, 31 Jul 2019 11:44:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r507707 - in head/mail/mailutils: . files X-SVN-Group: ports-head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: in head/mail/mailutils: . files X-SVN-Commit-Revision: 507707 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45zBR66TDhz3DZ2 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.68)[0.680,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 11:44:19 -0000 Author: danfe Date: Wed Jul 31 11:44:17 2019 New Revision: 507707 URL: https://svnweb.freebsd.org/changeset/ports/507707 Log: Cherry-pick the following two changes from the upstream Git repository at http://git.savannah.gnu.org/cgit/mailutils.git: 018df5d628f4e093f7e45c00b48ffc11b234d8cf - Minor fix 113e144dedbebb5bc659eadc7f329450bb374606 - Fix mandatory locking Requested by: maintainer Added: head/mail/mailutils/files/git-018df5d (contents, props changed) head/mail/mailutils/files/git-113e144 (contents, props changed) Modified: head/mail/mailutils/Makefile Modified: head/mail/mailutils/Makefile ============================================================================== --- head/mail/mailutils/Makefile Wed Jul 31 11:02:19 2019 (r507706) +++ head/mail/mailutils/Makefile Wed Jul 31 11:44:17 2019 (r507707) @@ -3,9 +3,12 @@ PORTNAME= mailutils PORTVERSION= 3.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= GNU GNU_ALPHA + +EXTRA_PATCHES= ${FILESDIR}/git-018df5d:-p1 \ + ${FILESDIR}/git-113e144:-p1 MAINTAINER= zeus@gnu.org.ua COMMENT= Utilities, daemons, and filters for processing e-mail Added: head/mail/mailutils/files/git-018df5d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/mailutils/files/git-018df5d Wed Jul 31 11:44:17 2019 (r507707) @@ -0,0 +1,277 @@ +From 018df5d628f4e093f7e45c00b48ffc11b234d8cf Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 23 Jul 2019 08:04:38 +0300 +Subject: Minor fix + +Check return from mu_message_get_num_parts +--- + imap4d/fetch.c | 32 ++++++++++++++++++------------- + imap4d/search.c | 24 ++++++++++++++--------- + libmu_scm/tests/testsuite.at | 2 +- + libmu_sieve/extensions/moderator.c | 9 +++++++-- + libmu_sieve/tests.c | 15 +++++++++++---- + mail/decode.c | 39 ++++++++++++++++++++++---------------- + mh/burst.c | 8 +++++++- + mh/mhn.c | 12 +++++++++--- + 8 files changed, 92 insertions(+), 49 deletions(-) + +diff --git a/imap4d/fetch.c b/imap4d/fetch.c +index 51921dd..fa0cea6 100644 +--- a/imap4d/fetch.c ++++ b/imap4d/fetch.c +@@ -491,7 +491,6 @@ bodystructure (mu_message_t msg, int extension) + static int + fetch_bodystructure0 (mu_message_t message, int extension) + { +- size_t nparts = 1; + size_t i; + int is_multipart = 0; + +@@ -500,20 +499,27 @@ fetch_bodystructure0 (mu_message_t message, int extension) + { + mu_content_type_t ct; + mu_header_t header = NULL; ++ size_t nparts; + int rc; + +- mu_message_get_num_parts (message, &nparts); +- +- /* Get all the sub messages. */ +- for (i = 1; i <= nparts; i++) +- { +- mu_message_t msg = NULL; +- mu_message_get_part (message, i, &msg); +- io_sendf ("("); +- fetch_bodystructure0 (msg, extension); +- io_sendf (")"); +- } /* for () */ +- ++ rc = mu_message_get_num_parts (message, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ } ++ else ++ { ++ /* Get all the sub messages. */ ++ for (i = 1; i <= nparts; i++) ++ { ++ mu_message_t msg = NULL; ++ mu_message_get_part (message, i, &msg); ++ io_sendf ("("); ++ fetch_bodystructure0 (msg, extension); ++ io_sendf (")"); ++ } /* for () */ ++ } ++ + mu_message_get_header (message, &header); + + /* The subtype. */ +diff --git a/imap4d/search.c b/imap4d/search.c +index 8bc9770..0037964 100644 +--- a/imap4d/search.c ++++ b/imap4d/search.c +@@ -1019,17 +1019,23 @@ _match_multipart (struct parsebuf *pb, mu_message_t msg, char *text) + { + size_t i, nparts; + +- mu_message_get_num_parts (msg, &nparts); +- +- for (i = 1; i <= nparts; i++) ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) + { +- mu_message_t submsg = NULL; +- +- if (mu_message_get_part (msg, i, &submsg) == 0) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ } ++ else ++ { ++ for (i = 1; i <= nparts; i++) + { +- result = _match_multipart (pb, submsg, text); +- if (result) +- break; ++ mu_message_t submsg = NULL; ++ ++ if (mu_message_get_part (msg, i, &submsg) == 0) ++ { ++ result = _match_multipart (pb, submsg, text); ++ if (result) ++ break; ++ } + } + } + } +diff --git a/libmu_scm/tests/testsuite.at b/libmu_scm/tests/testsuite.at +index 6bd1947..ba445f7 100644 +--- a/libmu_scm/tests/testsuite.at ++++ b/libmu_scm/tests/testsuite.at +@@ -14,7 +14,7 @@ m4_define([MU_GUILE_CHECK], + [AT_DATA([input.scm],[dnl + (use-modules ((mailutils mailutils)) + ((mailutils ancilla))) +-(mu-register-format "mbox") ++(mu-register-format "mbox") + [$1] + ]) + m4_if(MU_TEST_MAILBOX,,,[MUT_MBCOPY($abs_top_srcdir/testsuite/MU_TEST_MAILBOX,mbox)]) +diff --git a/libmu_sieve/extensions/moderator.c b/libmu_sieve/extensions/moderator.c +index 3544d88..4fe2e83 100644 +--- a/libmu_sieve/extensions/moderator.c ++++ b/libmu_sieve/extensions/moderator.c +@@ -284,8 +284,13 @@ moderator_action (mu_sieve_machine_t mach) + mu_sieve_abort (mach); + } + +- mu_message_get_num_parts (msg, &nparts); +- ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_sieve_error (mach, "mu_message_get_num_parts: %s", mu_strerror (rc)); ++ mu_sieve_abort (mach); ++ } ++ + if (nparts != 3) /* Mailman moderation requests have three parts */ + { + mu_sieve_error (mach, _("expected 3 parts, but found %lu"), +diff --git a/libmu_sieve/tests.c b/libmu_sieve/tests.c +index da3872f..c346747 100644 +--- a/libmu_sieve/tests.c ++++ b/libmu_sieve/tests.c +@@ -176,17 +176,24 @@ sieve_test_header (mu_sieve_machine_t mach) + v = mu_sieve_get_arg_untyped (mach, 1); + + clos.message = mach->msg; ++ clos.nparts = 0; + + if (mu_sieve_get_tag (mach, "mime", SVT_VOID, NULL)) + { + int ismime = 0; + +- mu_message_is_multipart (mach->msg, &ismime); ++ rc = mu_message_is_multipart (mach->msg, &ismime); ++ if (rc) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_is_multipart", ++ NULL, rc); + if (ismime) +- mu_message_get_num_parts (mach->msg, &clos.nparts); ++ { ++ rc = mu_message_get_num_parts (mach->msg, &clos.nparts); ++ if (rc) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", ++ NULL, rc); ++ } + } +- else +- clos.nparts = 0; + + rc = mu_sieve_vlist_compare (mach, h, v, retrieve_header, NULL, &clos); + return rc; +diff --git a/mail/decode.c b/mail/decode.c +index 869fe2f..647f8cf 100644 +--- a/mail/decode.c ++++ b/mail/decode.c +@@ -172,7 +172,6 @@ mime_descend (struct mime_descend_closure *closure, + mime_descend_fn fun, void *data) + { + int status = 0; +- size_t nparts = 0; + mu_header_t hdr = NULL; + char *type; + char *encoding; +@@ -195,23 +194,31 @@ mime_descend (struct mime_descend_closure *closure, + if (ismime) + { + unsigned int j; +- +- mu_message_get_num_parts (closure->message, &nparts); +- +- for (j = 1; j <= nparts; j++) ++ size_t nparts; ++ ++ status = mu_message_get_num_parts (closure->message, &nparts); ++ if (status) + { +- mu_message_t message = NULL; +- +- if (mu_message_get_part (closure->message, j, &message) == 0) ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, ++ status); ++ } ++ else ++ { ++ for (j = 1; j <= nparts; j++) + { +- msgset_t *set = msgset_expand (msgset_dup (closure->msgset), +- msgset_make_1 (j)); +- subclosure.msgset = set; +- subclosure.message = message; +- status = mime_descend (&subclosure, fun, data); +- msgset_free (set); +- if (status) +- break; ++ mu_message_t message = NULL; ++ ++ if (mu_message_get_part (closure->message, j, &message) == 0) ++ { ++ msgset_t *set = msgset_expand (msgset_dup (closure->msgset), ++ msgset_make_1 (j)); ++ subclosure.msgset = set; ++ subclosure.message = message; ++ status = mime_descend (&subclosure, fun, data); ++ msgset_free (set); ++ if (status) ++ break; ++ } + } + } + } +diff --git a/mh/burst.c b/mh/burst.c +index b512fa0..af04317 100644 +--- a/mh/burst.c ++++ b/mh/burst.c +@@ -75,8 +75,14 @@ int + burst_mime (mu_message_t msg) + { + size_t i, nparts; ++ int rc; + +- mu_message_get_num_parts (msg, &nparts); ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ return rc; ++ } + + for (i = 1; i <= nparts; i++) + { +diff --git a/mh/mhn.c b/mh/mhn.c +index 8559261..ebe0e75 100644 +--- a/mh/mhn.c ++++ b/mh/mhn.c +@@ -1047,9 +1047,15 @@ handle_message (mu_message_t msg, msg_part_t part, msg_handler_t fun, void *data + if (ismime) + { + size_t i, nparts; +- +- mu_message_get_num_parts (msg, &nparts); +- ++ int rc; ++ ++ rc = mu_message_get_num_parts (msg, &nparts); ++ if (rc) ++ { ++ mu_diag_funcall (MU_DIAG_ERR, "mu_message_get_num_parts", NULL, rc); ++ return rc; ++ } ++ + msg_part_incr (part); + for (i = 1; i <= nparts; i++) + { +-- +cgit v1.0-41-gc330 + Added: head/mail/mailutils/files/git-113e144 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/mailutils/files/git-113e144 Wed Jul 31 11:44:17 2019 (r507707) @@ -0,0 +1,38 @@ +From 113e144dedbebb5bc659eadc7f329450bb374606 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 23 Jul 2019 11:08:04 +0300 +Subject: Fix mandatory locking + +* lib/manlock.c (mailbox_open_and_lock): Force proper locker if +a null locker is associated with the mailbox. +--- + lib/manlock.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/lib/manlock.c b/lib/manlock.c +index 4a3b2be..392c581 100644 +--- a/lib/manlock.c ++++ b/lib/manlock.c +@@ -126,6 +126,19 @@ mailbox_open_and_lock (mu_mailbox_t mbox, int flags) + return MU_ERR_FAILURE; + } + ++ if (lock) ++ { ++ status = mu_locker_get_flags (lock, &flags); ++ if (status) ++ { ++ mu_diag_funcall (MU_DIAG_ERROR, "mu_locker_get_flags", urlstr, ++ status); ++ return MU_ERR_FAILURE; ++ } ++ if (flags & MU_LOCKER_NULL) ++ lock = NULL; ++ } ++ + if (!lock && manlock_mandatory_locking && manlock_lock_dir) + { + char *fname = NULL; +-- +cgit v1.0-41-gc330 +