From nobody Mon Feb 05 10:46:16 2024 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 4TT32c5ptVz59hfy; Mon, 5 Feb 2024 10:46:16 +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 4TT32c5KnDz4dB4; Mon, 5 Feb 2024 10:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707129976; 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=mR8cb9TlfL0GxoVqoU6Jx902xZfbBTC3dVpk6nPdmJQ=; b=u+NejZ6rO65hk+NOhbBdbtpF3n1lOwmco/hOw98RMHRtiuAGH3Pxxg623FSCqddUcoaZt1 Xv7eX7nU6Jlc3z4cnRXKmuVm5UJbdqn/YPjUpbcxFSHiAHTGbdA8k98tJMrJ0fjCDpS9zr ERYdHBfN260a7xUnTLJ/QvcskSxZE1gAA3ILcf5D5KkktyBoYRiVTsjyrrt0Z7VUKRlZH2 jazE/LTNjb0Ff1IbB6HOIAZZZtjMSjxeG0Cm//6nHqUqB0uh/klS4hwLpxOMfdgg8q5ziB X+A/n/UgV1NmU4dwSouNP7blLAAhbCceNbJz6yuOU1W6a1cJiCZ9ykILP9jFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707129976; 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=mR8cb9TlfL0GxoVqoU6Jx902xZfbBTC3dVpk6nPdmJQ=; b=CZ63rnXx6j5ALxt0wwpMONXwW3uJNVM0/Pnvx2OlWH/eVTNU925h3M8pJz9pVINgJJb1Qi BFJ8VTKQuI1FL1PK2nXRhVwo4HuPaC3kt79pU5HP+ZdAwki9MgTwqpzeQ3e8hleasc5iYr MTlSpbrhUtNTocuSqGzrg2G55Rd2sT/+AesXmHtWE+u464gWX4Vwd/YXWC7eSj0fQb/QDL uj8f+3yGh+y/8ixGOROn1U3BhvFQ1brt67bGuer8lG+naerOFGXvIh6R/sBwrneoWlEoPc x3pTAz4nds3gF4TpkQom8zaDtANLx7cK0fkuFMdMwGEXVekcQBAmJXkr5UoTrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707129976; a=rsa-sha256; cv=none; b=Tli5iBy1D+9G7BeQZ0X4wLiW4qGRwF37Hhn1ii3H3ngGHl20uJRJ5RveIzUeOHHaM6GAJU bj33uXgZvCaTmclhS3O32VGd9hvohbFX9ef+r3gk3YgUmmWf1kM5lWF32yhdQoaJSFbTAQ 0h68VspzrnD4w8U7HwxsUFQ5nzkJ2KIt3yldEkFsKFHHAOnxyLhPS5TcFCUArGCZKjDsd3 hPmPvy5gzFQKcZq/WXTL+PDX1YLC99lvsX4saBAKTUyTiMt9FBBKzSAK7/MwpNJ6C1Ewq/ YtrebNBuMpjylOeMAe4loeLNmmpuXl3CQUkqhq2pZUBP54slpaoUA+lNkJTgAg== 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 4TT32c4J29zdS0; Mon, 5 Feb 2024 10:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 415AkGk1077585; Mon, 5 Feb 2024 10:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 415AkGNX077582; Mon, 5 Feb 2024 10:46:16 GMT (envelope-from git) Date: Mon, 5 Feb 2024 10:46:16 GMT Message-Id: <202402051046.415AkGNX077582@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: 1b25faa3f9e7 - main - net/dante: restore read/send-side pipe system check during configure 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: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b25faa3f9e7604f59613b5d52bd562148f63c04 Auto-Submitted: auto-generated The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=1b25faa3f9e7604f59613b5d52bd562148f63c04 commit 1b25faa3f9e7604f59613b5d52bd562148f63c04 Author: Alexey Dokuchaev AuthorDate: 2024-02-05 10:44:44 +0000 Commit: Alexey Dokuchaev CommitDate: 2024-02-05 10:44:44 +0000 net/dante: restore read/send-side pipe system check during configure It was disabled (patched out) in July 2023 based on the pkg-fallout@ emails, nearly seven months after the last regression which could be causing it had been fixed. Evidently, the cluster was running buggy kernel for its port-building jails long enough to confuse people the problem was still somehow exhibiting itself. While here, assume maintainership, fix some DRY bugs in the Makefile, and install the manpages under $PREFIX/share/man per new world order. PR: 272755 Fixes: 2b81a5f3f73c --- net/dante/Makefile | 31 +++-- net/dante/files/patch-acinclude.m4 | 276 ------------------------------------- net/dante/pkg-plist | 8 +- 3 files changed, 21 insertions(+), 294 deletions(-) diff --git a/net/dante/Makefile b/net/dante/Makefile index 0031bfd84ba0..458dbabda958 100644 --- a/net/dante/Makefile +++ b/net/dante/Makefile @@ -4,7 +4,7 @@ CATEGORIES= net security MASTER_SITES= http://www.inet.no/dante/files/ \ ftp://ftp.inet.no/pub/socks/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= danfe@FreeBSD.org COMMENT= Circuit-level firewall/proxy WWW= https://www.inet.no/dante/ @@ -16,8 +16,9 @@ LIB_DEPENDS= libminiupnpc.so:net/miniupnpc \ CONFLICTS= socks5 -USES= autoreconf libtool localbase +USES= libtool localbase GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share CONFIGURE_ARGS= --with-socks-conf=${PREFIX}/etc/socks.conf \ --with-sockd-conf=${PREFIX}/etc/sockd.conf INSTALL_TARGET= install-strip @@ -28,23 +29,25 @@ USE_RC_SUBR= sockd OPTIONS_DEFINE= DOCS EXAMPLES post-install: - ${INSTALL_DATA} ${WRKSRC}/example/socks.conf ${STAGEDIR}${PREFIX}/etc/socks.conf.sample - ${INSTALL_DATA} ${WRKSRC}/example/sockd.conf ${STAGEDIR}${PREFIX}/etc/sockd.conf.sample +.for x in s d + ${INSTALL_DATA} ${WRKSRC}/example/sock${x}.conf \ + ${STAGEDIR}${PREFIX}/etc/sock${x}.conf.sample +.endfor post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/example/sockd-basic.conf ${STAGEDIR}${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/example/sockd-chaining.conf ${STAGEDIR}${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/example/socks-simple-withoutnameserver.conf ${STAGEDIR}${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/example/socks-simple.conf ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/example/sockd-basic.conf \ + ${WRKSRC}/example/sockd-chaining.conf \ + ${WRKSRC}/example/socks-simple-withoutnameserver.conf \ + ${WRKSRC}/example/socks-simple.conf ${STAGEDIR}${EXAMPLESDIR} post-install-DOCS-on: - @${MKDIR} ${STAGEDIR}${DOCSDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR}/contrib - ${INSTALL_DATA} ${WRKSRC}/doc/README* ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/doc/rfc* ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/doc/SOCKS4*.protocol ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/UPGRADE ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/contrib/sockd-stat.awk ${STAGEDIR}${DOCSDIR}/contrib/sockd-stat.awk + ${INSTALL_DATA} ${WRKSRC}/doc/README* \ + ${WRKSRC}/doc/rfc* \ + ${WRKSRC}/doc/SOCKS4*.protocol \ + ${WRKSRC}/UPGRADE ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/contrib/sockd-stat.awk \ + ${STAGEDIR}${DOCSDIR}/contrib .include diff --git a/net/dante/files/patch-acinclude.m4 b/net/dante/files/patch-acinclude.m4 deleted file mode 100644 index 771468ccefc0..000000000000 --- a/net/dante/files/patch-acinclude.m4 +++ /dev/null @@ -1,276 +0,0 @@ ---- acinclude.m4.orig 2023-07-27 14:17:06 UTC -+++ acinclude.m4 -@@ -437,270 +437,10 @@ unset pipeside - #This little hack tries to make an educated guess as to what is the - #case on this particular system. - AC_MSG_CHECKING(read/send-side pipe system) --AC_TRY_RUN([ --#include --#include -+#This test is known to fail on the FreeBSD's official packaging -+#machine. Set it to recvbased as FreeBSD is known to be. - --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MIN --#define MIN(a,b) ((a) < (b) ? (a) : (b)) --#endif /* !MIN */ -- --#if NEED_AF_LOCAL --#define AF_LOCAL AF_UNIX --#endif /* NEED_AF_LOCAL */ -- --#define PACKETSIZE (1024) -- --#define PADBYTES (sizeof(short) * (64)) --/* -- * Just a wild guess. Dante uses sizeof(long). -- */ -- --#define SEND_PIPE (0) --#define RECV_PIPE (1) -- --#define EXIT_OK (0) /* type successfully determined */ --#define EXIT_UNKNOWN (1) /* error: unable to determine type */ -- --static void --setsockets(const int doreverse, const size_t packetsize, -- const int s, const int r, -- int *sndbuf, int *sndbuf_set, -- int *rcvbuf, int *rcvbuf_set); -- --static size_t --sendtest(const int s, const char *buf, const size_t buflen); -- --void --reswrite(const char *res); -- --int --main(void) --{ -- size_t sent, packetcount; -- int sndbuf, sndbuf_set, rcvbuf, rcvbuf_set; -- char buf[PACKETSIZE]; -- int datapipev[2]; -- -- if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, datapipev) != 0) { -- perror("socketpair()"); -- exit(EXIT_UNKNOWN); -- } -- -- setsockets(0, -- PACKETSIZE, -- datapipev[SEND_PIPE], -- datapipev[RECV_PIPE], -- &sndbuf, &sndbuf_set, -- &rcvbuf, &rcvbuf_set); -- -- packetcount = MIN(sndbuf, sndbuf_set) / (PACKETSIZE + PADBYTES); -- -- fprintf(stderr, -- "Requested sndbuf to be %d, is %d. " -- "Requested rcvbuf to be %d, is %d.\n" -- "Calculated packetcount is %lu\n", -- sndbuf, sndbuf_set, -- rcvbuf, rcvbuf_set, -- (unsigned long)packetcount); -- -- sent = sendtest(datapipev[SEND_PIPE], buf, PACKETSIZE) / PACKETSIZE; -- -- if (sent >= packetcount) { -- fprintf(stderr, "status determined by send-side\n"); -- reswrite("sendbased"); -- exit(EXIT_OK); -- } -- -- /* -- * Try the reverse. Perhaps this system wants a large rcvbuf rather than -- * a large sndbuf. -- */ -- close(datapipev[SEND_PIPE]); -- close(datapipev[RECV_PIPE]); -- -- if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, datapipev) != 0) { -- perror("socketpair()"); -- exit(EXIT_UNKNOWN); -- } -- -- setsockets(1, -- PACKETSIZE, -- datapipev[SEND_PIPE], -- datapipev[RECV_PIPE], -- &sndbuf, &sndbuf_set, -- &rcvbuf, &rcvbuf_set); -- -- packetcount = MIN(rcvbuf, rcvbuf_set) / (PACKETSIZE + PADBYTES); -- -- fprintf(stderr, -- "Requested sndbuf to be %d, is %d. " -- "Requested rcvbuf to be %d, is %d.\n" -- "Calculated packetcount is %lu\n", -- sndbuf, sndbuf_set, -- rcvbuf, rcvbuf_set, -- (unsigned long)packetcount); -- -- sent = sendtest(datapipev[SEND_PIPE], buf, PACKETSIZE) / PACKETSIZE; -- -- if (sent >= packetcount) { -- fprintf(stderr, "status determined by read-side\n"); -- reswrite("recvbased"); -- exit(EXIT_OK); -- } -- -- fprintf(stderr, "status is unknown\n"); -- return EXIT_UNKNOWN; --} -- --static void --setsockets(doreverse, packetsize, s, r, sndbuf, sndbuf_set, rcvbuf, rcvbuf_set) -- const int doreverse; -- const size_t packetsize; -- const int s; -- const int r; -- int *sndbuf, *sndbuf_set; -- int *rcvbuf, *rcvbuf_set; --{ -- socklen_t len; -- int p; -- -- if ((p = fcntl(s, F_GETFL, 0)) == -1 -- || fcntl(s, F_SETFL, p | O_NONBLOCK) == -1 -- || fcntl(r, F_SETFL, p | O_NONBLOCK) == -1) { -- perror("fcntl(F_SETFL/F_GETFL, O_NONBLOCK) failed"); -- exit(EXIT_UNKNOWN); -- } -- -- len = sizeof(*sndbuf_set); -- -- if (doreverse) { -- *sndbuf = packetsize + PADBYTES; -- -- if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf, sizeof(*sndbuf)) != 0) { -- perror("setsockopt(SO_SNDBUF)"); -- exit(EXIT_UNKNOWN); -- } -- -- if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf_set, &len) != 0) { -- perror("getsockopt(SO_SNDBUF)"); -- exit(EXIT_UNKNOWN); -- } -- -- *rcvbuf = *sndbuf_set * 10; -- if (setsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf, sizeof(*rcvbuf)) != 0) { -- perror("setsockopt(SO_RCVBUF)"); -- exit(EXIT_UNKNOWN); -- } -- } -- else { -- *rcvbuf = packetsize + PADBYTES; -- -- if (setsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf, sizeof(*rcvbuf)) != 0) { -- perror("setsockopt(SO_RCVBUF)"); -- exit(EXIT_UNKNOWN); -- } -- -- if (getsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf_set, &len) != 0) { -- perror("getsockopt(SO_RCVBUF)"); -- exit(EXIT_UNKNOWN); -- } -- -- *sndbuf = *rcvbuf_set * 10; -- if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf, sizeof(*sndbuf)) != 0) { -- perror("setsockopt(SO_SNDBUF)"); -- exit(EXIT_UNKNOWN); -- } -- } -- -- if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf_set, &len) != 0 -- || getsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf_set, &len) != 0) { -- perror("getsockopt(SO_SNDBUF/SO_RCVBUF)"); -- exit(EXIT_UNKNOWN); -- } -- -- fprintf(stderr, "sndbuf is %lu, rcvbuf is %lu\n", -- (unsigned long)*sndbuf_set, (unsigned long)*rcvbuf_set); -- -- if (doreverse) { -- if (*rcvbuf_set < *rcvbuf) { -- fprintf(stderr, "failed to set rcvbuf to %lu. Is %lu\n", -- (unsigned long)*rcvbuf, (unsigned long)*rcvbuf_set); -- exit(EXIT_UNKNOWN); -- } -- } -- else { -- if (*sndbuf_set < *sndbuf) { -- fprintf(stderr, "failed to set sndbuf to %lu (is %lu)\n", -- (unsigned long)*sndbuf, (unsigned long)*sndbuf_set); -- exit(EXIT_UNKNOWN); -- } -- } --} -- --static size_t --sendtest(s, buf, buflen) -- const int s; -- const char *buf; -- const size_t buflen; --{ -- ssize_t rc; -- size_t sent; -- int i; -- -- i = 1; -- sent = 0; -- errno = 0; -- -- while (1) { -- if ((rc = write(s, buf, buflen)) == -1) -- break; -- else { -- assert(rc == (ssize_t)buflen); -- -- ++i; -- sent += rc; -- } -- } -- -- fprintf(stderr, -- "failed sending packet #%d, sent %ld/%ld. " -- "Total bytes sent: %lu. Error on last packet: %s\n", -- i, -- (long)rc, -- (unsigned long)buflen, -- (unsigned long)sent, -- strerror(errno)); -- -- return sent; --} -- --void --reswrite(res) -- const char *res; --{ -- FILE *fp; -- if ((fp = fopen("conftest.out", "w")) == NULL) { -- perror("fopen"); -- exit(1); -- } -- fprintf(fp, "%s\n", res); -- fclose(fp); --}], [pipeside=`cat conftest.out` -- AC_MSG_RESULT([$pipeside]) --], [AC_MSG_RESULT(unknown)], -- [dnl XXX assume no when cross-compiling -- AC_MSG_RESULT(cross-compiling, assuming unknown)]) -- --case $pipeside in -+case "recvbased" in - recvbased) - AC_DEFINE(HAVE_PIPEBUFFER_RECV_BASED, 1, [platform pipe behavior]) - ;; diff --git a/net/dante/pkg-plist b/net/dante/pkg-plist index 5d5e703139d2..009b96a3336c 100644 --- a/net/dante/pkg-plist +++ b/net/dante/pkg-plist @@ -8,10 +8,6 @@ lib/libsocks.so lib/libsocks.so.0 lib/libsocks.so.0.1.1 sbin/sockd -man/man1/socksify.1.gz -man/man5/sockd.conf.5.gz -man/man5/socks.conf.5.gz -man/man8/sockd.8.gz %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sockd-basic.conf %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sockd-chaining.conf %%PORTEXAMPLES%%%%EXAMPLESDIR%%/socks-simple-withoutnameserver.conf @@ -26,3 +22,7 @@ man/man8/sockd.8.gz %%PORTDOCS%%%%DOCSDIR%%/rfc1928.txt %%PORTDOCS%%%%DOCSDIR%%/rfc1929.txt %%PORTDOCS%%%%DOCSDIR%%/rfc1961.txt +share/man/man1/socksify.1.gz +share/man/man5/sockd.conf.5.gz +share/man/man5/socks.conf.5.gz +share/man/man8/sockd.8.gz