From nobody Fri May 26 14:18:02 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSRpf5Ddzz4WnTn; Fri, 26 May 2023 14:18:02 +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 4QSRpf50b7z3mX1; Fri, 26 May 2023 14:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685110682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UleiLj7bHdp3VQAvQCIZtrgIY4X1u4tKl60ZZS/svs=; b=DCmU++/di75KIeJWoLjjmJ/XKb4aGx418e14bxPHv7GjAnGS3ThCCUtmjiOMrK4rgZF3g6 KIrixaz5/HgBUtwAaSgVpM25u6eB56RkUYVfD5DJJhH7Be13kxMvbwRpYKTPWoW6B/hyAS yQq4XojKA1crryqIWs1UWZYO9HCw7FunW5+RzDh4n5jH2L0ot9iShz3RenYLJz5m+nEndK ILqIxQ/7xExDdUPHs0jlmyxO0Mm2Ad1VcIkVckbLGqqfSmYneqFOZz1gzmzugaee8wZV9n mrsA/ovMxN+7S0MI4Xx6LSAQt8C4jw0jMqPEtoUUi0CXrsnZJEzJWD/nJnPABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685110682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UleiLj7bHdp3VQAvQCIZtrgIY4X1u4tKl60ZZS/svs=; b=wbWXf4NcHbPurJ0Wd51uGl5k57PT6B3FP6Xh1UU+kGhQWTL/emT/mNqJbZPnRUth1lrIUx 4em+1fpavASCEQKuEQU17tHf8+GlFat8ewxchXBwAqZ231Q+Q9gpjL/M8Vj2dcWZt60FOn 7rRdZk/pg2K8FQoRociSkw+72NHDtebNOY6Hj0F3Iw17CYvn+T3dgcahfacKNtUYSco/3c fV2GAIXWCJRssmVWcLvqZ8Fd/PxHswUmEhiOiOoRAQG/iSCqCVMeELvIY5p3ms3hH4vu/b A+Yl5JsjEgw1YUIvN158czn/LnXmv+cGXExv+hKoBGfHr1fiCgahs08fvbsaxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685110682; a=rsa-sha256; cv=none; b=uqA5YrYp7Z8jUuWMZkoBwCt5Mx413W2tYTXjsNNrtEDWtl3MnM4wCFRc3bifGRSvYjgQ84 hIUBUz+b9OIYyP5WWB9hZTTWadwptLauKEGd59xOMtsGblbmG7EPFXIg+TaPvSOPrSyHtJ 2knUdLRY95xzcCW83eD0wclBveB1/5fco1gMeAWDp17fOBk+K0ButolpAJwIZHhCE7pwCH Kk2eBXIgEt5Kzm8RqnzfUoA/JoxCPmd2o0fO1q//naqTLkjLe4xsXJQ1K/dx50h/OMtLoF cnROLR5GsGakYJ8AKteQlYQnKdBwq+JUFjToWUJN6/UZNKZkEMamJuubdU9z7g== 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 4QSRpf3x7gz18yr; Fri, 26 May 2023 14:18:02 +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 34QEI2fu022786; Fri, 26 May 2023 14:18:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QEI2YO022785; Fri, 26 May 2023 14:18:02 GMT (envelope-from git) Date: Fri, 26 May 2023 14:18:02 GMT Message-Id: <202305261418.34QEI2YO022785@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kurt Jaeger Subject: git: 985788b37e14 - main - mail/exim: update 4.95 -> 4.96 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pi X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 985788b37e14798739af343e2f5a7dfdf7d59b62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pi: URL: https://cgit.FreeBSD.org/ports/commit/?id=985788b37e14798739af343e2f5a7dfdf7d59b62 commit 985788b37e14798739af343e2f5a7dfdf7d59b62 Author: Kurt Jaeger AuthorDate: 2023-05-26 14:14:00 +0000 Commit: Kurt Jaeger CommitDate: 2023-05-26 14:14:00 +0000 mail/exim: update 4.95 -> 4.96 PR: 265098 Obtained-from: https://salsa.debian.org/exim-team/exim4/-/blob/master/debian/patches/ Reported-by: vvd Approved-by: fluffy Reviewed-by: drs-freebsd@sieborger.nom.za Tested-by: pi, drs-freebsd@sieborger.nom.za Changes: https://lists.exim.org/lurker/message/20220625.141825.d6de6074.en.html --- UPDATING | 12 + mail/exim/Makefile | 46 +- mail/exim/distinfo | 6 +- ...ng-gettimeofday-select-per-char-for-cmdli.patch | 616 -------------- .../debian/75_32-Fix-PAM-auth.-Bug-2813.patch | 25 - ...5_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch | 42 - ...vert-all-uses-of-select-to-poll.-Bug-2831.patch | 931 --------------------- ...-Fix-basic-memory-use-for-SPARC.-Bug-2838.patch | 140 ---- .../files/debian/75_43-BSD-fix-resource-leak.patch | 61 -- ...45-Fix-bogus-error-message-copy.-Bug-2857.patch | 38 - ...e_directory-in-redirect-routers.-Bug-2715.patch | 62 -- .../75_55-Specific-check-for-null-pointer.patch | 67 -- mail/exim/files/patch-OS__Makefile-Default | 10 - mail/exim/files/patch-OS__Makefile-FreeBSD | 20 +- mail/exim/files/patch-OS_os.c-FreeBSD | 15 - mail/exim/files/patch-src-dmarc.c | 19 - mail/exim/files/tls/patch-tls1 | 43 - mail/exim/files/tls/patch-tls2 | 174 ---- 18 files changed, 53 insertions(+), 2274 deletions(-) diff --git a/UPDATING b/UPDATING index af8d5c6223df..44b8585aca63 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,18 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20230526: + AFFECTS: users of mail/exim + AUTHOR: pi@FreeBSD.org + + The port changes from USE_DB to USE_NDBM. Any existing configuration like + ${lookup{$needle}dbm{haystack.db}} + will need to change to + ${lookup{$needle}dbm{haystack}}. + + Please also rename your old DBM files while the exim daemon is stopped: + find /var/spool/exim/db/* -not -name \*.lockfile -exec mv -i {} {}.db \; + 20230513: AFFECTS: users of www/tt-rss AUTHOR: dereks@lifeofadishwasher.com diff --git a/mail/exim/Makefile b/mail/exim/Makefile index ad06672afa63..45d5209d7a2a 100644 --- a/mail/exim/Makefile +++ b/mail/exim/Makefile @@ -1,6 +1,6 @@ PORTNAME= exim PORTVERSION?= ${EXIM_VERSION} -PORTREVISION?= 7 +PORTREVISION?= 0 CATEGORIES= mail MASTER_SITES= EXIM:exim MASTER_SITE_SUBDIR= /exim4/:exim \ @@ -66,20 +66,30 @@ SQLITE_USES= pkgconfig sqlite DEBIAN_PATCHES_PREFIX= ${FILESDIR}/debian/75 EXTRA_PATCHES= \ - ${DEBIAN_PATCHES_PREFIX}_30-Avoid-calling-gettimeofday-select-per-char-for-cmdli.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_32-Fix-PAM-auth.-Bug-2813.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_38-Convert-all-uses-of-select-to-poll.-Bug-2831.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_40-Fix-basic-memory-use-for-SPARC.-Bug-2838.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_43-BSD-fix-resource-leak.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_45-Fix-bogus-error-message-copy.-Bug-2857.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_50-Fix-include_directory-in-redirect-routers.-Bug-2715.patch:-p1 \ - ${DEBIAN_PATCHES_PREFIX}_55-Specific-check-for-null-pointer.patch:-p1 - -TLS_PATCHES_PREFIX= ${FILESDIR}/tls/ -EXTRA_PATCHES+= \ - ${TLS_PATCHES_PREFIX}patch-tls1:-p1 \ - ${TLS_PATCHES_PREFIX}patch-tls2:-p1 + ${DEBIAN_PATCHES_PREFIX}_01-Fix-exit-on-attempt-to-rewrite-a-malformed-address.-.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_05-SPF-fix-memory-accounting-for-error-case.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_08-Fix-regex-n-use-after-free.-Bug-2915.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_09-Fix-non-WITH_CONTENT_SCAN-build.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_10-Fix-non-WITH_CONTENT_SCAN-build-2.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_11-Fix-non-WITH_CONTENT_SCAN-build-3.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_16-GnuTLS-fix-for-clients-offering-no-TLS-extensions.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_18-Fix-Build-with-libopendmarc-1.4.x-fixes-2728.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_19-DMARC-fix-use-after-free-in-dmarc_dns_lookup.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_22-Fix-daemon-startup.-Bug-2930.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_23-Fix-reccipients-after-run.-.-Bug-2929.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_31-Fix-regext-substring-capture-variables-for-null-matc.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_32-Fix-regex-substring-capture-variables-for-null-match.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_34-Fix-regex-substring-capture-commentary.-Bug-2933.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_37-OpenSSL-when-preloading-creds-do-the-server-certs-be.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_38-OpenSSL-fix-double-expansion-of-tls_verify_certifica.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_50-Fix-logging-of-max-size-log-line.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_55-Fix-recursion-on-dns_again_means_nonexist.-Bug-2911.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_58-Close-server-smtp-socket-explicitly-on-connect-ACL-d.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_60-OpenSSL-fix-tls_eccurve-setting-explicit-curve-group.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_62-OpenSSL-Fix-tls_eccurve-on-earlier-versions-than-3.0.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_63-OpenSSL-log-conns-rejected-for-bad-ALPN-with-the-off.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_64-DANE-do-not-check-dns_again_means_nonexist-for-TLSA-.patch:-p1 \ + ${DEBIAN_PATCHES_PREFIX}_66-Fix-crash-in-expansions.patch:-p1 .include @@ -120,7 +130,7 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Local-sa-exim.c EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Local-sa-exim.conf .endif -EXIM_VERSION= 4.95 +EXIM_VERSION= 4.96 SA_EXIM_VERSION=4.2.1 EXIM_INSTALL_ARG+= "-no_chown" "-no_symlink" EXTRA_PATCHES+= `${FIND} ${PATCHDIR} -name '74_*.patch'|${SORT} -h` @@ -210,7 +220,7 @@ WITH_DEFAULT_CHARSET?= ISO-8859-1 # You should not need to fiddle with anything below this point. -LIB_DEPENDS+= libpcre.so:devel/pcre +LIB_DEPENDS+= libpcre2-posix.so:devel/pcre2 .if ! ${PORT_OPTIONS:MDKIM} SEDLIST+= -e 's,^\# (DISABLE_DKIM=),\1,' @@ -601,8 +611,6 @@ do-configure: @${REINPLACE_CMD} -e 's,/usr/bin/spamc,${LOCALBASE}/bin/spamc,' \ ${WRKSRC}/Local/sa-exim.conf .endif - @${REINPLACE_CMD} -E -e 's/XX_STRIPCMD_XX/${STRIP_CMD:S,/,\/,g}/' \ - ${WRKSRC}/OS/Makefile-FreeBSD @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} configure) post-build: diff --git a/mail/exim/distinfo b/mail/exim/distinfo index c007834ea4bb..eb6b96ef513f 100644 --- a/mail/exim/distinfo +++ b/mail/exim/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1632918983 -SHA256 (exim/exim-4.95.tar.bz2) = 7f4716cc1b3fee66930d83b249f1c7b119fa1957f6f46e3f4372805cbc97ea63 -SIZE (exim/exim-4.95.tar.bz2) = 2035738 +TIMESTAMP = 1681024359 +SHA256 (exim/exim-4.96.tar.bz2) = c7a413fec601cc44a8f5fe9e5b64cb24a7d133f3a4a976f33741d98ff0ec6b91 +SIZE (exim/exim-4.96.tar.bz2) = 2047632 SHA256 (exim/sa-exim-4.2.1.tar.gz) = 24d4bf7b0fdddaea11f132981cebb6a86a4ab20ef54111a8ebd481b421c6e2c1 SIZE (exim/sa-exim-4.2.1.tar.gz) = 68933 diff --git a/mail/exim/files/debian/75_30-Avoid-calling-gettimeofday-select-per-char-for-cmdli.patch b/mail/exim/files/debian/75_30-Avoid-calling-gettimeofday-select-per-char-for-cmdli.patch deleted file mode 100644 index ac72e532ebea..000000000000 --- a/mail/exim/files/debian/75_30-Avoid-calling-gettimeofday-select-per-char-for-cmdli.patch +++ /dev/null @@ -1,616 +0,0 @@ -From 1843f70b733127fcba3321d9d69359e05905f8cc Mon Sep 17 00:00:00 2001 -From: Jeremy Harris -Date: Sat, 16 Oct 2021 00:12:16 +0100 -Subject: [PATCH] Avoid calling gettimeofday(), select() per char for cmdline - message submission. Bug 2819 - -Broken-by: 3c55eef240 ---- - doc/ChangeLog | 4 ++ - src/exim.c | 7 ++- - src/filtertest.c | 16 +++---- - src/functions.h | 4 ++ - src/globals.c | 21 +++++---- - src/globals.h | 3 ++ - src/receive.c | 78 ++++++++++++++++++++++------------ - src/smtp_in.c | 24 ++++++++++- - src/tls-gnu.c | 9 ++++ - src/tls-openssl.c | 8 ++++ - src/transports/autoreply.c | 13 +++--- - 11 files changed, 133 insertions(+), 54 deletions(-) - ---- a/doc/ChangeLog -+++ b/doc/ChangeLog -@@ -1,9 +1,13 @@ - This document describes *changes* to previous versions, that might - affect Exim's operation, with an unchanged configuration file. For new - options, and new features, see the NewStuff file next to this ChangeLog. - -+JH/05 Bug 2819: speed up command-line messages being read in. Previously a -+ time check was being done for every character; replace that with one -+ per buffer. -+ - - Exim version 4.95 - ----------------- - - JH/01 Bug 1329: Fix format of Maildir-format filenames to match other mail- ---- a/src/exim.c -+++ b/src/exim.c -@@ -5382,11 +5382,11 @@ - - if (smtp_input) - { - if (!f.is_inetd) set_process_info("accepting a local %sSMTP message from <%s>", - smtp_batched_input? "batched " : "", -- (sender_address!= NULL)? sender_address : originator_login); -+ sender_address ? sender_address : originator_login); - } - else - { - int old_pool = store_pool; - store_pool = POOL_PERM; -@@ -5432,11 +5432,12 @@ - mac_smtp_fflush(); - exim_exit(EXIT_SUCCESS); - } - } - --/* Otherwise, set up the input size limit here. */ -+/* Otherwise, set up the input size limit here and set no stdin stdio buffer -+(we handle buferring so as to have visibility of fill level). */ - - else - { - thismessage_size_limit = expand_string_integer(message_size_limit, TRUE); - if (expand_string_message) -@@ -5444,10 +5445,12 @@ - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to expand " - "message_size_limit: %s", expand_string_message); - else - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "invalid value for " - "message_size_limit: %s", expand_string_message); -+ -+ setvbuf(stdin, NULL, _IONBF, 0); - } - - /* Loop for several messages when reading SMTP input. If we fork any child - processes, we don't want to wait for them unless synchronous delivery is - requested, so set SIGCHLD to SIG_IGN in that case. This is not necessarily the ---- a/src/filtertest.c -+++ b/src/filtertest.c -@@ -43,15 +43,15 @@ - s = message_body_end; - body_len = 0; - body_linecount = 0; - header_size = message_size; - --if (!dot_ended && !feof(stdin)) -+if (!dot_ended && !stdin_feof()) - { - if (!f.dot_ends) - { -- while ((ch = getc(stdin)) != EOF) -+ while ((ch = stdin_getc(GETC_BUFFER_UNLIMITED)) != EOF) - { - if (ch == 0) body_zerocount++; - if (ch == '\n') body_linecount++; - if (body_len < message_body_visible) message_body[body_len++] = ch; - *s++ = ch; -@@ -60,11 +60,11 @@ - } - } - else - { - int ch_state = 1; -- while ((ch = getc(stdin)) != EOF) -+ while ((ch = stdin_getc(GETC_BUFFER_UNLIMITED)) != EOF) - { - if (ch == 0) body_zerocount++; - switch (ch_state) - { - case 0: /* Normal state */ -@@ -97,10 +97,11 @@ - } - READ_END: ; - } - if (s == message_body_end || s[-1] != '\n') body_linecount++; - } -+debug_printf("%s %d\n", __FUNCTION__, __LINE__); - - message_body[body_len] = 0; - message_body_size = message_size - header_size; - - /* body_len stops at message_body_visible; it if got there, we may have -@@ -248,11 +249,11 @@ - } - - /* For a filter, set up the message_body variables and the message size if this - is the first time this function has been called. */ - --if (message_body == NULL) read_message_body(dot_ended); -+if (!message_body) read_message_body(dot_ended); - - /* Now pass the filter file to the function that interprets it. Because - filter_test is not FILTER_NONE, the interpreter will output comments about what - it is doing. No need to clean up store. Indeed, we must not, because we may be - testing a system filter that is going to be followed by a user filter test. */ -@@ -267,14 +268,13 @@ - f.enable_dollar_recipients = FALSE; - f.system_filtering = FALSE; - } - else - { -- yield = (filter_type == FILTER_SIEVE)? -- sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, NULL, &generated, &error) -- : -- filter_interpret(filebuf, RDO_REWRITE, &generated, &error); -+ yield = filter_type == FILTER_SIEVE -+ ? sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, NULL, &generated, &error) -+ : filter_interpret(filebuf, RDO_REWRITE, &generated, &error); - } - - return yield != FF_ERROR; - } - ---- a/src/functions.h -+++ b/src/functions.h -@@ -66,10 +66,11 @@ - extern uschar *tls_field_from_dn(uschar *, const uschar *); - extern void tls_free_cert(void **); - extern int tls_getc(unsigned); - extern uschar *tls_getbuf(unsigned *); - extern void tls_get_cache(unsigned); -+extern BOOL tls_hasc(void); - extern BOOL tls_import_cert(const uschar *, void **); - extern BOOL tls_is_name_for_cert(const uschar *, void *); - # ifdef USE_OPENSSL - extern BOOL tls_openssl_options_parse(uschar *, long *); - # endif -@@ -148,10 +149,11 @@ - extern uschar *b64encode(const uschar *, int); - extern uschar *b64encode_taint(const uschar *, int, BOOL); - extern int b64decode(const uschar *, uschar **); - extern int bdat_getc(unsigned); - extern uschar *bdat_getbuf(unsigned *); -+extern BOOL bdat_hasc(void); - extern int bdat_ungetc(int); - extern void bdat_flush_data(void); - - extern void bits_clear(unsigned int *, size_t, int *); - extern void bits_set(unsigned int *, size_t, int *); -@@ -492,10 +494,11 @@ - uschar **, uschar *); - extern BOOL smtp_get_port(uschar *, address_item *, int *, uschar *); - extern int smtp_getc(unsigned); - extern uschar *smtp_getbuf(unsigned *); - extern void smtp_get_cache(unsigned); -+extern BOOL smtp_hasc(void); - extern int smtp_handle_acl_fail(int, int, uschar *, uschar *); - extern void smtp_log_no_mail(void); - extern void smtp_message_code(uschar **, int *, uschar **, uschar **, BOOL); - extern void smtp_proxy_tls(void *, uschar *, size_t, int *, int) NORETURN; - extern BOOL smtp_read_response(void *, uschar *, int, int, int); -@@ -521,10 +524,11 @@ - extern uschar *spool_sender_from_msgid(const uschar *); - extern int spool_write_header(uschar *, int, uschar **); - extern int stdin_getc(unsigned); - extern int stdin_feof(void); - extern int stdin_ferror(void); -+extern BOOL stdin_hasc(void); - extern int stdin_ungetc(int); - - extern void store_exit(void); - extern void store_init(void); - extern void store_writeprotect(int); ---- a/src/globals.c -+++ b/src/globals.c -@@ -169,20 +169,23 @@ - /* Input-reading functions for messages, so we can use special ones for - incoming TCP/IP. The defaults use stdin. We never need these for any - stand-alone tests. */ - - #if !defined(STAND_ALONE) && !defined(MACRO_PREDEF) --int (*lwr_receive_getc)(unsigned) = stdin_getc; -+int (*lwr_receive_getc)(unsigned) = stdin_getc; - uschar * (*lwr_receive_getbuf)(unsigned *) = NULL; --int (*lwr_receive_ungetc)(int) = stdin_ungetc; --int (*receive_getc)(unsigned) = stdin_getc; --uschar * (*receive_getbuf)(unsigned *) = NULL; --void (*receive_get_cache)(unsigned) = NULL; --int (*receive_ungetc)(int) = stdin_ungetc; --int (*receive_feof)(void) = stdin_feof; --int (*receive_ferror)(void) = stdin_ferror; --BOOL (*receive_smtp_buffered)(void) = NULL; /* Only used for SMTP */ -+int (*lwr_receive_ungetc)(int) = stdin_ungetc; -+BOOL (*lwr_receive_hasc)(void) = stdin_hasc; -+ -+int (*receive_getc)(unsigned) = stdin_getc; -+uschar * (*receive_getbuf)(unsigned *) = NULL; -+void (*receive_get_cache)(unsigned) = NULL; -+BOOL (*receive_hasc)(void) = stdin_hasc; -+int (*receive_ungetc)(int) = stdin_ungetc; -+int (*receive_feof)(void) = stdin_feof; -+int (*receive_ferror)(void) = stdin_ferror; -+BOOL (*receive_smtp_buffered)(void) = NULL; /* Only used for SMTP */ - #endif - - - /* List of per-address expansion variables for clearing and saving/restoring - when verifying one address while routing/verifying another. We have to have ---- a/src/globals.h -+++ b/src/globals.h -@@ -159,13 +159,16 @@ - /* Input-reading functions for messages, so we can use special ones for - incoming TCP/IP. */ - - extern int (*lwr_receive_getc)(unsigned); - extern uschar * (*lwr_receive_getbuf)(unsigned *); -+extern BOOL (*lwr_receive_hasc)(void); - extern int (*lwr_receive_ungetc)(int); -+ - extern int (*receive_getc)(unsigned); - extern uschar * (*receive_getbuf)(unsigned *); -+extern BOOL (*receive_hasc)(void); - extern void (*receive_get_cache)(unsigned); - extern int (*receive_ungetc)(int); - extern int (*receive_feof)(void); - extern int (*receive_ferror)(void); - extern BOOL (*receive_smtp_buffered)(void); ---- a/src/receive.c -+++ b/src/receive.c -@@ -42,46 +42,75 @@ - /* These are the default functions that are set up in the variables such as - receive_getc initially. They just call the standard functions, passing stdin as - the file. (When SMTP input is occurring, different functions are used by - changing the pointer variables.) */ - -+uschar stdin_buf[4096]; -+uschar * stdin_inptr = stdin_buf; -+uschar * stdin_inend = stdin_buf; -+ -+static BOOL -+stdin_refill(void) -+{ -+size_t rc = fread(stdin_buf, 1, sizeof(stdin_buf), stdin); -+if (rc <= 0) -+ { -+ if (had_data_timeout) -+ { -+ fprintf(stderr, "exim: timed out while reading - message abandoned\n"); -+ log_write(L_lost_incoming_connection, -+ LOG_MAIN, "timed out while reading local message"); -+ receive_bomb_out(US"data-timeout", NULL); /* Does not return */ -+ } -+ if (had_data_sigint) -+ { -+ if (filter_test == FTEST_NONE) -+ { -+ fprintf(stderr, "\nexim: %s received - message abandoned\n", -+ had_data_sigint == SIGTERM ? "SIGTERM" : "SIGINT"); -+ log_write(0, LOG_MAIN, "%s received while reading local message", -+ had_data_sigint == SIGTERM ? "SIGTERM" : "SIGINT"); -+ } -+ receive_bomb_out(US"signal-exit", NULL); /* Does not return */ -+ } -+ return FALSE; -+ } -+stdin_inend = stdin_buf + rc; -+stdin_inptr = stdin_buf; -+return TRUE; -+} -+ - int - stdin_getc(unsigned lim) - { --int c = getc(stdin); -+if (stdin_inptr >= stdin_inend) -+ if (!stdin_refill()) -+ return EOF; -+return *stdin_inptr++; -+} - --if (had_data_timeout) -- { -- fprintf(stderr, "exim: timed out while reading - message abandoned\n"); -- log_write(L_lost_incoming_connection, -- LOG_MAIN, "timed out while reading local message"); -- receive_bomb_out(US"data-timeout", NULL); /* Does not return */ -- } --if (had_data_sigint) -- { -- if (filter_test == FTEST_NONE) -- { -- fprintf(stderr, "\nexim: %s received - message abandoned\n", -- had_data_sigint == SIGTERM ? "SIGTERM" : "SIGINT"); -- log_write(0, LOG_MAIN, "%s received while reading local message", -- had_data_sigint == SIGTERM ? "SIGTERM" : "SIGINT"); -- } -- receive_bomb_out(US"signal-exit", NULL); /* Does not return */ -- } --return c; -+ -+BOOL -+stdin_hasc(void) -+{ -+return stdin_inptr < stdin_inend; - } - - int - stdin_ungetc(int c) - { --return ungetc(c, stdin); -+if (stdin_inptr <= stdin_buf) -+ log_write(0, LOG_MAIN|LOG_PANIC_DIE, "buffer underflow in stdin_ungetc"); -+ -+*--stdin_inptr = c; -+return c; - } - - int - stdin_feof(void) - { --return feof(stdin); -+return stdin_hasc() ? FALSE : feof(stdin); - } - - int - stdin_ferror(void) - { -@@ -586,11 +615,11 @@ - the file copy. */ - - static void - log_close_chk(void) - { --if (!receive_timeout) -+if (!receive_timeout && !receive_hasc()) - { - struct timeval t; - timesince(&t, &received_time); - if (t.tv_sec > 30*60) - mainlog_close(); -@@ -652,15 +681,10 @@ - - if (!f.dot_ends) - { - int last_ch = '\n'; - --/*XXX we do a gettimeofday before checking for every received char, --which is hardly clever. The function-indirection doesn't help, but --an additional function to check for nonempty read buffer would help. --See stdin_getc() / smtp_getc() / tls_getc() / bdat_getc(). */ -- - for ( ; - log_close_chk(), (ch = (receive_getc)(GETC_BUFFER_UNLIMITED)) != EOF; - last_ch = ch) - { - if (ch == 0) body_zerocount++; ---- a/src/smtp_in.c -+++ b/src/smtp_in.c -@@ -561,10 +561,16 @@ - if (!smtp_refill(lim)) - return EOF; - return *smtp_inptr++; - } - -+BOOL -+smtp_hasc(void) -+{ -+return smtp_inptr < smtp_inend; -+} -+ - uschar * - smtp_getbuf(unsigned * len) - { - unsigned size; - uschar * buf; -@@ -743,10 +749,18 @@ - } - } - } - } - -+BOOL -+bdat_hasc(void) -+{ -+if (chunking_data_left > 0) -+ return lwr_receive_hasc(); -+return TRUE; -+} -+ - uschar * - bdat_getbuf(unsigned * len) - { - uschar * buf; - -@@ -782,40 +796,44 @@ - bdat_push_receive_functions(void) - { - /* push the current receive_* function on the "stack", and - replace them by bdat_getc(), which in turn will use the lwr_receive_* - functions to do the dirty work. */ --if (lwr_receive_getc == NULL) -+if (!lwr_receive_getc) - { - lwr_receive_getc = receive_getc; - lwr_receive_getbuf = receive_getbuf; -+ lwr_receive_hasc = receive_hasc; - lwr_receive_ungetc = receive_ungetc; - } - else - { - DEBUG(D_receive) debug_printf("chunking double-push receive functions\n"); - } - - receive_getc = bdat_getc; - receive_getbuf = bdat_getbuf; -+receive_hasc = bdat_hasc; - receive_ungetc = bdat_ungetc; - } - - static inline void - bdat_pop_receive_functions(void) - { --if (lwr_receive_getc == NULL) -+if (!lwr_receive_getc) - { - DEBUG(D_receive) debug_printf("chunking double-pop receive functions\n"); - return; - } - receive_getc = lwr_receive_getc; - receive_getbuf = lwr_receive_getbuf; -+receive_hasc = lwr_receive_hasc; - receive_ungetc = lwr_receive_ungetc; - - lwr_receive_getc = NULL; - lwr_receive_getbuf = NULL; -+lwr_receive_hasc = NULL; - lwr_receive_ungetc = NULL; - } - - /************************************************* - * SMTP version of ungetc() * -@@ -2574,16 +2592,18 @@ - smtp_inbuffer[IN_BUFFER_SIZE-1] = '\0'; - - receive_getc = smtp_getc; - receive_getbuf = smtp_getbuf; - receive_get_cache = smtp_get_cache; -+receive_hasc = smtp_hasc; - receive_ungetc = smtp_ungetc; - receive_feof = smtp_feof; - receive_ferror = smtp_ferror; - receive_smtp_buffered = smtp_buffered; - lwr_receive_getc = NULL; - lwr_receive_getbuf = NULL; -+lwr_receive_hasc = NULL; - lwr_receive_ungetc = NULL; - smtp_inptr = smtp_inend = smtp_inbuffer; - smtp_had_eof = smtp_had_error = 0; - - /* Set up the message size limit; this may be host-specific */ ---- a/src/tls-gnu.c -+++ b/src/tls-gnu.c -@@ -3136,10 +3136,11 @@ - state->xfer_buffer = store_malloc(ssl_xfer_buffer_size); - - receive_getc = tls_getc; - receive_getbuf = tls_getbuf; - receive_get_cache = tls_get_cache; -+receive_hasc = tls_hasc; - receive_ungetc = tls_ungetc; - receive_feof = tls_feof; - receive_ferror = tls_ferror; - receive_smtp_buffered = tls_smtp_buffered; - -@@ -3738,10 +3739,11 @@ - if (!ct_ctx) /* server */ - { - receive_getc = smtp_getc; - receive_getbuf = smtp_getbuf; - receive_get_cache = smtp_get_cache; -+ receive_hasc = smtp_hasc; - receive_ungetc = smtp_ungetc; - receive_feof = smtp_feof; - receive_ferror = smtp_ferror; - receive_smtp_buffered = smtp_buffered; - } -@@ -3852,10 +3854,17 @@ - /* Something in the buffer; return next uschar */ - - return state->xfer_buffer[state->xfer_buffer_lwm++]; - } - -+BOOL -+tls_hasc(void) -+{ -+exim_gnutls_state_st * state = &state_server; -+return state->xfer_buffer_lwm < state->xfer_buffer_hwm; -+} -+ - uschar * - tls_getbuf(unsigned * len) - { - exim_gnutls_state_st * state = &state_server; - unsigned size; ---- a/src/tls-openssl.c -+++ b/src/tls-openssl.c -@@ -3348,10 +3348,11 @@ - ssl_xfer_eof = ssl_xfer_error = FALSE; - - receive_getc = tls_getc; - receive_getbuf = tls_getbuf; - receive_get_cache = tls_get_cache; -+receive_hasc = tls_hasc; - receive_ungetc = tls_ungetc; - receive_feof = tls_feof; - receive_ferror = tls_ferror; - receive_smtp_buffered = tls_smtp_buffered; - -@@ -4124,10 +4125,16 @@ - /* Something in the buffer; return next uschar */ - - return ssl_xfer_buffer[ssl_xfer_buffer_lwm++]; - } - -+BOOL -+tls_hasc(void) -+{ -+return ssl_xfer_buffer_lwm < ssl_xfer_buffer_hwm; -+} -+ - uschar * - tls_getbuf(unsigned * len) - { - unsigned size; - uschar * buf; -@@ -4413,10 +4420,11 @@ - #endif - - receive_getc = smtp_getc; - receive_getbuf = smtp_getbuf; - receive_get_cache = smtp_get_cache; -+ receive_hasc = smtp_hasc; - receive_ungetc = smtp_ungetc; - receive_feof = smtp_feof; - receive_ferror = smtp_ferror; - receive_smtp_buffered = smtp_buffered; - tls_in.active.tls_ctx = NULL; ---- a/src/transports/autoreply.c -+++ b/src/transports/autoreply.c -@@ -644,10 +644,11 @@ - if (text[Ustrlen(text)-1] != '\n') fprintf(fp, "\n"); - } - - if (ff) - { -+debug_printf("%s %d: ff\n", __FUNCTION__, __LINE__); - while (Ufgets(big_buffer, big_buffer_size, ff) != NULL) - { - if (file_expand) - { - uschar *s = expand_string(big_buffer); -@@ -667,16 +668,16 @@ - /* Copy the original message if required, observing the return size - limit if we are returning the body. */ - - if (return_message) - { -- uschar *rubric = (tblock->headers_only)? -- US"------ This is a copy of the message's header lines.\n" -- : (tblock->body_only)? -- US"------ This is a copy of the body of the message, without the headers.\n" -- : -- US"------ This is a copy of the message, including all the headers.\n"; -+debug_printf("%s %d: ret msg\n", __FUNCTION__, __LINE__); -+ uschar *rubric = tblock->headers_only -+ ? US"------ This is a copy of the message's header lines.\n" -+ : tblock->body_only -+ ? US"------ This is a copy of the body of the message, without the headers.\n" -+ : US"------ This is a copy of the message, including all the headers.\n"; - transport_ctx tctx = { - .u = {.fd = fileno(fp)}, - .tblock = tblock, - .addr = addr, - .check_string = NULL, diff --git a/mail/exim/files/debian/75_32-Fix-PAM-auth.-Bug-2813.patch b/mail/exim/files/debian/75_32-Fix-PAM-auth.-Bug-2813.patch deleted file mode 100644 index 537bfed558d7..000000000000 --- a/mail/exim/files/debian/75_32-Fix-PAM-auth.-Bug-2813.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 51be321b27825c01829dffd90f11bfff256f7e42 Mon Sep 17 00:00:00 2001 -From: Adam Lackorzynski -Date: Sat, 16 Oct 2021 16:30:07 +0100 -Subject: [PATCH] Fix PAM auth. Bug 2813 - ---- - src/auths/call_pam.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/auths/call_pam.c b/src/auths/call_pam.c -index 80bb23ec3..03b9be1a8 100644 ---- a/src/auths/call_pam.c -+++ b/src/auths/call_pam.c -@@ -88,7 +88,7 @@ for (int i = 0; i < num_msg; i++) - arg = US""; - pam_arg_ended = TRUE; - } -- reply[i].resp = CS string_copy_malloc(arg); /* PAM frees resp */ -+ reply[i].resp = strdup(CCS arg); /* Use libc malloc, PAM frees resp directly*/ - reply[i].resp_retcode = PAM_SUCCESS; - break; - --- -2.34.1 - diff --git a/mail/exim/files/debian/75_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch b/mail/exim/files/debian/75_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch deleted file mode 100644 index c226354d5e8e..000000000000 --- a/mail/exim/files/debian/75_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch +++ /dev/null @@ -1,42 +0,0 @@ -From df618101a5ea15dc90c4a2968798ef2be9dba16f Mon Sep 17 00:00:00 2001 -From: Jeremy Harris -Date: Mon, 18 Oct 2021 11:01:47 +0100 -Subject: [PATCH] Exiqgrep: check arg parsing. Bug 2821 - ---- - src/exiqgrep.src | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/exiqgrep.src b/src/exiqgrep.src -index c8762df47..04602da68 100644 ---- a/src/exiqgrep.src -+++ b/src/exiqgrep.src -@@ -53,12 +53,14 @@ if ($ARGV[0] eq '--version') { - exit 0; - } - --getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt); --if ($ARGV[0]) { &help; exit;} --if ($opt{h}) { &help; exit;} -+if (!getopts('hf:r:y:o:s:C:zxlibRcaG:E:',\%opt)) { &help; exit; } -+if ($opt{h}) { &help; exit; } -+if ($ARGV[0] || !($opt{f} || $opt{r} || $opt{s} || $opt{y} || $opt{o} || $opt{z} || $opt{x} || $opt{c})) -+ { &help; exit(1); } - if ($opt{a}) { $eargs = '-bp'; } - if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; } - if ($opt{G}) { $eargs .= ' -qG'.$opt{G}; } -+if ($opt{E}) { $exim = $opt{E}; } - - # Read message queue output into hash - &collect(); -@@ -75,6 +77,7 @@ Exim message queue display utility. - - -h This help message. - -C Specify which exim.conf to use. -+ -E Specify exim binary to use. - - Selection criteria: - -f Match sender address sender (field is "< >" wrapped) --- -2.34.1 - diff --git a/mail/exim/files/debian/75_38-Convert-all-uses-of-select-to-poll.-Bug-2831.patch b/mail/exim/files/debian/75_38-Convert-all-uses-of-select-to-poll.-Bug-2831.patch deleted file mode 100644 index 93c99a4ef8f2..000000000000 --- a/mail/exim/files/debian/75_38-Convert-all-uses-of-select-to-poll.-Bug-2831.patch +++ /dev/null @@ -1,931 +0,0 @@ -From dd19ce4f24eec64177cdcfcf294b8efbb631a24b Mon Sep 17 00:00:00 2001 -From: Jeremy Harris -Date: Wed, 17 Nov 2021 17:19:54 +0000 -Subject: [PATCH] select() -> poll(). Bug 2831 - ---- - doc/ChangeLog | 8 +++ - src/daemon.c | 126 +++++++++++++++++++------------------- - src/deliver.c | 54 ++++++++-------- - src/exim.c | 9 +-- - src/expand.c | 6 +- - src/functions.h | 7 +++ - src/ip.c | 12 +--- - src/malware.c | 6 +- - src/receive.c | 15 +---- - src/smtp_in.c | 18 +----- - src/spam.c | 42 ++++--------- - src/transport.c | 4 +- - src/transports/smtp.c | 37 ++++------- - 13 files changed, 142 insertions(+), 202 deletions(-) - -diff --git a/doc/ChangeLog b/doc/ChangeLog -index 7f6814d5e..58996c3f8 100644 ---- a/doc/ChangeLog -+++ b/doc/ChangeLog -@@ -40,6 +40,14 @@ JH/09 Fix macro-definition during "-be" expansion testing. The move to - write-protected store for macros had not accounted for these runtime - additions; fix by removing this protection for "-be" mode. - -+JH/10 Convert all uses of select() to poll(). FreeBSD 12.2 was found to be -+ handing out large-numbered file descriptors, violating the usual Unix -+ assumption (and required by Posix) that the lowest possible number will be -+ allocated by the kernel when a new one is needed. In the daemon, and any -+ child procesees, values higher than 1024 (being bigger than FD_SETSIZE) -+ are not useable for FD_SET() [and hence select()] and overwrite the stack. -+ Assorted crashes happen. -+ - - Exim version 4.95 - ----------------- -diff --git a/src/daemon.c b/src/daemon.c -index 0b8d5d595..a248a4f40 100644 ---- a/src/daemon.c -+++ b/src/daemon.c -@@ -87,7 +87,7 @@ sigchld_seen = TRUE; - } - - --/* SIGTERM handler. Try to get the damon pif file removed -+/* SIGTERM handler. Try to get the damon pid file removed - before exiting. */ - - static void -@@ -141,7 +141,7 @@ Uunlink(s); - - static void - close_daemon_sockets(int daemon_notifier_fd, -- int * listen_sockets, int listen_socket_count) -+ struct pollfd * fd_polls, int listen_socket_count) - { - if (daemon_notifier_fd >= 0) - { -@@ -152,7 +152,7 @@ if (daemon_notifier_fd >= 0) - #endif - } - --for (int i = 0; i < listen_socket_count; i++) (void) close(listen_sockets[i]); -+for (int i = 0; i < listen_socket_count; i++) (void) close(fd_polls[i].fd); - } - - -@@ -167,7 +167,7 @@ is required so that they can be closed in the sub-process. Take care not to - leak store in this process - reset the stacking pool at the end. - - Arguments: -- listen_sockets sockets which are listening for incoming calls -+ fd_polls sockets which are listening for incoming calls - listen_socket_count count of listening sockets - accept_socket socket of the current accepted call - accepted socket information about the current call -@@ -176,7 +176,7 @@ Returns: nothing - */ - - static void --handle_smtp_call(int *listen_sockets, int listen_socket_count, -+handle_smtp_call(struct pollfd *fd_polls, int listen_socket_count, - int accept_socket, struct sockaddr *accepted) - { - pid_t pid; -@@ -459,7 +459,7 @@ if (pid == 0) - extensive comment before the reception loop in exim.c for a fuller - explanation of this logic. */ - -- close_daemon_sockets(daemon_notifier_fd, listen_sockets, listen_socket_count); -+ close_daemon_sockets(daemon_notifier_fd, fd_polls, listen_socket_count); - - /* Set FD_CLOEXEC on the SMTP socket. We don't want any rogue child processes - to be able to communicate with them, under any circumstances. */ -@@ -1305,13 +1305,6 @@ return FALSE; - - - --static void --add_listener_socket(int fd, fd_set * fds, int * fd_max) --{ --FD_SET(fd, fds); --if (fd > *fd_max) *fd_max = fd; --} -- - /************************************************* - * Exim Daemon Mainline * - *************************************************/ -@@ -1339,9 +1332,8 @@ void - daemon_go(void) - { - struct passwd * pw; --int * listen_sockets = NULL; --int listen_socket_count = 0, listen_fd_max = 0; --fd_set select_listen; -+struct pollfd * fd_polls, * tls_watch_poll = NULL, * dnotify_poll = NULL; *** 1527 LINES SKIPPED ***