From owner-dev-commits-ports-main@freebsd.org Sat Jun 19 08:48:19 2021 Return-Path: Delivered-To: dev-commits-ports-main@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 CEEEC655E1E; Sat, 19 Jun 2021 08:48:19 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G6Tw35BW9z4qTm; Sat, 19 Jun 2021 08:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9660512FF4; Sat, 19 Jun 2021 08:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15J8mJ54044951; Sat, 19 Jun 2021 08:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15J8mJrv044950; Sat, 19 Jun 2021 08:48:19 GMT (envelope-from git) Date: Sat, 19 Jun 2021 08:48:19 GMT Message-Id: <202106190848.15J8mJrv044950@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Hajimu UMEMOTO Subject: git: 2d1887b68b12 - main - mail/cyrus-imapd3[24]: NOTIFY(EVENT): datagram too large when using notifyd. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ume X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d1887b68b126bf7cec16962f807ac266dc4c4df Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2021 08:48:19 -0000 The branch main has been updated by ume: URL: https://cgit.FreeBSD.org/ports/commit/?id=2d1887b68b126bf7cec16962f807ac266dc4c4df commit 2d1887b68b126bf7cec16962f807ac266dc4c4df Author: Hajimu UMEMOTO AuthorDate: 2021-06-19 08:39:13 +0000 Commit: Hajimu UMEMOTO CommitDate: 2021-06-19 08:48:06 +0000 mail/cyrus-imapd3[24]: NOTIFY(EVENT): datagram too large when using notifyd. PR: 256478 Reported by: jsm --- mail/cyrus-imapd32/Makefile | 2 +- mail/cyrus-imapd32/files/patch-imap__notify.c | 45 +++++++++++++++++++++ mail/cyrus-imapd32/files/patch-notifyd__notifyd.c | 44 +++++++++++++++++++++ mail/cyrus-imapd34/Makefile | 2 +- mail/cyrus-imapd34/files/patch-imap__notify.c | 48 +++++++++++++++++++++++ mail/cyrus-imapd34/files/patch-notifyd__notifyd.c | 44 +++++++++++++++++++++ 6 files changed, 183 insertions(+), 2 deletions(-) diff --git a/mail/cyrus-imapd32/Makefile b/mail/cyrus-imapd32/Makefile index a5bce0236cfd..465c680cf5a0 100644 --- a/mail/cyrus-imapd32/Makefile +++ b/mail/cyrus-imapd32/Makefile @@ -1,6 +1,6 @@ PORTNAME= cyrus-imapd PORTVERSION= 3.2.7 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= https://github.com/cyrusimap/cyrus-imapd/releases/download/${PORTNAME}-${PORTVERSION}/ PKGNAMESUFFIX= 32 diff --git a/mail/cyrus-imapd32/files/patch-imap__notify.c b/mail/cyrus-imapd32/files/patch-imap__notify.c new file mode 100644 index 000000000000..17908c1c9f2f --- /dev/null +++ b/mail/cyrus-imapd32/files/patch-imap__notify.c @@ -0,0 +1,45 @@ +--- imap/notify.c.orig 2021-05-10 04:16:13 UTC ++++ imap/notify.c +@@ -49,6 +49,9 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + #include + #include + #include +@@ -191,6 +194,24 @@ EXPORTED void notify(const char *method, + FNAME_NOTIFY_SOCK, sizeof(sun_data.sun_path)); + } + ++#if defined(__FreeBSD__) ++ size_t maxsockbuf; ++ size_t len = sizeof(maxsockbuf); ++ r = sysctlbyname("kern.ipc.maxsockbuf", &maxsockbuf, &len, NULL, 0); ++ if (r == 0) { ++ bufsiz = MIN(maxsockbuf, NOTIFY_MAXSIZE); ++ } else { ++ syslog(LOG_WARNING, "unable to sysctlbyname(kern.ipc.maxsockbuf): %m"); ++ bufsiz = NOTIFY_MAXSIZE; ++ } ++ ++ optlen = sizeof(bufsiz); ++ r = setsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, optlen); ++ if (r == -1) { ++ syslog(LOG_WARNING, ++ "unable to setsockopt(SO_SNDBUF) on notify socket: %m"); ++ } ++#else + /* Get send buffer size */ + optlen = sizeof(bufsiz); + r = getsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, &optlen); +@@ -201,6 +222,7 @@ EXPORTED void notify(const char *method, + + /* Use minimum of 1/10 of send buffer size (-overhead) NOTIFY_MAXSIZE */ + bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE); ++#endif + + /* + * build request of the form: diff --git a/mail/cyrus-imapd32/files/patch-notifyd__notifyd.c b/mail/cyrus-imapd32/files/patch-notifyd__notifyd.c new file mode 100644 index 000000000000..0719b98c13f6 --- /dev/null +++ b/mail/cyrus-imapd32/files/patch-notifyd__notifyd.c @@ -0,0 +1,44 @@ +--- notifyd/notifyd.c.orig 2021-05-05 03:21:59 UTC ++++ notifyd/notifyd.c +@@ -50,6 +50,9 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + #include + #include + #include +@@ -111,6 +114,23 @@ static int do_notify(void) + unsigned bufsiz; + socklen_t optlen; + ++#if defined(__FreeBSD__) ++ size_t maxsockbuf; ++ size_t len = sizeof(maxsockbuf); ++ r = sysctlbyname("kern.ipc.maxsockbuf", &maxsockbuf, &len, NULL, 0); ++ if (r == 0) { ++ bufsiz = MIN(maxsockbuf, NOTIFY_MAXSIZE); ++ } else { ++ syslog(LOG_WARNING, "unable to sysctlbyname(kern.ipc.maxsockbuf): %m"); ++ bufsiz = NOTIFY_MAXSIZE; ++ } ++ ++ optlen = sizeof(bufsiz); ++ r = setsockopt(soc, SOL_SOCKET, SO_RCVBUF, &bufsiz, optlen); ++ if (r == -1) { ++ syslog(LOG_WARNING, "unable to setsockopt(SO_RCVBUF) on notify socket: %m"); ++ } ++#else + /* Get receive buffer size */ + optlen = sizeof(bufsiz); + r = getsockopt(soc, SOL_SOCKET, SO_RCVBUF, &bufsiz, &optlen); +@@ -121,6 +141,7 @@ static int do_notify(void) + + /* Use minimum of 1/10 of receive buffer size (-overhead) NOTIFY_MAXSIZE */ + bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE); ++#endif + + while (1) { + method = class = priority = user = mailbox = message = reply = NULL; diff --git a/mail/cyrus-imapd34/Makefile b/mail/cyrus-imapd34/Makefile index bd34281568e4..a8ccaa44d76a 100644 --- a/mail/cyrus-imapd34/Makefile +++ b/mail/cyrus-imapd34/Makefile @@ -1,6 +1,6 @@ PORTNAME= cyrus-imapd PORTVERSION= 3.4.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= https://github.com/cyrusimap/cyrus-imapd/releases/download/${PORTNAME}-${PORTVERSION}/ PKGNAMESUFFIX= ${CYRUS_IMAPD_VER} diff --git a/mail/cyrus-imapd34/files/patch-imap__notify.c b/mail/cyrus-imapd34/files/patch-imap__notify.c new file mode 100644 index 000000000000..e093378fc10d --- /dev/null +++ b/mail/cyrus-imapd34/files/patch-imap__notify.c @@ -0,0 +1,48 @@ +--- imap/notify.c.orig 2021-05-10 04:34:24 UTC ++++ imap/notify.c +@@ -49,6 +49,9 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + #include + #include + #include +@@ -209,6 +212,27 @@ EXPORTED void notify(const char *method, + FNAME_NOTIFY_SOCK, sizeof(sun_data.sun_path)); + } + ++#if defined(__FreeBSD__) ++ size_t maxsockbuf; ++ size_t len = sizeof(maxsockbuf); ++ r = sysctlbyname("kern.ipc.maxsockbuf", &maxsockbuf, &len, NULL, 0); ++ if (r == 0) { ++ bufsiz = MIN(maxsockbuf, NOTIFY_MAXSIZE); ++ } else { ++ syslog(LOG_WARNING, ++ "NOTIFY(%s): unable to sysctlbyname(kern.ipc.maxsockbuf): %m", ++ loginfo); ++ bufsiz = NOTIFY_MAXSIZE; ++ } ++ ++ optlen = sizeof(bufsiz); ++ r = setsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, optlen); ++ if (r == -1) { ++ syslog(LOG_WARNING, ++ "NOTIFY(%s): unable to setsockopt(SO_SNDBUF) on socket: %m", ++ loginfo); ++ } ++#else + /* Get send buffer size */ + optlen = sizeof(bufsiz); + r = getsockopt(soc, SOL_SOCKET, SO_SNDBUF, &bufsiz, &optlen); +@@ -221,6 +245,7 @@ EXPORTED void notify(const char *method, + + /* Use minimum of 1/10 of send buffer size (-overhead) NOTIFY_MAXSIZE */ + bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE); ++#endif + + /* + * build request of the form: diff --git a/mail/cyrus-imapd34/files/patch-notifyd__notifyd.c b/mail/cyrus-imapd34/files/patch-notifyd__notifyd.c new file mode 100644 index 000000000000..0719b98c13f6 --- /dev/null +++ b/mail/cyrus-imapd34/files/patch-notifyd__notifyd.c @@ -0,0 +1,44 @@ +--- notifyd/notifyd.c.orig 2021-05-05 03:21:59 UTC ++++ notifyd/notifyd.c +@@ -50,6 +50,9 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + #include + #include + #include +@@ -111,6 +114,23 @@ static int do_notify(void) + unsigned bufsiz; + socklen_t optlen; + ++#if defined(__FreeBSD__) ++ size_t maxsockbuf; ++ size_t len = sizeof(maxsockbuf); ++ r = sysctlbyname("kern.ipc.maxsockbuf", &maxsockbuf, &len, NULL, 0); ++ if (r == 0) { ++ bufsiz = MIN(maxsockbuf, NOTIFY_MAXSIZE); ++ } else { ++ syslog(LOG_WARNING, "unable to sysctlbyname(kern.ipc.maxsockbuf): %m"); ++ bufsiz = NOTIFY_MAXSIZE; ++ } ++ ++ optlen = sizeof(bufsiz); ++ r = setsockopt(soc, SOL_SOCKET, SO_RCVBUF, &bufsiz, optlen); ++ if (r == -1) { ++ syslog(LOG_WARNING, "unable to setsockopt(SO_RCVBUF) on notify socket: %m"); ++ } ++#else + /* Get receive buffer size */ + optlen = sizeof(bufsiz); + r = getsockopt(soc, SOL_SOCKET, SO_RCVBUF, &bufsiz, &optlen); +@@ -121,6 +141,7 @@ static int do_notify(void) + + /* Use minimum of 1/10 of receive buffer size (-overhead) NOTIFY_MAXSIZE */ + bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE); ++#endif + + while (1) { + method = class = priority = user = mailbox = message = reply = NULL;