1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

Fix some edge cases in xinetd file descriptor handling

This change fixes the case where the listening file descriptor is in 0~2
range (easily reprodutible with a single UDP service)

PR:		211038
Obtained from:	pfSense
MFH:		2016Q3
Sponsored by:	Rubicon Communications (Netgate)
This commit is contained in:
Renato Botelho 2016-09-05 17:09:18 +00:00
parent 3aa542e358
commit eccd2a14db
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=421378
2 changed files with 25 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= xinetd
PORTVERSION= 2.3.15
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security ipv6
MASTER_SITES= GENTOO

View File

@ -0,0 +1,24 @@
--- xinetd/child.c.orig 2016-07-13 19:00:31 UTC
+++ xinetd/child.c
@@ -168,7 +168,8 @@ void exec_server( const struct server *s
}
#endif
- (void) Sclose( descriptor ) ;
+ if ( descriptor > MAX_PASS_FD )
+ (void) Sclose( descriptor ) ;
#ifndef solaris
#if !defined(HAVE_SETSID)
@@ -321,11 +322,6 @@ void child_process( struct server *serp
signals_pending[0] = -1;
signals_pending[1] = -1;
- Sclose(0);
- Sclose(1);
- Sclose(2);
-
-
#ifdef DEBUG_SERVER
if ( debug.on )
{