From a0d8183d65f79ecbf7c7b967cd8d3886857d2e53 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 17 Feb 2010 03:31:00 +0000 Subject: [PATCH 1/9] Initialize branch F-13 for xinetd --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..baa94ef --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-13 From cd8a7f0acec741a6efbc04fc90c6dd7fc881d798 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Fri, 19 Mar 2010 08:04:47 +0000 Subject: [PATCH 2/9] fixed flooding log with error messages when disabled service at runtime --- xinetd-2.3.14-clean-pfd.patch | 10 ++++++++++ xinetd.spec | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-clean-pfd.patch diff --git a/xinetd-2.3.14-clean-pfd.patch b/xinetd-2.3.14-clean-pfd.patch new file mode 100644 index 0000000..2509848 --- /dev/null +++ b/xinetd-2.3.14-clean-pfd.patch @@ -0,0 +1,10 @@ +--- xinetd-2.3.14/xinetd/service.c.orig 2010-03-18 17:09:20.000000000 +0100 ++++ xinetd-2.3.14/xinetd/service.c 2010-03-18 17:09:37.000000000 +0100 +@@ -470,6 +470,7 @@ void svc_deactivate( struct service *sp + { + #ifdef HAVE_POLL + SVC_EVENTS( sp ) = 0; ++ SVC_FD( sp ) = 0; + #else + FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; + #endif /* HAVE_POLL */ diff --git a/xinetd.spec b/xinetd.spec index 0954a80..3216021 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 28%{?dist} +Release: 30%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -23,6 +23,7 @@ Patch10: xinetd-2.3.14-autoconf.patch Patch11: xinetd-2.3.14-poll.patch Patch12: xinetd-2.3.14-file-limit.patch Patch13: xinetd-2.3.14-tcpmux.patch +Patch14: xinetd-2.3.14-clean-pfd.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -64,6 +65,7 @@ located in the /etc/xinetd.d directory. %patch11 -p1 -b .poll %patch12 -p1 -b .file-limit %patch13 -p1 -b .tcpmux +%patch14 -p1 -b .clean-pfd aclocal autoconf @@ -123,6 +125,10 @@ fi %{_mandir}/*/* %changelog +* Fri Mar 19 2010 Jan Zeleny - 2:2.3.14-30 +- fixed flooding log with error messages when disabled service at runtime +- updated release number to 30 to prevent rpm from detecting this as downgrade + * Thu Jan 21 2010 Jan Zeleny - 2:2.3.14-28 - fixed issue with tcpmux service (#543968) From 23f8bbe4257690b41718488411c23a86b3f765c2 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Fri, 19 Mar 2010 09:08:11 +0000 Subject: [PATCH 3/9] Corrected port parsing code (IPv4 and IPv6 were switched) Commented patches I'm familiar with in spec file --- xinetd-2.3.14-ipv6confusion.patch | 17 +++++++++++++++++ xinetd.spec | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-ipv6confusion.patch diff --git a/xinetd-2.3.14-ipv6confusion.patch b/xinetd-2.3.14-ipv6confusion.patch new file mode 100644 index 0000000..5f0b431 --- /dev/null +++ b/xinetd-2.3.14-ipv6confusion.patch @@ -0,0 +1,17 @@ +--- xinetd-2.3.14/xinetd/ident.c.jw 2010-03-10 17:49:53.000000000 +1100 ++++ xinetd-2.3.14/xinetd/ident.c 2010-03-10 17:50:30.000000000 +1100 +@@ -108,12 +108,12 @@ + memcpy( &sin_bind, &sin_local, sizeof(sin_bind) ) ; + local_port = 0; + remote_port = 0; +- if( sin_remote.sa.sa_family == AF_INET ) { ++ if( sin_remote.sa.sa_family == AF_INET6 ) { + local_port = ntohs( sin_local.sa_in6.sin6_port ) ; + remote_port = ntohs( sin_remote.sa_in6.sin6_port ) ; + sin_contact.sa_in6.sin6_port = htons( IDENTITY_SERVICE_PORT ) ; + sin_bind.sa_in.sin_port = 0 ; +- } else if( sin_remote.sa.sa_family == AF_INET6 ) { ++ } else if( sin_remote.sa.sa_family == AF_INET ) { + local_port = ntohs( sin_local.sa_in.sin_port ) ; + remote_port = ntohs( sin_remote.sa_in.sin_port ) ; + sin_contact.sa_in.sin_port = htons( IDENTITY_SERVICE_PORT ) ; diff --git a/xinetd.spec b/xinetd.spec index 3216021..65dfe0b 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 30%{?dist} +Release: 31%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -19,11 +19,23 @@ Patch6: xinetd-2.3.14-man-section.patch Patch7: xinetd-2.3.11-PIE.patch Patch8: xinetd-2.3.14-ident-bind.patch Patch9: xinetd-2.3.14-readable-debuginfo.patch +# Patch for clean reconfiguration using newer versions of autotools Patch10: xinetd-2.3.14-autoconf.patch +# Completely rewritten socket handling code (it uses poll() instead +# of select() function) Patch11: xinetd-2.3.14-poll.patch +# New configuration option (limit for files opened by child process) Patch12: xinetd-2.3.14-file-limit.patch +# When using tcpmux, xinetd ended up with sigsegv +# (detection of NULL pointer in pollfd structure was missing) Patch13: xinetd-2.3.14-tcpmux.patch +# When service is destroyed, destroy also its +# file descriptor in array given to poll function Patch14: xinetd-2.3.14-clean-pfd.patch +# xinetd confuses ipv6 and ipv4 port parsing +# - furtunately, they have the same format, so everything +# works even without this patch +Patch15: xinetd-2.3.14-ipv6confusion.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -66,6 +78,7 @@ located in the /etc/xinetd.d directory. %patch12 -p1 -b .file-limit %patch13 -p1 -b .tcpmux %patch14 -p1 -b .clean-pfd +%patch15 -p1 -b .ipv6confusion aclocal autoconf @@ -125,6 +138,10 @@ fi %{_mandir}/*/* %changelog +* Fri Mar 19 2010 Jan Zeleny - 2:2.3.14-31 +- corrected port parsing code (IPv4 and IPv6 were switched) +- commented patches I'm familiar with in spec file + * Fri Mar 19 2010 Jan Zeleny - 2:2.3.14-30 - fixed flooding log with error messages when disabled service at runtime - updated release number to 30 to prevent rpm from detecting this as downgrade From 24fe9386a89ccf98b597fbe58a82e52935dafdfa Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Wed, 2 Jun 2010 07:38:46 +0000 Subject: [PATCH 4/9] fixed reconfiguration error when ending UDP services (#593904) --- xinetd-2.3.14-udp-reconfig.patch | 12 ++++++++++++ xinetd.spec | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-udp-reconfig.patch diff --git a/xinetd-2.3.14-udp-reconfig.patch b/xinetd-2.3.14-udp-reconfig.patch new file mode 100644 index 0000000..07e733e --- /dev/null +++ b/xinetd-2.3.14-udp-reconfig.patch @@ -0,0 +1,12 @@ +--- xinetd-2.3.14/xinetd/reconfig.c.orig 2010-06-01 12:58:18.000000000 +0200 ++++ xinetd-2.3.14/xinetd/reconfig.c 2010-06-01 12:58:23.000000000 +0200 +@@ -138,8 +138,8 @@ void hard_reconfig( void ) + * b. Terminate running servers and cancel retry attempts, in case + * of reconfiguration + */ +- svc_deactivate( osp ) ; + terminate_servers( osp ) ; ++ svc_deactivate( osp ) ; + cancel_service_retries( osp ) ; + + /* diff --git a/xinetd.spec b/xinetd.spec index 65dfe0b..308594c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 31%{?dist} +Release: 32%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -36,6 +36,9 @@ Patch14: xinetd-2.3.14-clean-pfd.patch # - furtunately, they have the same format, so everything # works even without this patch Patch15: xinetd-2.3.14-ipv6confusion.patch +# This fixes bug #593904 - online reconfiguration caused log message +# flood when turning off UDP service +Patch16: xinetd-2.3.14-udp-reconfig.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -79,6 +82,7 @@ located in the /etc/xinetd.d directory. %patch13 -p1 -b .tcpmux %patch14 -p1 -b .clean-pfd %patch15 -p1 -b .ipv6confusion +%patch16 -p1 -b .udp-reconfig aclocal autoconf @@ -138,6 +142,10 @@ fi %{_mandir}/*/* %changelog +* Wed Jun 02 2010 Jan Zeleny - 2:2.3.14-32 +- fixed log message flooding when turning off UDP service during online + reconfiguration (#593904) + * Fri Mar 19 2010 Jan Zeleny - 2:2.3.14-31 - corrected port parsing code (IPv4 and IPv6 were switched) - commented patches I'm familiar with in spec file From 4715d2e809d96974bd4c4b8a086042e7c3d64b28 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:53:27 +0000 Subject: [PATCH 5/9] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 72d2dbb..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: xinetd -# $Id: Makefile,v 1.2 2007/10/15 19:32:02 notting Exp $ -NAME := xinetd -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index baa94ef..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-13 From 0021bc3a7115bca375ea21146bff6bca0493b77d Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Fri, 18 Feb 2011 15:43:09 +0100 Subject: [PATCH 6/9] - fix crash when application's logfile hit size limit Related: #244063 --- xinetd-2.3.13-log-crash.patch | 17 +++++++++++++++++ xinetd.spec | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 xinetd-2.3.13-log-crash.patch diff --git a/xinetd-2.3.13-log-crash.patch b/xinetd-2.3.13-log-crash.patch new file mode 100644 index 0000000..abd4d42 --- /dev/null +++ b/xinetd-2.3.13-log-crash.patch @@ -0,0 +1,17 @@ +244063: RHEL4 SIGSEGV in xinetd when application's logfile hit size limit + +Written-By: Jan Safranek + +Initialize xl_callback_arg, so xinetd does not crash when it gets dereferenced. + +diff -up xinetd-2.3.13/libs/src/xlog/xlog.c.orig xinetd-2.3.13/libs/src/xlog/xlog.c +--- xinetd-2.3.13/libs/src/xlog/xlog.c.orig 2003-05-31 23:58:58.000000000 +0200 ++++ xinetd-2.3.13/libs/src/xlog/xlog.c 2007-12-05 15:31:08.000000000 +0100 +@@ -216,6 +216,7 @@ int xlog_control( xlog_h pxlog, xlog_cmd + + case XLOG_CALLBACK: + xp->xl_callback = va_arg( ap, voidfunc ) ; ++ xp->xl_callback_arg = va_arg( ap, void * ); + break ; + + case XLOG_GETFLAG: diff --git a/xinetd.spec b/xinetd.spec index 308594c..283f7c0 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -39,6 +39,7 @@ Patch15: xinetd-2.3.14-ipv6confusion.patch # This fixes bug #593904 - online reconfiguration caused log message # flood when turning off UDP service Patch16: xinetd-2.3.14-udp-reconfig.patch +Patch17: xinetd-2.3.13-log-crash.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -83,6 +84,7 @@ located in the /etc/xinetd.d directory. %patch14 -p1 -b .clean-pfd %patch15 -p1 -b .ipv6confusion %patch16 -p1 -b .udp-reconfig +%patch17 -p1 -b .log-crash aclocal autoconf @@ -142,6 +144,9 @@ fi %{_mandir}/*/* %changelog +- fix crash when application's logfile hit size limit + Related: #244063 + * Wed Jun 02 2010 Jan Zeleny - 2:2.3.14-32 - fixed log message flooding when turning off UDP service during online reconfiguration (#593904) From 68b6b21a14294d67875358a9d211cd0710f6bafa Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Fri, 18 Feb 2011 15:44:10 +0100 Subject: [PATCH 7/9] Release build 2:2.3.14-33 --- xinetd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 283f7c0..6a20095 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 32%{?dist} +Release: 33%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -144,6 +144,7 @@ fi %{_mandir}/*/* %changelog +* Fri Feb 18 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-33 - fix crash when application's logfile hit size limit Related: #244063 From 42827f5f11c4b0bcbad4f3f133d176d9f6b9fbbf Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Thu, 21 Apr 2011 15:25:09 +0200 Subject: [PATCH 8/9] - Fix build warning about "dereferencing type-punned pointer" - Avoid possible hang while logging an unexpected signal - Let RPC services bind to a specific port --- xinetd-2.3.14-fix-type-punned-ptr.patch | 22 ++++++++++++++++++ xinetd-2.3.14-rpc-specific-port.patch | 30 +++++++++++++++++++++++++ xinetd-2.3.14-signal-log-hang.patch | 27 ++++++++++++++++++++++ xinetd.spec | 13 +++++++++++ 4 files changed, 92 insertions(+) create mode 100644 xinetd-2.3.14-fix-type-punned-ptr.patch create mode 100644 xinetd-2.3.14-rpc-specific-port.patch create mode 100644 xinetd-2.3.14-signal-log-hang.patch diff --git a/xinetd-2.3.14-fix-type-punned-ptr.patch b/xinetd-2.3.14-fix-type-punned-ptr.patch new file mode 100644 index 0000000..993169f --- /dev/null +++ b/xinetd-2.3.14-fix-type-punned-ptr.patch @@ -0,0 +1,22 @@ +diff --git a/sensor.c b/sensor.c +index 09d0877..e65018c 100644 +--- a/xinetd/sensor.c ++++ b/xinetd/sensor.c +@@ -100,14 +100,15 @@ void process_sensor( const struct service *sp, const union xsockaddr *addr) + { + /* Here again, eh?...update time stamp. */ + char *exp_time; +- time_t stored_time; ++ int stored_time; + + item_matched--; /* Is # plus 1, to even get here must be >= 1 */ + exp_time = pset_pointer( global_no_access_time, item_matched ) ; + if (exp_time == NULL) + return ; + +- if ( parse_base10(exp_time, (int *)&stored_time) ) ++ /* FIXME: Parse (long int) instead of (int) prior to possible Y2K38 bug. */ ++ if ( parse_base10(exp_time, &stored_time ) ) + { /* if never let them off, bypass */ + if (stored_time != -1) + { diff --git a/xinetd-2.3.14-rpc-specific-port.patch b/xinetd-2.3.14-rpc-specific-port.patch new file mode 100644 index 0000000..19376fd --- /dev/null +++ b/xinetd-2.3.14-rpc-specific-port.patch @@ -0,0 +1,30 @@ +commit 1b91f7b0f67fba11ea8bbcdddef844656434c53c +Author: Jeffrey Bastian +Date: Tue Aug 17 13:45:20 2010 -0500 + + Let RPC services bind to a port + +diff --git a/xinetd/service.c b/xinetd/service.c +index 9f21f93..5d26885 100644 +--- a/xinetd/service.c ++++ b/xinetd/service.c +@@ -165,6 +165,7 @@ static status_e activate_rpc( struct service *sp ) + socklen_t sin_len = sizeof(tsin); + unsigned long vers ; + struct service_config *scp = SVC_CONF( sp ) ; ++ uint16_t service_port = SC_PORT( scp ) ; + struct rpc_data *rdp = SC_RPCDATA( scp ) ; + char *sid = SC_ID( scp ) ; + unsigned registered_versions = 0 ; +@@ -181,9 +182,11 @@ static status_e activate_rpc( struct service *sp ) + } + if( SC_IPV4( scp ) ) { + tsin.sa_in.sin_family = AF_INET ; ++ tsin.sa_in.sin_port = htons( service_port ) ; + sin_len = sizeof(struct sockaddr_in); + } else if( SC_IPV6( scp ) ) { + tsin.sa_in6.sin6_family = AF_INET6 ; ++ tsin.sa_in6.sin6_port = htons( service_port ); + sin_len = sizeof(struct sockaddr_in6); + } + diff --git a/xinetd-2.3.14-signal-log-hang.patch b/xinetd-2.3.14-signal-log-hang.patch new file mode 100644 index 0000000..18fd1a1 --- /dev/null +++ b/xinetd-2.3.14-signal-log-hang.patch @@ -0,0 +1,27 @@ +--- a/xinetd/signals.c 2009-05-07 05:56:52.000000000 -0400 ++++ b/xinetd/signals.c.new 2009-05-07 05:56:44.000000000 -0400 +@@ -389,9 +390,11 @@ + break ; + + default: +- msg( LOG_NOTICE, func, "Unexpected signal %s", sig_name( sig ) ) ; +- if ( debug.on && sig == SIGINT ) +- exit( 1 ) ; ++ /* Let my_handler() queue this signal for later logging. ++ Calling msg() and thus syslog() directly here can hang up ++ the process, trying to acquire an already acquired lock, ++ because another syslog() could have been the interrupted code. */ ++ my_handler(sig); + } + } + +@@ -495,6 +497,9 @@ + default: + msg(LOG_ERR, func, "unexpected signal: %s in signal pipe", + sig_name(sig)); ++ ++ if ( debug.on && sig == SIGINT ) ++ exit( 1 ) ; + } + } + } diff --git a/xinetd.spec b/xinetd.spec index 6a20095..b6d2c54 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -40,6 +40,9 @@ Patch15: xinetd-2.3.14-ipv6confusion.patch # flood when turning off UDP service Patch16: xinetd-2.3.14-udp-reconfig.patch Patch17: xinetd-2.3.13-log-crash.patch +Patch18: xinetd-2.3.14-rpc-specific-port.patch +Patch19: xinetd-2.3.14-signal-log-hang.patch +Patch20: xinetd-2.3.14-fix-type-punned-ptr.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -85,6 +88,9 @@ located in the /etc/xinetd.d directory. %patch15 -p1 -b .ipv6confusion %patch16 -p1 -b .udp-reconfig %patch17 -p1 -b .log-crash +%patch18 -p1 -b .rpc-specific-port +%patch19 -p1 -b .signal-log-hang +%patch20 -p1 -b .fix-type-punned-ptr aclocal autoconf @@ -144,6 +150,13 @@ fi %{_mandir}/*/* %changelog +- Fix build warning about "dereferencing type-punned pointer" + Related: #695674 +- Avoid possible hang while logging an unexpected signal + Related: #501604 +- Let RPC services bind to a specific port + Related: #624800 + * Fri Feb 18 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-33 - fix crash when application's logfile hit size limit Related: #244063 From e71d7a4325caffe890b2e2831699cfb4831b4f53 Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Thu, 21 Apr 2011 15:56:24 +0200 Subject: [PATCH 9/9] Release build 2:2.3.14-34 --- xinetd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index b6d2c54..4890f56 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 33%{?dist} +Release: 34%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -150,6 +150,7 @@ fi %{_mandir}/*/* %changelog +* Thu Apr 21 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-34 - Fix build warning about "dereferencing type-punned pointer" Related: #695674 - Avoid possible hang while logging an unexpected signal