diff options
author | garga <garga@FreeBSD.org> | 2016-09-06 01:09:18 +0800 |
---|---|---|
committer | garga <garga@FreeBSD.org> | 2016-09-06 01:09:18 +0800 |
commit | 00c65f4186b5ba3d690f294535a06bf335199356 (patch) | |
tree | 269af28113f548724432dd62336a6c60cef7a08a /security/xinetd | |
parent | 62828f6d5a397f16c8581badef16beb5cce753da (diff) | |
download | freebsd-ports-gnome-00c65f4186b5ba3d690f294535a06bf335199356.tar.gz freebsd-ports-gnome-00c65f4186b5ba3d690f294535a06bf335199356.tar.zst freebsd-ports-gnome-00c65f4186b5ba3d690f294535a06bf335199356.zip |
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)
Diffstat (limited to 'security/xinetd')
-rw-r--r-- | security/xinetd/Makefile | 2 | ||||
-rw-r--r-- | security/xinetd/files/patch-xinetd_child.c | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/security/xinetd/Makefile b/security/xinetd/Makefile index 097e9a9a85cc..6728596e7bb9 100644 --- a/security/xinetd/Makefile +++ b/security/xinetd/Makefile @@ -3,7 +3,7 @@ PORTNAME= xinetd PORTVERSION= 2.3.15 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security ipv6 MASTER_SITES= GENTOO diff --git a/security/xinetd/files/patch-xinetd_child.c b/security/xinetd/files/patch-xinetd_child.c new file mode 100644 index 000000000000..6ddbf9125988 --- /dev/null +++ b/security/xinetd/files/patch-xinetd_child.c @@ -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 ) + { |