ports/162672: [PATCH] net/rinetd: [SUMMARIZE CHANGES]

Michael Gmelin freebsd at grem.de
Sat Nov 19 01:10:07 UTC 2011


>Number:         162672
>Category:       ports
>Synopsis:       [PATCH] net/rinetd: [SUMMARIZE CHANGES]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 19 01:10:06 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Michael Gmelin
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
Grem Equity GmbH
>Environment:
System: FreeBSD bsd.grem.de 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat May  7 08:49:13 UTC
>Description:
rinetd fails to close the configuration file (fopen twice, fclose only once) when reading its configuration. Therefore on every configuration reload (through SIGHUP) one file descriptor is lost. In an environment where this is done frequently (e.g. to re-lookup DNS names) the system will run out of file descriptors soon (kern.maxfiles) until rinetd crashes.
(I informed the author through his webpage, but I'm not sure if there'll be a response anytime soon)

Port maintainer (garga at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:

Start rinetd, and use fstat to check the number of open file descriptors:
fstat | grep rinetd | wc -l

Give the process a SIGHUP (killall -HUP rinetd) and run check the number of open file descriptors using fstat again. On every SIGHUP the number of file descriptors used is increased by one.

>Fix:

--- rinetd-0.62_4.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/rinetd.orig/Makefile /usr/ports/net/rinetd/Makefile
--- /usr/ports/net/rinetd.orig/Makefile	2011-11-19 01:36:39.000000000 +0100
+++ /usr/ports/net/rinetd/Makefile	2011-11-19 01:35:19.000000000 +0100
@@ -7,7 +7,7 @@
 
 PORTNAME=	rinetd
 PORTVERSION=	0.62
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	net
 MASTER_SITES=	http://www.boutell.com/rinetd/http/ \
 		${MASTER_SITE_GENTOO}
diff -ruN --exclude=CVS /usr/ports/net/rinetd.orig/files/patch-rinetd.c /usr/ports/net/rinetd/files/patch-rinetd.c
--- /usr/ports/net/rinetd.orig/files/patch-rinetd.c	2011-11-19 01:36:39.000000000 +0100
+++ /usr/ports/net/rinetd/files/patch-rinetd.c	2011-11-19 01:35:30.000000000 +0100
@@ -8,3 +8,11 @@
  			initArrays();
  			readConfiguration();
  			RegisterPID();
+@@ -646,6 +646,7 @@
+ 			}
+ 		}
+ 	}
++	fclose(in);
+ 	/* Open the log file */
+ 	if (logFile) {
+ 		fclose(logFile);
--- rinetd-0.62_4.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list