From nobody Fri Oct 27 12:40:35 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 4SH2M81TXTz4yCnk; Fri, 27 Oct 2023 12:40:36 +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 4SH2M811SGz4PCM; Fri, 27 Oct 2023 12:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698410436; 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=Jyyp56bj/KzIGTw70YJW0s1pAU41dldGt+NX9cRGCMM=; b=G3sVSt82NUer+zcn6V9ZGBXkvD+wiz/jhu42TYUmroZfommmK0EI2r9ZJ8bsH1/yTx+KfU q8sIe57gVlvy9DASskk7bvAZjg0GdE1Y8rXoEmr9a/eV+fqUkvkEPwOxy1fx6lEk017L7j s0l3p1jTRjtORS6Wcqia9HgMTvHcOhEAI0cpuMHufEG6+2q3bOdbxB4Dp3GZfhuou9yU3o j2Syvqci06NpFaxSBIZy2mrQOsRWoZ0kO6K91WnsXOFKacOj4JZqpKhYAMetgsmrmuwUPK JK1AVGZrMEP9ZsJQgXTH/B02DrR4+kv+fnnaV7CAG9X7/pE/U/fuWKP7LVyCBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698410436; 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=Jyyp56bj/KzIGTw70YJW0s1pAU41dldGt+NX9cRGCMM=; b=tovz16vVM3rqXBXohrLX/s5ai//ErCY+2G3pGPJHAnnF9G5nSFRjrLDUGZk7g/ZiKFqSjb oDyefj/M0JkN1cgWQMuYBlNn/hXGQ8PEVqBKgE+Hck5FqscvBJ8gw+WcN+gHaP74upeNwu GdvEBDfmNaI6Ros2Rx1ZVR4PMO+kgVWnIdEi6yh0R7aBWhvR5Rl/CMeeCZUqSG3hc/uJqA slPnjwS3cc2R1aBH6leUbCHjyEvg0iXKXM0cHNIi4EMZ1Dj21uOCGXwW2fCN0sPObXsAzt N+BtF33sz9lF/f63s7K0Kd/mnnM+XtnNNgKCjZ20MpitUilSqn6l23AxlG/fLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698410436; a=rsa-sha256; cv=none; b=VmZz+KkG8u6fktTIQ3DUl2t2kfN7yggquf0QcdItf1C9561uGZWFfE20b7xxuCulB3ObYl XtwRlleJWhA3c0n/eo+8SkcO5payfx3l/bj6i1ZUrY3RT1+8ib+XEBRlS3Zvarzkfc+Lhl I3d8NxnzGLmi1wV7YMESjAnHFpj8T5NvrBxfiFwIzqio0c77UsbLMqk/jZ4daCyitL5Vn3 fpbPlXrpan/KOTsYagnLDxpFcPeCuYPTxe0v/f2Nt0Xp0+L8WeBlBOnqlUVSmyRJg+Gxbz hNjv3lvj/j/6Gw8Nq1gjuhaxuFLyMFapITlfjEp0Kkp2zazevHxRsiwGPGirRg== 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 4SH2M806K7zH5; Fri, 27 Oct 2023 12:40:36 +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 39RCeZpu000651; Fri, 27 Oct 2023 12:40:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39RCeZVT000648; Fri, 27 Oct 2023 12:40:35 GMT (envelope-from git) Date: Fri, 27 Oct 2023 12:40:35 GMT Message-Id: <202310271240.39RCeZVT000648@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Renato Botelho Subject: git: 3c7b8fd3318e - main - net/rinetd: update to new upstream and 0.73 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: garga X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c7b8fd3318ee88a93bc5561c9322558403d737e Auto-Submitted: auto-generated The branch main has been updated by garga: URL: https://cgit.FreeBSD.org/ports/commit/?id=3c7b8fd3318ee88a93bc5561c9322558403d737e commit 3c7b8fd3318ee88a93bc5561c9322558403d737e Author: Marcin Gryszkalis AuthorDate: 2023-10-07 16:57:30 +0000 Commit: Renato Botelho CommitDate: 2023-10-27 12:40:11 +0000 net/rinetd: update to new upstream and 0.73 While here, pet portlint and portclippy. PR: 274331 --- net/rinetd/Makefile | 38 +++---- net/rinetd/distinfo | 5 +- net/rinetd/files/patch-Makefile | 22 ---- net/rinetd/files/patch-rinetd.c | 18 --- net/rinetd/files/patch-select2poll | 194 --------------------------------- net/rinetd/files/patch-src_Makefile.am | 11 ++ net/rinetd/files/patch-src_rinetd.c | 11 ++ net/rinetd/pkg-plist | 3 + 8 files changed, 47 insertions(+), 255 deletions(-) diff --git a/net/rinetd/Makefile b/net/rinetd/Makefile index 0da4a420331b..77953982b81f 100644 --- a/net/rinetd/Makefile +++ b/net/rinetd/Makefile @@ -1,39 +1,39 @@ PORTNAME= rinetd -PORTVERSION= 0.62 -PORTREVISION= 4 +PORTVERSION= 0.73 +DISTVERSIONPREFIX= v CATEGORIES= net -MASTER_SITES= http://www.boutell.com/rinetd/http/ \ - GENTOO -DISTNAME= rinetd MAINTAINER= garga@FreeBSD.org COMMENT= Simple TCP port redirector +WWW= https://github.com/samhocevar/rinetd LICENSE= GPLv2 -OPTIONS_DEFINE= DOCS - -WRKSRC= ${WRKDIR}/rinetd-${PORTVERSION} +USES= cpe dos2unix autoreconf +USE_GITHUB= yes +GH_ACCOUNT= samhocevar +GH_TAGNAME= d4e0a60 +USE_RC_SUBR= rinetd -USES= cpe dos2unix +GNU_CONFIGURE= yes PORTDOCS= index.html -PLIST_FILES= sbin/rinetd \ - man/man8/rinetd.8.gz - -USE_RC_SUBR= rinetd -post-extract: - @${MV} ${WRKDIR}/rinetd ${WRKSRC} +OPTIONS_DEFINE= DOCS post-patch: - @${REINPLACE_CMD} -E "s,(/etc/rinetd.conf),${PREFIX}\1," \ - ${WRKSRC}/rinetd.[8c] - @${REINPLACE_CMD} -E "s,/usr(/sbin/rinetd),${PREFIX}\1," \ + @${REINPLACE_CMD} -E \ + -e "s,(/etc/rinetd.conf),${PREFIX}\1," \ + -e "s,/usr(/sbin/rinetd),${PREFIX}\1," \ ${WRKSRC}/rinetd.8 - @${REINPLACE_CMD} -e "s,cc ,${CC} ,g" ${WRKSRC}/Makefile + @${REINPLACE_CMD} -E "s,(/etc/rinetd.conf),${PREFIX}\1," \ + ${WRKSRC}/src/rinetd.h post-install: + ${MV} ${STAGEDIR}${PREFIX}/etc/rinetd.conf \ + ${STAGEDIR}${PREFIX}/etc/rinetd.conf.sample + +post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} .for f in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR} diff --git a/net/rinetd/distinfo b/net/rinetd/distinfo index bc61c920ceb7..7f43e7e364cf 100644 --- a/net/rinetd/distinfo +++ b/net/rinetd/distinfo @@ -1,2 +1,3 @@ -SHA256 (rinetd.tar.gz) = 0c68d27c5bd4b16ce4f58a6db514dd6ff37b2604a88b02c1dfcdc00fc1059898 -SIZE (rinetd.tar.gz) = 115541 +TIMESTAMP = 1696686326 +SHA256 (samhocevar-rinetd-v0.73-d4e0a60_GH0.tar.gz) = 76eef19e0af8459c9434ac8ac0b58edac1bba353f5aaceb1d5f971fb3f6a3016 +SIZE (samhocevar-rinetd-v0.73-d4e0a60_GH0.tar.gz) = 45544 diff --git a/net/rinetd/files/patch-Makefile b/net/rinetd/files/patch-Makefile deleted file mode 100644 index f0e1b68d01bf..000000000000 --- a/net/rinetd/files/patch-Makefile +++ /dev/null @@ -1,22 +0,0 @@ ---- ../rinetd.orig/Makefile Mon Mar 1 13:41:50 1999 -+++ Makefile Sat Jun 12 12:54:48 1999 -@@ -1,9 +1,14 @@ --CFLAGS=-DLINUX -g -+CFLAGS+=-I. -DLINUX - --rinetd: rinetd.o match.o -- gcc rinetd.o match.o -o rinetd -+all: rinetd -+ -+rinetd: rinetd.o match.o getopt.o -+ ${CC} ${CFLAGS} rinetd.o match.o getopt.o -o rinetd -+ -+getopt.o: -+ ${CC} ${CFLAGS} -c getopt.c - - install: rinetd -- install -m 700 rinetd /usr/sbin -- install -m 644 rinetd.8 /usr/man/man8 -+ install -s -m 755 rinetd ${DESTDIR}${PREFIX}/sbin -+ install -m 644 rinetd.8 ${DESTDIR}${PREFIX}/man/man8 - diff --git a/net/rinetd/files/patch-rinetd.c b/net/rinetd/files/patch-rinetd.c deleted file mode 100644 index 3c32c5bf626d..000000000000 --- a/net/rinetd/files/patch-rinetd.c +++ /dev/null @@ -1,18 +0,0 @@ ---- rinetd.c.orig Thu Jul 19 22:19:59 2001 -+++ rinetd.c Thu Jul 19 22:20:26 2001 -@@ -243,6 +243,7 @@ - signal(SIGHUP, hup); - #endif /* WIN32 */ - signal(SIGTERM, term); -+ setsid(); - initArrays(); - readConfiguration(); - RegisterPID(); -@@ -646,6 +646,7 @@ - } - } - } -+ fclose(in); - /* Open the log file */ - if (logFile) { - fclose(logFile); diff --git a/net/rinetd/files/patch-select2poll b/net/rinetd/files/patch-select2poll deleted file mode 100644 index cbcb3d749b48..000000000000 --- a/net/rinetd/files/patch-select2poll +++ /dev/null @@ -1,194 +0,0 @@ ---- rinetd.c.orig Mon Apr 14 22:19:23 2003 -+++ rinetd.c Tue Oct 4 07:25:42 2005 -@@ -12,6 +12,7 @@ - #include - #include - #include -+#include - #define INVALID_SOCKET (-1) - #include - #endif /* WIN32 */ -@@ -94,6 +95,7 @@ - #include "match.h" - - SOCKET *seFds = 0; -+static int first_set = 0; - /* In network order, for network purposes */ - struct in_addr *seLocalAddrs = 0; - unsigned short *seLocalPorts = 0; -@@ -750,15 +752,82 @@ - void openLocalFd(int se, int i); - int getAddress(char *host, struct in_addr *iaddr); - -+inline void poll_init_fds(struct pollfd *pfds, int size) { -+ int i; -+ -+ memset(pfds, 0, sizeof(struct pollfd) * size); -+ first_set = 1; -+ for(i = 0; i < size; i++) -+ pfds[i].fd = -1; -+} -+ -+inline int poll_set_fd(struct pollfd *pfds, int size, int count, -+ int fd, short int ev) { -+#ifdef _NEW_POLL_SET_FD -+ if(first_set) { -+ pfds[count].fd = fd; -+ pfds[count].events |= ev; -+ first_set = 0; -+ return 0; -+ } -+ if(pfds[count].fd != fd && !first_set) { -+ count++; -+ } -+ -+ pfds[count].fd = fd; -+ pfds[count].events |= ev; -+ -+ return count; -+#else -+ int i; -+ -+ for(i = 0; i < size; i++) { -+ if(pfds[i].fd == -1) { -+ pfds[i].fd = fd; -+ pfds[i].events |= ev; -+ count++; -+ break; -+ } -+ if(pfds[i].fd == fd) { -+ pfds[i].events |= ev; -+ break; -+ } -+ } -+ -+ return count; -+#endif -+} -+ -+int poll_fd_isset(struct pollfd *pfds, int nfds, int fd, short event) { -+ int i; -+ -+ for(i = 0; i < nfds; i++) { -+ if(pfds[i].fd == fd) -+ return pfds[i].revents & event; -+ } -+ -+ return 0; -+} -+ - void selectPass(void) { - int i; -- fd_set readfds, writefds; -- FD_ZERO(&readfds); -- FD_ZERO(&writefds); -+ int nfds = 0; -+ int total = 0; -+ static struct pollfd *pfds = NULL; -+ - /* Server sockets */ -+ total = seTotal + (coTotal * 2); -+ -+ if(!pfds) { -+ pfds = malloc(sizeof(struct pollfd) * total); -+ } -+ -+ poll_init_fds(pfds, total); -+ - for (i = 0; (i < seTotal); i++) { - if (seFds[i] != INVALID_SOCKET) { -- FD_SET(seFds[i], &readfds); -+ //FD_SET(seFds[i], &readfds) -+ nfds = poll_set_fd(pfds, total, nfds, seFds[i], POLLIN); - } - } - /* Connection sockets */ -@@ -768,35 +837,47 @@ - } - if (coClosing[i]) { - if (!reClosed[i]) { -- FD_SET(reFds[i], &writefds); -- } -- if (!loClosed[i]) { -- FD_SET(loFds[i], &writefds); -+ //FD_SET(reFds[i], &writefds); -+ nfds = poll_set_fd(pfds, total, nfds, -+ reFds[i], POLLOUT); - } - } - /* Get more input if we have room for it */ - if ((!reClosed[i]) && (coInputRPos[i] < bufferSpace)) { -- FD_SET(reFds[i], &readfds); -+ //FD_SET(reFds[i], &readfds); -+ nfds = poll_set_fd(pfds, total, nfds, reFds[i], POLLIN); - } - /* Send more output if we have any */ - if ((!reClosed[i]) && (coOutputWPos[i] < coOutputRPos[i])) { -- FD_SET(reFds[i], &writefds); -+ //FD_SET(reFds[i], &writefds); -+ nfds = poll_set_fd(pfds, total, nfds, reFds[i], POLLOUT); - } -+ if (coClosing[i]) { -+ if (!loClosed[i]) { -+ //FD_SET(loFds[i], &writefds); -+ nfds = poll_set_fd(pfds, total, nfds, -+ loFds[i], POLLOUT); -+ } -+ } - /* Accept more output from the local - server if there's room */ - if ((!loClosed[i]) && (coOutputRPos[i] < bufferSpace)) { -- FD_SET(loFds[i], &readfds); -+ //FD_SET(loFds[i], &readfds); -+ nfds = poll_set_fd(pfds, total, nfds, loFds[i], POLLIN); - } - /* Send more input to the local server - if we have any */ - if ((!loClosed[i]) && (coInputWPos[i] < coInputRPos[i])) { -- FD_SET(loFds[i], &writefds); -+ //FD_SET(loFds[i], &writefds); -+ nfds = poll_set_fd(pfds, total, nfds, loFds[i], POLLOUT); - } - } -- select(maxfd + 1, &readfds, &writefds, 0, 0); -+ //select(maxfd + 1, &readfds, &writefds, 0, 0); -+ poll(pfds, nfds + 1, -1); - for (i = 0; (i < seTotal); i++) { - if (seFds[i] != -1) { -- if (FD_ISSET(seFds[i], &readfds)) { -+ //if (FD_ISSET(seFds[i], &readfds)) { -+ if (poll_fd_isset(pfds, nfds, seFds[i], POLLIN)) { - handleAccept(i); - } - } -@@ -806,22 +887,26 @@ - continue; - } - if (!reClosed[i]) { -- if (FD_ISSET(reFds[i], &readfds)) { -+ //if (FD_ISSET(reFds[i], &readfds)) { -+ if (poll_fd_isset(pfds, nfds, reFds[i], POLLIN)) { - handleRemoteRead(i); - } - } - if (!reClosed[i]) { -- if (FD_ISSET(reFds[i], &writefds)) { -+ //if (FD_ISSET(reFds[i], &writefds)) { -+ if (poll_fd_isset(pfds, nfds, reFds[i], POLLOUT)) { - handleRemoteWrite(i); - } - } - if (!loClosed[i]) { -- if (FD_ISSET(loFds[i], &readfds)) { -+ //if (FD_ISSET(loFds[i], &readfds)) { -+ if (poll_fd_isset(pfds, nfds, loFds[i], POLLIN)) { - handleLocalRead(i); - } - } - if (!loClosed[i]) { -- if (FD_ISSET(loFds[i], &writefds)) { -+ //if (FD_ISSET(loFds[i], &writefds)) { -+ if (poll_fd_isset(pfds, nfds, loFds[i], POLLOUT)) { - handleLocalWrite(i); - } - } diff --git a/net/rinetd/files/patch-src_Makefile.am b/net/rinetd/files/patch-src_Makefile.am new file mode 100644 index 000000000000..1ab42eb1cad7 --- /dev/null +++ b/net/rinetd/files/patch-src_Makefile.am @@ -0,0 +1,11 @@ +--- src/Makefile.am.orig 2023-10-07 16:13:36 UTC ++++ src/Makefile.am +@@ -18,7 +18,7 @@ parse.c: parse.peg + # _DARWIN_C_SOURCE is for NI_MAXHOST on OS X + # _XOPEN_SOURCE is for struct sigaction + # _GNU_SOURCE is for h_errno and gethostbyname-related macros +-___rinetd_CFLAGS = -std=c99 -D_POSIX_C_SOURCE=200809L \ ++___rinetd_CFLAGS = -std=c99 \ + -D_XOPEN_SOURCE -D_GNU_SOURCE -D_DARWIN_C_SOURCE \ + -Wall -Wextra -Wwrite-strings + diff --git a/net/rinetd/files/patch-src_rinetd.c b/net/rinetd/files/patch-src_rinetd.c new file mode 100644 index 000000000000..5f0ea6dc73b1 --- /dev/null +++ b/net/rinetd/files/patch-src_rinetd.c @@ -0,0 +1,11 @@ +--- src/rinetd.c.orig 2023-10-07 16:13:36 UTC ++++ src/rinetd.c +@@ -927,7 +927,7 @@ RETSIGTYPE quit(int s) + + void registerPID(char const *pid_file_name) + { +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + FILE *pid_file = fopen(pid_file_name, "w"); + if (pid_file == NULL) { + /* non-fatal, non-Linux may lack /var/run... */ diff --git a/net/rinetd/pkg-plist b/net/rinetd/pkg-plist new file mode 100644 index 000000000000..68d5d034e753 --- /dev/null +++ b/net/rinetd/pkg-plist @@ -0,0 +1,3 @@ +@sample etc/rinetd.conf.sample +sbin/rinetd +man/man8/rinetd.8.gz