Fix leaking descriptor when starting a service fails (#795188)

This commit is contained in:
Jan Synacek 2012-03-02 09:27:04 +01:00
commit f1cc4e9d32
2 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,18 @@
--- xinetd-2.3.14/xinetd/service.c 2012-03-02 09:04:28.678977503 +0100
+++ xinetd-2.3.14-mod/xinetd/service.c 2012-03-02 09:05:42.542941099 +0100
@@ -372,6 +372,7 @@ status_e svc_activate( struct service *s
if ( set_fd_modes( sp ) == FAILED )
{
(void) Sclose( SVC_FD(sp) ) ;
+ sp->svc_pfd_index = --ps.rws.pfds_last;
return( FAILED ) ;
}
@@ -385,6 +386,7 @@ status_e svc_activate( struct service *s
if ( status == FAILED )
{
(void) Sclose( SVC_FD(sp) ) ;
+ sp->svc_pfd_index = --ps.rws.pfds_last;
return( FAILED ) ;
}

View file

@ -1,7 +1,7 @@
Summary: A secure replacement for inetd
Name: xinetd
Version: 2.3.14
Release: 41%{?dist}
Release: 42%{?dist}
License: xinetd
Group: System Environment/Daemons
Epoch: 2
@ -51,6 +51,8 @@ Patch21: xinetd-2.3.14-leaking-fds.patch
Patch22: xinetd-2.3.14-many-services.patch
# Remove realloc of fds that was causing memory corruption
Patch23: xinetd-2.3.14-realloc-remove.patch
# Fix leaking descriptor when starting a service fails
Patch24: xinetd-2.3.14-leaking-fds-2.patch
BuildRequires: autoconf, automake
BuildRequires: libselinux-devel >= 1.30
@ -106,6 +108,7 @@ located in the /etc/xinetd.d directory.
%patch21 -p1 -b .leaking-fds
%patch22 -p1 -b .many-services
%patch23 -p1 -b .realloc-remove
%patch24 -p1 -b .leaking-fds-2
aclocal
autoconf
@ -175,6 +178,9 @@ fi
%{_mandir}/*/*
%changelog
* Fri Mar 02 2012 Jan Synáček <jsynacek@redhat.com> - 2:2.3.14-42
- Fix leaking descriptor when starting a service fails (#795188)
* Wed Jan 18 2012 Jan Synáček <jsynacek@redhat.com> - 2:2.3.14-41
- Remove realloc inside svc_activate that was causing memory corruption
- Number of alloc'd file descriptors is now determined by system limits (ulimit -n)