www/fcgi: Update 2.4.0 => 2.4.6 (fix CVE-2025-23016), improve port

Commit log:
https://github.com/FastCGI-Archives/fcgi2/compare/2.4.0...2.4.6

Changelogs:
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.1
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.1.1
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.2
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.3
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.4
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.5
https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.6

Improve port:
- Replace PORTVERSION with DISTVERSION.
- Update WWW - old is down.
- Switch upstream to GitHub.
- Add USES+=pathfix for install *.pc files in correct path.
- Fix warnings from portclippy - order of lines in Makefile.
- Remove MAKE_JOBS_UNSAFE=yes - obsoleted.
- Make run COPYTREE_SHARE docs only if DOCS option is ON.
- Remove upstreamed and obsoleted patches.
- Fix order in plist.

PR:		286589
Approved by:	John von Essen <john@essenz.com> (maintainer, timeout - last activity 2019)
Security:	CVE-2025-23016
Co-authored-by:	Christos Chatzaras <chris@cretaforce.gr>
MFH:		2025Q2
This commit is contained in:
Vladimir Druzenko
2025-05-09 00:21:58 +03:00
parent 8c1ec3e7a7
commit 7809d8810d
6 changed files with 21 additions and 117 deletions
+11 -10
View File
@@ -1,35 +1,36 @@
PORTNAME= fcgi
PORTVERSION= 2.4.0
PORTREVISION= 6
DISTVERSION= 2.4.6
CATEGORIES= www
MASTER_SITES= LOCAL/adamw
PKGNAMESUFFIX= -devkit
MAINTAINER= john@essenz.com
COMMENT= FastCGI Development Kit
WWW= http://www.fastcgi.com/
WWW= https://fastcgi-archives.github.io/
LICENSE= Open_Market_FastCGI_license
LICENSE_NAME= Open Market FastCGI license
LICENSE_FILE= ${WRKSRC}/LICENSE.TERMS
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
USES= cpe libtool
USES= autoreconf cpe libtool pathfix
CPE_VENDOR= fastcgi
USE_GITHUB= yes
GH_ACCOUNT= FastCGI-Archives
GH_PROJECT= fcgi2
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
MAKE_JOBS_UNSAFE= yes
OPTIONS_DEFINE= DOCS
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libfcgi.so.0.0.0
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libfcgi++.so.0.0.0
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${WRKSRC}/doc/*.1 ${STAGEDIR}${PREFIX}/share/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/*.3 ${STAGEDIR}${PREFIX}/share/man/man3
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/doc && \
${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} "! -name *\.[13]")
+3 -2
View File
@@ -1,2 +1,3 @@
SHA256 (fcgi-2.4.0.tar.gz) = 66fc45c6b36a21bf2fbbb68e90f780cc21a9da1fffbae75e76d2b4402d3f05b9
SIZE (fcgi-2.4.0.tar.gz) = 468682
TIMESTAMP = 1746401419
SHA256 (FastCGI-Archives-fcgi2-2.4.6_GH0.tar.gz) = 39af4fb21a6d695a5f0b1c4fa95776d2725f6bc6c77680943a2ab314acd505c1
SIZE (FastCGI-Archives-fcgi2-2.4.6_GH0.tar.gz) = 263941
-79
View File
@@ -1,79 +0,0 @@
--- libfcgi/os_unix.c.orig 2002-03-05 19:14:49 UTC
+++ libfcgi/os_unix.c
@@ -42,6 +42,7 @@ static const char rcsid[] = "$Id: os_uni
#include <sys/time.h>
#include <sys/un.h>
#include <signal.h>
+#include <poll.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
@@ -103,6 +104,9 @@ static int volatile maxFd = -1;
static int shutdownPending = FALSE;
static int shutdownNow = FALSE;
+static int libfcgiOsClosePollTimeout = 2000;
+static int libfcgiIsAfUnixKeeperPollTimeout = 2000;
+
void OS_ShutdownPending()
{
shutdownPending = TRUE;
@@ -168,6 +172,16 @@ int OS_LibInit(int stdioFds[3])
if(libInitialized)
return 0;
+ char *libfcgiOsClosePollTimeoutStr = getenv( "LIBFCGI_OS_CLOSE_POLL_TIMEOUT" );
+ if(libfcgiOsClosePollTimeoutStr) {
+ libfcgiOsClosePollTimeout = atoi(libfcgiOsClosePollTimeoutStr);
+ }
+
+ char *libfcgiIsAfUnixKeeperPollTimeoutStr = getenv( "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT" );
+ if(libfcgiIsAfUnixKeeperPollTimeoutStr) {
+ libfcgiIsAfUnixKeeperPollTimeout = atoi(libfcgiIsAfUnixKeeperPollTimeoutStr);
+ }
+
asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo));
if(asyncIoTable == NULL) {
errno = ENOMEM;
@@ -755,19 +769,16 @@ int OS_Close(int fd)
if (shutdown(fd, 1) == 0)
{
- struct timeval tv;
- fd_set rfds;
+ struct pollfd pfd;
int rv;
char trash[1024];
- FD_ZERO(&rfds);
+ pfd.fd = fd;
+ pfd.events = POLLIN;
do
{
- FD_SET(fd, &rfds);
- tv.tv_sec = 2;
- tv.tv_usec = 0;
- rv = select(fd + 1, &rfds, NULL, NULL, &tv);
+ rv = poll(&pfd, 1, libfcgiOsClosePollTimeout);
}
while (rv > 0 && read(fd, trash, sizeof(trash)) > 0);
}
@@ -1116,13 +1127,11 @@ static int is_reasonable_accept_errno (c
*/
static int is_af_unix_keeper(const int fd)
{
- struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL };
- fd_set read_fds;
-
- FD_ZERO(&read_fds);
- FD_SET(fd, &read_fds);
+ struct pollfd pfd;
+ pfd.fd = fd;
+ pfd.events = POLLIN;
- return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds);
+ return poll(&pfd, 1, libfcgiIsAfUnixKeeperPollTimeout) >= 0 && (pfd.revents & POLLIN);
}
/*
@@ -1,11 +0,0 @@
--- examples/Makefile.in.orig 2003-01-19 17:21:17 UTC
+++ examples/Makefile.in
@@ -125,7 +125,7 @@ threaded_CFLAGS = @PTHREAD_CFLAGS@
threaded_LDFLAGS = @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
echo_cpp_SOURCES = $(INCLUDE_FILES) $(INCLUDEDIR)/fcgio.h echo-cpp.cpp
-echo_cpp_LDADD = $(LIBDIR)/libfcgi++.la
+echo_cpp_LDADD = $(LIBDIR)/libfcgi++.la $(LIBFCGI)
subdir = examples
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/fcgi_config.h
-10
View File
@@ -1,10 +0,0 @@
--- include/fcgio.h.orig 2002-02-25 13:16:11 UTC
+++ include/fcgio.h
@@ -31,6 +31,7 @@
#define FCGIO_H
#include <iostream>
+#include <cstdio>
#include "fcgiapp.h"
+7 -5
View File
@@ -14,11 +14,8 @@ lib/libfcgi.a
lib/libfcgi.so
lib/libfcgi.so.0
lib/libfcgi.so.0.0.0
share/man/man1/cgi-fcgi.1.gz
share/man/man3/FCGI_Accept.3.gz
share/man/man3/FCGI_Finish.3.gz
share/man/man3/FCGI_SetExitStatus.3.gz
share/man/man3/FCGI_StartFilterData.3.gz
libdata/pkgconfig/fcgi++.pc
libdata/pkgconfig/fcgi.pc
%%PORTDOCS%%%%DOCSDIR%%/fastcgi-prog-guide/ap_guida.htm
%%PORTDOCS%%%%DOCSDIR%%/fastcgi-prog-guide/ap_guide.htm
%%PORTDOCS%%%%DOCSDIR%%/fastcgi-prog-guide/apaman.htm
@@ -43,3 +40,8 @@ share/man/man3/FCGI_StartFilterData.3.gz
%%PORTDOCS%%%%DOCSDIR%%/omi-logo.gif
%%PORTDOCS%%%%DOCSDIR%%/overview.html
%%PORTDOCS%%%%DOCSDIR%%/www5-api-workshop.html
share/man/man1/cgi-fcgi.1.gz
share/man/man3/FCGI_Accept.3.gz
share/man/man3/FCGI_Finish.3.gz
share/man/man3/FCGI_SetExitStatus.3.gz
share/man/man3/FCGI_StartFilterData.3.gz