From 4a7d220a8e7b4bf9c80c5a040c076fcefed4657b Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 15 Apr 2009 05:32:42 +0000 Subject: [PATCH 01/84] Initialize branch F-11 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..25c7708 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-11 From 99c943080a91a003e6dbd67d251576ebd46a7cb1 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Mon, 27 Jul 2009 08:06:05 +0000 Subject: [PATCH 02/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 2696390..94cccb1 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 22%{?dist} +Release: 23%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -115,6 +115,9 @@ fi %{_mandir}/*/* %changelog +* Mon Jul 27 2009 Fedora Release Engineering - 2:2.3.14-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Thu Feb 26 2009 Fedora Release Engineering - 2:2.3.14-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From e2ea81b1497e6f82b4e9f662a66c7b3302f9caa1 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 14 Sep 2009 11:55:32 +0000 Subject: [PATCH 03/84] select() function and it's supporting macros replaced by poll() and it's supporting macros --- xinetd-2.3.14-autoconf.patch | 251 ++++++++ xinetd-2.3.14-poll.patch | 1181 ++++++++++++++++++++++++++++++++++ xinetd.spec | 8 + 3 files changed, 1440 insertions(+) create mode 100644 xinetd-2.3.14-autoconf.patch create mode 100644 xinetd-2.3.14-poll.patch diff --git a/xinetd-2.3.14-autoconf.patch b/xinetd-2.3.14-autoconf.patch new file mode 100644 index 0000000..7ce2276 --- /dev/null +++ b/xinetd-2.3.14-autoconf.patch @@ -0,0 +1,251 @@ +--- xinetd-2.3.14/configure.in 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-mod/configure.in 2009-07-29 10:05:44.000000000 +0200 +@@ -20,34 +20,34 @@ AC_CHECK_FUNCS(ecvt, , + AC_CHECK_FUNCS(gcvt, , + AC_CHECK_LIB(m, gcvt)) + +-AC_CHECK_FUNC(strerror, [AC_DEFINE(HAVE_STRERROR)]) +-AC_CHECK_FUNC(strcasecmp, [AC_DEFINE(HAVE_STRCASECMP)]) ++AC_CHECK_FUNC(strerror, [AC_DEFINE(HAVE_STRERROR, 1, "")]) ++AC_CHECK_FUNC(strcasecmp, [AC_DEFINE(HAVE_STRCASECMP, 1, "")]) + AC_CHECK_FUNC(socket, , + AC_CHECK_LIB(socket, socket, , + AC_CHECK_LIB(nsl, socket))) + AC_CHECK_FUNC(inet_aton, , + AC_CHECK_LIB(nsl, inet_aton, , + AC_CHECK_LIB(socket, inet_aton, , +- AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)])))) +-AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV)]) +-AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL)]) +-AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST)]) +-AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR)]) +-AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO)]) +-AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO)]) ++ AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON, 1, "")])))) ++AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV, 1, "")]) ++AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL, 1, "")]) ++AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST, 1, "")]) ++AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR, 1, "")]) ++AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO, 1, "")]) ++AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO, 1, "")]) + + AC_CHECK_HEADERS(sys/types.h sys/termios.h termios.h sys/ioctl.h sys/select.h rpc/rpc.h rpc/rpcent.h sys/file.h ftw.h machine/reg.h netdb.h) +-AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H)]) +-AC_CHECK_HEADER(arpa/inet.h, [AC_DEFINE(HAVE_ARPA_INET_H)]) +-AC_CHECK_HEADER(grp.h, [AC_DEFINE(HAVE_GRP_H)]) +-AC_CHECK_HEADER(rpc/pmap_clnt.h, [AC_DEFINE(HAVE_RPC_PMAP_CLNT_H)]) +-AC_CHECK_HEADER(sys/socket.h, [AC_DEFINE(HAVE_SYS_SOCKET_H)]) +-AC_CHECK_HEADER(sys/signal.h, [AC_DEFINE(HAVE_SYS_SIGNAL_H)]) +-AC_CHECK_HEADER(crypt.h, [AC_DEFINE(HAVE_CRYPT_H)]) +-AC_CHECK_HEADER(stdint.h, [AC_DEFINE(HAVE_STDINT_H)]) +-AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H)]) +-AC_CHECK_HEADER(sys/filio.h, [AC_DEFINE(HAVE_SYS_FILIO_H)]) +-AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [AC_DEFINE(HAVE_DNSREGISTRATION) AC_DEFINE(HAVE_MDNS)]) ++AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H, 1, "")]) ++AC_CHECK_HEADER(arpa/inet.h, [AC_DEFINE(HAVE_ARPA_INET_H, 1, "")]) ++AC_CHECK_HEADER(grp.h, [AC_DEFINE(HAVE_GRP_H, 1, "")]) ++AC_CHECK_HEADER(rpc/pmap_clnt.h, [AC_DEFINE(HAVE_RPC_PMAP_CLNT_H, 1, "")]) ++AC_CHECK_HEADER(sys/socket.h, [AC_DEFINE(HAVE_SYS_SOCKET_H, 1, "")]) ++AC_CHECK_HEADER(sys/signal.h, [AC_DEFINE(HAVE_SYS_SIGNAL_H, 1, "")]) ++AC_CHECK_HEADER(crypt.h, [AC_DEFINE(HAVE_CRYPT_H, 1, "")]) ++AC_CHECK_HEADER(stdint.h, [AC_DEFINE(HAVE_STDINT_H, 1, "")]) ++AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, "")]) ++AC_CHECK_HEADER(sys/filio.h, [AC_DEFINE(HAVE_SYS_FILIO_H, 1, "")]) ++AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [AC_DEFINE(HAVE_DNSREGISTRATION, 1, "") AC_DEFINE(HAVE_MDNS, 1, "")]) + + AC_ARG_WITH(howl, [ --with-howl=PATH Compile in howl support. + PATH is the prefix where howl is installed, +@@ -56,7 +56,7 @@ AC_ARG_WITH(howl, [ --with-howl=PATH + OLDLDFLAGS=$LDFLAGS; LDFLAGS="-L$withval/lib/ $LDFLAGS"; + OLDCPPFLAGS=$CPPFLAGS; CPPFLAGS="-I$withval/include/howl/ $CPPFLAGS"; + AC_CHECK_HEADER($withval/include/howl/howl.h, +- [AC_DEFINE(HAVE_HOWL) AC_DEFINE(HAVE_MDNS)], ++ [AC_DEFINE(HAVE_HOWL, 1, "") AC_DEFINE(HAVE_MDNS, 1, "")], + [CFLAGS=$OLDCFLAGS; LDFLAGS=$OLDLDFLAGS; CPPFLAGS=$OLDCPPFLAGS;]) + AC_CHECK_LIB(howl, sw_discovery_publish, [LIBS="-lhowl $LIBS"], [ + OLDLIBS=$LIBS; LIBS="-lpthread $LIBS"; +@@ -88,7 +88,7 @@ AC_CACHE_CHECK([for struct addrinfo], ac + ) + ]) + if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then +- AC_DEFINE(HAVE_STRUCT_ADDRINFO) ++ AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, "") + fi + + AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ +@@ -103,7 +103,7 @@ AC_CACHE_CHECK([for struct in6_addr], ac + ) + ]) + if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then +- AC_DEFINE(HAVE_STRUCT_IN6_ADDR) ++ AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, "") + fi + + AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ +@@ -118,7 +118,7 @@ AC_CACHE_CHECK([for struct sockaddr_in6] + ) + ]) + if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then +- AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) ++ AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, "") + fi + + AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ +@@ -133,15 +133,15 @@ AC_CACHE_CHECK([for struct sockaddr_stor + ) + ]) + if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then +- AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) ++ AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, "") + fi + + + case "$target_os" in + + solaris*) +- AC_DEFINE(N0_SIGLIST) +- AC_DEFINE(solaris) ++ AC_DEFINE(N0_SIGLIST, 1, "") ++ AC_DEFINE(solaris, 1, "") + + AC_MSG_CHECKING(whether to compile in loadavg) + AC_ARG_WITH(loadavg, +@@ -153,12 +153,12 @@ solaris*) + yes) + AC_MSG_RESULT(yes) + AC_CHECK_LIB(kstat, main) +- AC_CHECK_HEADER(kstat.h, [AC_DEFINE(HAVE_KSTAT_H)]) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_CHECK_HEADER(kstat.h, [AC_DEFINE(HAVE_KSTAT_H, 1, "")]) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + esac ], AC_MSG_RESULT(no) ) + ;; +@@ -172,11 +172,11 @@ osf*) + ;; + yes) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + esac ], AC_MSG_RESULT(no)) + ;; +@@ -191,18 +191,18 @@ linux*|freebsd*) + ;; + yes) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + esac ], AC_MSG_RESULT(no)) + ;; + darwin* | "Mac OS"*) + ac_cv_prog_RANLIB="ranlib" + # AC_CHECK_FUNCS doesn't look in the proper header file... +- AC_DEFINE(HAVE_ISATTY) ++ AC_DEFINE(HAVE_ISATTY, 1, "") + CFLAGS="$CFLAGS -no-cpp-precomp" + AC_MSG_CHECKING(whether to compile in loadavg) + AC_ARG_WITH(loadavg,, +@@ -212,11 +212,11 @@ darwin* | "Mac OS"*) + ;; + yes) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + esac ], AC_MSG_RESULT(no)) + ;; +@@ -229,13 +229,13 @@ darwin* | "Mac OS"*) + ;; + yes) + AC_MSG_RESULT(yes) +- AC_DEFINE(bsdi) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(bsdi, 1, "") ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(bsdi) +- AC_DEFINE(HAVE_LOADAVG) ++ AC_DEFINE(bsdi, 1, "") ++ AC_DEFINE(HAVE_LOADAVG, 1, "") + ;; + esac ], AC_MSG_RESULT(no)) + ;; +@@ -245,7 +245,7 @@ esac + AC_CHECK_LIB(c, crypt, [:], [ + AC_CHECK_LIB(crypt, crypt, [ + LIBS="-lcrypt $LIBS" +- AC_DEFINE(HAVE_LIBCRYPT) ], []) ]) ++ AC_DEFINE(HAVE_LIBCRYPT, 1, "") ], []) ]) + + AC_CHECK_LIB(m, log10, [ LIBS="-lm $LIBS" ], []) + +@@ -263,16 +263,16 @@ AC_ARG_WITH(libwrap, + yes) + AC_MSG_RESULT(yes) + AC_CHECK_LIB(wrap, request_init, [ +- AC_DEFINE(LIBWRAP) ++ AC_DEFINE(LIBWRAP, 1, "") + WRAPLIBS="-lwrap" +- AC_DEFINE(HAVE_LIBWRAP) ]) ++ AC_DEFINE(HAVE_LIBWRAP, 1, "") ]) + AC_CHECK_LIB(nsl, yp_get_default_domain, [ + WRAPLIBS="$WRAPLIBS -lnsl" ]) + LIBS="$WRAPLIBS $LIBS" + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(LIBWRAP) ++ AC_DEFINE(LIBWRAP, 1, "") + if test -d "$withval"; then + WRAPLIBS="-L$withval -lwrap" + else +@@ -299,13 +299,13 @@ AC_ARG_WITH(labeled-networking, + yes) + AC_MSG_RESULT(yes) + AC_CHECK_LIB(selinux, setexeccon, [ +- AC_DEFINE(LABELED_NET) ++ AC_DEFINE(LABELED_NET, 1, "") + LABELLIBS="-lselinux" ]) + LIBS="$LABELLIBS $LIBS" + ;; + *) + AC_MSG_RESULT(yes) +- AC_DEFINE(LABELED_NET) ++ AC_DEFINE(LABELED_NET, 1, "") + if test -d "$withval"; then + LABELLIBS="-L$withval -lselinux" + else +--- xinetd-2.3.14/aclocal.m4 2003-02-19 18:29:27.000000000 +0100 ++++ xinetd-2.3.14-mod/aclocal.m4 2009-07-29 10:10:03.000000000 +0200 +@@ -22,6 +22,6 @@ AC_CACHE_VAL(xinetd_cv_type_$1, + #endif], xinetd_cv_type_$1=yes, xinetd_cv_type_$1=no)])dnl + AC_MSG_RESULT($xinetd_cv_type_$1) + if test $xinetd_cv_type_$1 = no; then +- AC_DEFINE($1, $2) ++ AC_DEFINE($1, $2, "") + fi + ]) diff --git a/xinetd-2.3.14-poll.patch b/xinetd-2.3.14-poll.patch new file mode 100644 index 0000000..8aee9d3 --- /dev/null +++ b/xinetd-2.3.14-poll.patch @@ -0,0 +1,1181 @@ +diff -Nurp xinetd-2.3.14-orig/config.h.in xinetd-2.3.14-poll/config.h.in +--- xinetd-2.3.14-orig/config.h.in 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/config.h.in 2009-09-02 11:30:27.000000000 +0200 +@@ -106,6 +106,8 @@ + + #undef HAVE_HOWL + ++#undef HAVE_POLL ++ + /* OS specific */ + #undef solaris + +diff -Nurp xinetd-2.3.14-orig/configure.in xinetd-2.3.14-poll/configure.in +--- xinetd-2.3.14-orig/configure.in 2009-09-02 11:32:54.000000000 +0200 ++++ xinetd-2.3.14-poll/configure.in 2009-09-02 11:30:27.000000000 +0200 +@@ -35,6 +35,7 @@ AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE( + AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR, 1, "")]) + AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO, 1, "")]) + AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO, 1, "")]) ++AC_CHECK_FUNC(poll, [AC_DEFINE(HAVE_POLL, 1, "")]) + + AC_CHECK_HEADERS(sys/types.h sys/termios.h termios.h sys/ioctl.h sys/select.h rpc/rpc.h rpc/rpcent.h sys/file.h ftw.h machine/reg.h netdb.h) + AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H, 1, "")]) +diff -Nurp xinetd-2.3.14-orig/xinetd/conf.c xinetd-2.3.14-poll/xinetd/conf.c +--- xinetd-2.3.14-orig/xinetd/conf.c 2003-12-30 14:44:09.000000000 +0100 ++++ xinetd-2.3.14-poll/xinetd/conf.c 2009-09-02 11:30:27.000000000 +0200 +@@ -209,8 +209,13 @@ unsigned cnf_start_services( struct conf + pset_clear( sconfs ) ; + + if ( debug.on ) ++#ifdef HAVE_POLL ++ msg( LOG_DEBUG, func, "pfds_last = %d, services_started = %d", ++ ps.rws.pfds_last, services_started ) ; ++#else + msg( LOG_DEBUG, func, "mask_max = %d, services_started = %d", + ps.rws.mask_max, services_started ) ; ++#endif + + return( services_started ) ; + } +diff -Nurp xinetd-2.3.14-orig/xinetd/defs.h xinetd-2.3.14-poll/xinetd/defs.h +--- xinetd-2.3.14-orig/xinetd/defs.h 2005-03-29 17:50:34.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/defs.h 2009-09-02 11:30:27.000000000 +0200 +@@ -111,6 +111,15 @@ union xsockaddr { + #define LISTEN_BACKLOG 64 + + /* ++ * constants for limiting ps.rws.fd_list ++ */ ++ ++#ifdef HAVE_POLL ++#define INIT_POLLFDS 1024 ++#define MAX_POLLFDS 8192 ++#endif ++ ++/* + * When explicit values are given for enum's, that is because the structures + * that the enum's are in may be initialized by a memory clear operation. + */ +diff -Nurp xinetd-2.3.14-orig/xinetd/init.c xinetd-2.3.14-poll/xinetd/init.c +--- xinetd-2.3.14-orig/xinetd/init.c 2003-09-06 16:41:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/init.c 2009-09-02 11:30:27.000000000 +0200 +@@ -17,7 +17,7 @@ + #include + #include + #include +- ++#include + #include "sio.h" + #include "init.h" + #include "defs.h" +@@ -140,7 +140,6 @@ static void set_fd_limit(void) + { + #ifdef RLIMIT_NOFILE + struct rlimit rl ; +- rlim_t maxfd ; + + /* + * Set the soft file descriptor limit to the hard limit. +@@ -151,25 +150,9 @@ static void set_fd_limit(void) + exit( 1 ) ; + } + +- maxfd = rl.rlim_max; + if ( rl.rlim_max == RLIM_INFINITY ) + rl.rlim_max = FD_SETSIZE; + +- /* XXX: a dumb way to prevent fd_set overflow possibilities; the rest +- * of xinetd should be changed to use an OpenBSD inetd-like fd_grow(). */ +- if ( rl.rlim_max > FD_SETSIZE ) +- rl.rlim_max = FD_SETSIZE; +- +- rl.rlim_cur = rl.rlim_max ; +- if ( setrlimit( RLIMIT_NOFILE, &rl ) == -1 ) +- { +- syscall_failed("setrlimit(RLIMIT_NOFILE)"); +- ps.ros.max_descriptors = FD_SETSIZE; +- ps.ros.orig_max_descriptors = FD_SETSIZE; +- return ; +- } +- +- ps.ros.orig_max_descriptors = maxfd ; + ps.ros.max_descriptors = rl.rlim_max ; + #else /* ! RLIMIT_NOFILE */ + ps.ros.max_descriptors = getdtablesize() ; +@@ -292,15 +275,27 @@ static pset_h new_table( unsigned size ) + */ + static void init_rw_state( void ) + { ++ const char *func = "init_rw_state" ; + SERVERS( ps ) = new_table( 0 ) ; + RETRIES( ps ) = new_table( 0 ) ; + SERVICES( ps ) = new_table( 0 ) ; + + ps.rws.descriptors_free = ps.ros.max_descriptors - DESCRIPTORS_RESERVED ; + ++#ifdef HAVE_POLL ++ ps.rws.pfds_allocated = INIT_POLLFDS ; ++ ps.rws.pfd_array = (struct pollfd *) ++ malloc( sizeof( struct pollfd ) * ps.rws.pfds_allocated ) ; ++ if ( ps.rws.pfd_array == NULL ) ++ { ++ out_of_memory(func); ++ exit( 1 ) ; ++ } ++ ps.rws.pfds_last = 0 ; ++#else + FD_ZERO( &ps.rws.socket_mask ) ; + ps.rws.mask_max = 0 ; +- ++#endif /* HAVE_POLL */ + } + + +diff -Nurp xinetd-2.3.14-orig/xinetd/intcommon.c xinetd-2.3.14-poll/xinetd/intcommon.c +--- xinetd-2.3.14-orig/xinetd/intcommon.c 2003-08-06 08:12:10.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/intcommon.c 2009-09-03 16:15:49.000000000 +0200 +@@ -14,6 +14,9 @@ + #include + #include + #include ++#ifdef HAVE_POLL ++#include ++#endif + + #include "intcommon.h" + #include "msg.h" +@@ -36,27 +39,38 @@ void int_fail( const struct intercept_s + /* + * Returns either a positive number or -1 + */ ++#ifdef HAVE_POLL ++int int_poll( int pfds_last, struct pollfd *pfd_array ) ++{ ++ const char *func = "int_poll" ; ++#else + int int_select( int max, fd_set *read_mask ) + { + const char *func = "int_select" ; ++#endif + + for ( ;; ) + { + int n_ready ; + +- n_ready = select( max+1, read_mask, +- FD_SET_NULL, FD_SET_NULL, TIMEVAL_NULL ) ; ++ do { ++#ifdef HAVE_POLL ++ n_ready = poll( pfd_array, pfds_last, -1 ); ++#else ++ n_ready = select( max+1, read_mask, ++ FD_SET_NULL, FD_SET_NULL, TIMEVAL_NULL ) ; ++#endif ++ } while (n_ready == -1 && errno == EINTR); ++ ++ + if ( n_ready > 0 ) + return( n_ready ) ; +- else if ( n_ready == -1 ) { +- if ( errno == EINTR ) +- continue ; +- else +- { +- msg( LOG_ERR, func, "select: %m" ) ; +- return( -1 ) ; +- } +- } ++#ifdef HAVE_POLL ++ msg( LOG_ERR, func, "poll: %m" ) ; ++#else ++ msg( LOG_ERR, func, "select: %m" ) ; ++#endif ++ return( -1 ) ; + } + } + +diff -Nurp xinetd-2.3.14-orig/xinetd/internals.c xinetd-2.3.14-poll/xinetd/internals.c +--- xinetd-2.3.14-orig/xinetd/internals.c 2003-09-06 16:41:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/internals.c 2009-09-03 10:38:29.000000000 +0200 +@@ -53,6 +53,9 @@ void dump_internal_state(void) + const char *dump_file = DUMP_FILE ; + time_t current_time ; + int fd ; ++#ifdef HAVE_POLL ++ int *listed_fds; ++#endif + unsigned u ; + const char *func = "dump_internal_state" ; + +@@ -104,6 +107,41 @@ void dump_internal_state(void) + server_dump( SERP( pset_pointer( RETRIES( ps ), u ) ), dump_fd ) ; + Sputchar( dump_fd, '\n' ) ; + ++#ifdef HAVE_POLL ++ /* ++ * Dump the socket mask ++ */ ++ listed_fds = (int *)calloc(sizeof(int),ps.ros.max_descriptors); ++ if (listed_fds != NULL) ++ { ++ Sprint( dump_fd, "Socket mask:" ) ; ++ for ( fd = 0 ; fd < ps.rws.pfds_last ; fd++ ) ++ { ++ listed_fds[ps.rws.pfd_array[fd].fd] = 1; ++ Sprint( dump_fd, " %d", ps.rws.pfd_array[fd].fd ) ; ++ } ++ Sputchar( dump_fd, '\n' ) ; ++ Sprint( dump_fd, "pfds_last = %d\n", ps.rws.pfds_last ) ; ++ ++ /* ++ * Dump the descriptors that are open and are *not* in the socket list ++ */ ++ Sprint( dump_fd, "Open descriptors (not in socket mask):" ) ; ++ for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) ++ { ++ struct stat st ; ++ ++ if ( !listed_fds[fd] && fstat( fd, &st ) != -1 ) ++ Sprint( dump_fd, " %d", fd ) ; ++ } ++ ++ Sputchar( dump_fd, '\n' ) ; ++ Sputchar( dump_fd, '\n' ) ; ++ free(listed_fds); ++ } ++ else ++ Sprint( dump_fd, "Could not dump open descriptors, not enough memory!\n" ); ++#else /* !HAVE_POLL */ + /* + * Dump the socket mask + */ +@@ -114,6 +152,7 @@ void dump_internal_state(void) + Sputchar( dump_fd, '\n' ) ; + Sprint( dump_fd, "mask_max = %d\n", ps.rws.mask_max ) ; + ++ + /* + * Dump the descriptors that are open and are *not* in the socket mask + */ +@@ -130,6 +169,7 @@ void dump_internal_state(void) + } + Sputchar( dump_fd, '\n' ) ; + Sputchar( dump_fd, '\n' ) ; ++#endif /* !HAVE_POLL */ + + Sprint( dump_fd, "active_services = %d\n", ps.rws.active_services ) ; + Sprint( dump_fd, "available_services = %d\n", ps.rws.available_services ) ; +@@ -162,7 +202,6 @@ enum check_type { PERIODIC, USER_REQUEST + static void consistency_check( enum check_type type ) + { + int fd ; +- fd_set socket_mask_copy ; + unsigned u ; + int errors ; + unsigned total_running_servers = 0 ; +@@ -171,7 +210,19 @@ static void consistency_check( enum chec + bool_int service_count_check_failed = FALSE ; + const char *func = "consistency_check" ; + ++ ++#ifdef HAVE_POLL ++ struct pollfd *pfd_array_copy = calloc(sizeof(struct pollfd), ps.rws.pfds_last); ++ if (pfd_array_copy == NULL) ++ { ++ msg( LOG_ERR, func, "Could not run consistency check! Not enough memory!\n" ) ; ++ return; ++ } ++ memcpy(pfd_array_copy, ps.rws.pfd_array, ps.rws.pfds_last*sizeof(struct pollfd)); ++#else /* !HAVE_POLL */ ++ fd_set socket_mask_copy ; + socket_mask_copy = ps.rws.socket_mask ; ++#endif /* HAVE_POLL */ + + for ( u = 0 ; u < pset_count( SERVICES( ps ) ) ; u++ ) + { +@@ -184,9 +235,22 @@ static void consistency_check( enum chec + + if ( SVC_IS_AVAILABLE( sp ) || SVC_IS_DISABLED ( sp ) ) + { ++ + /* + * In this case, there may be some servers running + */ ++#ifdef HAVE_POLL ++ if ( pfd_array_copy[ SVC_POLLFD_OFF( sp ) ].events ) ++ { ++ if ( SVC_IS_DISABLED( sp ) ) ++ { ++ msg( LOG_ERR, func, ++ "fd of disabled service %s still in socket mask", sid ) ; ++ error_count++ ; ++ } ++ pfd_array_copy[ SVC_POLLFD_OFF( sp ) ].events = 0; ++ } ++#else /* !HAVE_POLL */ + if ( FD_ISSET( SVC_FD( sp ), &socket_mask_copy ) ) + { + if ( SVC_IS_DISABLED( sp ) ) +@@ -197,8 +261,9 @@ static void consistency_check( enum chec + } + FD_CLR( SVC_FD( sp ), &socket_mask_copy ) ; + } +- error_count += thread_check( sp, running_servers, retry_servers ) ; ++#endif /* HAVE_POLL */ + ++ error_count += thread_check( sp, running_servers, retry_servers ) ; + errors = service_count_check( sp, running_servers, retry_servers ) ; + if ( ! errors && ! service_count_check_failed ) + { +@@ -248,6 +313,18 @@ static void consistency_check( enum chec + /* + * Check if there are any descriptors set in socket_mask_copy + */ ++#ifdef HAVE_POLL ++ for ( fd = 0 ; fd < ps.rws.pfds_last ; fd++) ++ if ( pfd_array_copy[fd].events && pfd_array_copy[fd].fd != signals_pending[0] && ++ pfd_array_copy[fd].fd != signals_pending[1] ) ++ { ++ msg( LOG_ERR, func, ++ "descriptor %d set in socket mask but there is no service for it", ++ fd ) ; ++ error_count++ ; ++ } ++ free(pfd_array_copy); ++#else /* !HAVE_POLL */ + for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) + if ( FD_ISSET( fd, &socket_mask_copy ) && ((fd != signals_pending[0]) && fd != signals_pending[1])) + { +@@ -256,6 +333,7 @@ static void consistency_check( enum chec + fd ) ; + error_count++ ; + } ++#endif /* !HAVE_POLL */ + + if ( error_count != 0 ) + msg( LOG_WARNING, func, +@@ -304,7 +382,6 @@ static unsigned service_count_check( str + } + + +- + /* + * If the service is single-threaded: + * if the descriptor is set in the socket mask, there must +@@ -317,7 +394,11 @@ static unsigned thread_check( struct ser + unsigned retry_servers ) + { + unsigned error_count = 0 ; ++#ifdef HAVE_POLL ++ struct pollfd *pfd= SVC_POLLFD( sp ) ; ++#else + int sd = SVC_FD( sp ) ; ++#endif + char *sid = SVC_ID( sp ) ; + const char *func = "thread_check" ; + +@@ -325,13 +406,21 @@ static unsigned thread_check( struct ser + { + bool_int has_servers = ( running_servers + retry_servers != 0 ) ; + ++#ifdef HAVE_POLL ++ if ( has_servers && pfd->events ) ++#else + if ( has_servers && FD_ISSET( sd, &ps.rws.socket_mask ) ) ++#endif + { + msg( LOG_ERR, func, + "Active single-threaded service %s: server running, descriptor set", sid ) ; + error_count++ ; + } ++#ifdef HAVE_POLL ++ if ( !has_servers && !pfd->events ) ++#else + if ( !has_servers && !FD_ISSET( sd, &ps.rws.socket_mask ) ) ++#endif + { + msg( LOG_ERR, func, + "Active single-threaded service %s: no server running, descriptor not set", +@@ -340,7 +429,11 @@ static unsigned thread_check( struct ser + } + } + else ++#ifdef HAVE_POLL ++ if ( ! pfd->events ) ++#else + if ( ! FD_ISSET( sd, &ps.rws.socket_mask ) ) ++#endif + { + msg( LOG_ERR, func, + "Active multi-threaded service %s: descriptor not set", sid ) ; +diff -Nurp xinetd-2.3.14-orig/xinetd/main.c xinetd-2.3.14-poll/xinetd/main.c +--- xinetd-2.3.14-orig/xinetd/main.c 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/main.c 2009-09-03 16:23:11.000000000 +0200 +@@ -25,6 +25,9 @@ + #include "xtimer.h" + #include "sensor.h" + #include "xmdns.h" ++#ifdef HAVE_POLL ++#include "xpoll.h" ++#endif + + #ifdef __GNUC__ + __attribute__ ((noreturn)) +@@ -119,16 +122,24 @@ static void main_loop(void) + { + const char *func = "main_loop" ; + struct timeval tv, *tvptr = NULL; ++#ifdef HAVE_POLL ++ struct pollfd *signal_pfd; + +- FD_SET(signals_pending[0], &ps.rws.socket_mask); ++ ps.rws.pfd_array[ps.rws.pfds_last].fd = signals_pending[0] ; ++ ps.rws.pfd_array[ps.rws.pfds_last].events = POLLIN ; ++ signal_pfd = &ps.rws.pfd_array[ps.rws.pfds_last] ; ++ ps.rws.pfds_last++; ++#else ++ FD_SET(signals_pending[0], &ps.rws.socket_mask) ; + if ( signals_pending[0] > ps.rws.mask_max ) + ps.rws.mask_max = signals_pending[0] ; +- if ( signals_pending[1] > ps.rws.mask_max ) +- ps.rws.mask_max = signals_pending[1] ; ++#endif /* HAVE_POLL */ + + for ( ;; ) + { ++#ifndef HAVE_POLL + fd_set read_mask ; ++#endif + int n_active ; + unsigned u ; + +@@ -144,9 +155,14 @@ static void main_loop(void) + tvptr = NULL; + } + ++#ifdef HAVE_POLL ++ n_active = poll( ps.rws.pfd_array, ps.rws.pfds_last, ++ tvptr == NULL ? -1 : tvptr->tv_sec*1000 ) ; ++#else + read_mask = ps.rws.socket_mask ; + n_active = select( ps.rws.mask_max+1, &read_mask, + FD_SET_NULL, FD_SET_NULL, tvptr ) ; ++#endif + if ( n_active == -1 ) + { + if ( errno == EINTR ) { +@@ -165,11 +181,27 @@ static void main_loop(void) + + xtimer_poll(); + +- if( FD_ISSET(signals_pending[0], &read_mask) ) { ++#ifdef HAVE_POLL ++ if ( POLLFD_REVENTS( signal_pfd ) ) ++ { ++ if ( POLLFD_REVENTS( signal_pfd ) & (POLLERR | POLLHUP | ++ POLLNVAL) ) ++ find_bad_fd(); ++ else ++ { ++ check_pipe(); ++ if ( --n_active == 0 ) ++ continue ; ++ } ++ } ++#else ++ if( FD_ISSET(signals_pending[0], &read_mask) ) ++ { + check_pipe(); + if ( --n_active == 0 ) + continue ; + } ++#endif + + #ifdef HAVE_MDNS + if( xinetd_mdns_poll() == 0 ) +@@ -186,19 +218,33 @@ static void main_loop(void) + if ( ! SVC_IS_ACTIVE( sp ) ) + continue ; + ++#ifdef HAVE_POLL ++ if ( SVC_REVENTS( sp ) ) ++ { ++ if ( SVC_REVENTS( sp ) & (POLLERR | POLLHUP | ++ POLLNVAL) ) ++ find_bad_fd(); ++ else ++ { ++ svc_request( sp ) ; ++ if ( --n_active == 0 ) ++ break ; ++ } ++ } ++#else + if ( FD_ISSET( SVC_FD( sp ), &read_mask ) ) + { + svc_request( sp ) ; + if ( --n_active == 0 ) + break ; + } ++#endif + } + if ( n_active > 0 ) + msg( LOG_ERR, func, "%d descriptors still set", n_active ) ; + } + } + +- + /* + * This function identifies if any of the fd's in the socket mask + * is bad. We use it in case select(2) returns EBADF +@@ -208,13 +254,29 @@ static void main_loop(void) + static void find_bad_fd(void) + { + int fd ; ++#ifdef HAVE_POLL ++ const char *reason; ++#else + struct stat st ; ++#endif + unsigned bad_fd_count = 0 ; + const char *func = "find_bad_fd" ; + ++#ifdef HAVE_POLL ++ for ( fd = 0 ; (unsigned)fd < ps.rws.pfds_last ; fd++ ) ++ if ( ps.rws.pfd_array[fd].revents & ( POLLHUP|POLLNVAL|POLLERR ) ) ++ { ++ if ( ps.rws.pfd_array[fd].revents & POLLHUP ) ++ reason = "hung up"; ++ else if ( ps.rws.pfd_array[fd].revents & POLLNVAL ) ++ reason = "been closed"; ++ else if ( ps.rws.pfd_array[fd].revents & POLLERR ) ++ reason = "reported error condition"; ++#else + for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) + if ( FD_ISSET( fd, &ps.rws.socket_mask ) && fstat( fd, &st ) == -1 ) + { ++#endif + int found = FALSE ; + unsigned u ; + +@@ -239,7 +301,11 @@ static void find_bad_fd(void) + } + if ( ! found ) + { ++#ifdef HAVE_POLL ++ ps.rws.pfd_array[fd].events = 0; ++#else + FD_CLR( fd, &ps.rws.socket_mask ) ; ++#endif + msg( LOG_ERR, func, + "No active service for file descriptor %d\n", fd ) ; + bad_fd_count++ ; +diff -Nurp xinetd-2.3.14-orig/xinetd/redirect.c xinetd-2.3.14-poll/xinetd/redirect.c +--- xinetd-2.3.14-orig/xinetd/redirect.c 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/redirect.c 2009-09-02 16:00:34.000000000 +0200 +@@ -58,14 +58,19 @@ void redir_handler( struct server *serp + struct service *sp = SERVER_SERVICE( serp ); + struct service_config *scp = SVC_CONF( sp ); + int RedirDescrip = SERVER_FD( serp ); +- int maxfd; + ssize_t num_read, num_wrote=0, ret=0; + unsigned int sin_len = 0; + unsigned long bytes_in = 0, bytes_out = 0; + int no_to_nagle = 1; + int on = 1, v6on; + char buff[NET_BUFFER]; ++#ifdef HAVE_POLL ++ struct pollfd *pfd_array; ++ int pfds_last = 0; ++#else + fd_set rdfd, msfd; ++ int maxfd; ++#endif + struct timeval *timep = NULL; + const char *func = "redir_handler"; + union xsockaddr serveraddr ; +@@ -141,19 +146,43 @@ void redir_handler( struct server *serp + msg(LOG_ERR, func, "setsockopt RedirDescrip failed: %m"); + } + ++#ifdef HAVE_POLL ++#define REDIR_DESCRIP_INDEX 0 ++#define REDIR_SERVER_INDEX 1 ++ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ if (pfd_array == NULL) ++ { ++ msg( LOG_ERR, func, "Cannot allocate memory for file descriptors!\n"); ++ exit( 1 ); ++ } ++ pfd_array[ REDIR_DESCRIP_INDEX ].fd = RedirDescrip; ++ pfd_array[ REDIR_DESCRIP_INDEX ].events = POLLIN; ++ pfd_array[ REDIR_SERVER_INDEX ].fd = RedirServerFd; ++ pfd_array[ REDIR_SERVER_INDEX ].events = POLLIN; ++ pfds_last += 2; ++#else + maxfd = (RedirServerFd > RedirDescrip)?RedirServerFd:RedirDescrip; + FD_ZERO(&msfd); + FD_SET(RedirDescrip, &msfd); + FD_SET(RedirServerFd, &msfd); ++#endif + + while(1) { ++#ifdef HAVE_POLL ++ if ( poll( pfd_array, pfds_last, -1 ) <= 0 ) { ++#else + memcpy(&rdfd, &msfd, sizeof(rdfd)); + if (select(maxfd + 1, &rdfd, (fd_set *)0, (fd_set *)0, timep) <= 0) { ++#endif + /* place for timeout code, currently does not time out */ + break; + } + ++#ifdef HAVE_POLL ++ if ( pfd_array[REDIR_DESCRIP_INDEX].revents ) { ++#else + if (FD_ISSET(RedirDescrip, &rdfd)) { ++#endif + do { + num_read = read(RedirDescrip, + buff, sizeof(buff)); +@@ -179,7 +208,11 @@ void redir_handler( struct server *serp + } + } + ++#ifdef HAVE_POLL ++ if ( pfd_array[REDIR_SERVER_INDEX].revents ) { ++#else + if (FD_ISSET(RedirServerFd, &rdfd)) { ++#endif + do { + num_read = read(RedirServerFd, + buff, sizeof(buff)); +diff -Nurp xinetd-2.3.14-orig/xinetd/server.c xinetd-2.3.14-poll/xinetd/server.c +--- xinetd-2.3.14-orig/xinetd/server.c 2005-03-29 17:50:34.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/server.c 2009-09-02 11:30:27.000000000 +0200 +@@ -298,7 +298,11 @@ void server_end( struct server *serp ) + + /* Added this for when accepting wait=yes services */ + if( SVC_WAITS( sp ) ) ++#ifdef HAVE_POLL ++ SVC_EVENTS( sp ) = POLLIN ; ++#else + FD_SET( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif /* HAVE_POLL */ + + svc_postmortem( sp, serp ) ; + server_release( serp ) ; +diff -Nurp xinetd-2.3.14-orig/xinetd/service.c xinetd-2.3.14-poll/xinetd/service.c +--- xinetd-2.3.14-orig/xinetd/service.c 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/service.c 2009-09-02 17:03:49.000000000 +0200 +@@ -71,8 +71,6 @@ static const struct name_value service_s + { "BAD STATE", 0 } + } ; + +- +- + /* + * Allocate a new struct service and initialize it from scp + */ +@@ -115,6 +113,10 @@ struct service *svc_make_special( struct + + void svc_free( struct service *sp ) + { ++#ifdef HAVE_POLL ++ *SVC_POLLFD( sp ) = ps.rws.pfd_array[--ps.rws.pfds_last] ; ++#endif /* HAVE_POLL */ ++ + sc_free( SVC_CONF(sp) ) ; + CLEAR( *sp ) ; + FREE_SVC( sp ) ; +@@ -325,6 +327,25 @@ status_e svc_activate( struct service *s + return( OK ); + } + ++#ifdef HAVE_POLL ++ if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) ++ { ++ int pos; ++ ps.rws.pfds_allocated += INIT_POLLFDS; ++ struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, ++ ps.rws.pfds_allocated*sizeof(struct pollfd)); ++ if ( tmp == NULL ) ++ { ++ out_of_memory( func ); ++ return( FAILED ); ++ } ++ memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- ++ ps.rws.pfds_last)*sizeof(struct pollfd)); ++ ps.rws.pfd_array = tmp; ++ } ++ SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; ++#endif /* HAVE_POLL */ ++ + if( SC_IPV4( scp ) ) { + SVC_FD(sp) = socket( AF_INET, + SC_SOCKET_TYPE( scp ), SC_PROTOVAL( scp ) ) ; +@@ -390,9 +411,14 @@ status_e svc_activate( struct service *s + + SVC_STATE(sp) = SVC_ACTIVE ; + ++#ifdef HAVE_POLL ++ SVC_EVENTS( sp ) = POLLIN ; ++#else + FD_SET( SVC_FD(sp), &ps.rws.socket_mask ) ; ++ + if ( SVC_FD(sp) > ps.rws.mask_max ) + ps.rws.mask_max = SVC_FD(sp) ; ++#endif /* HAVE_POLL */ + + ps.rws.active_services++ ; + ps.rws.available_services++ ; +@@ -442,7 +468,11 @@ void svc_deactivate( struct service *sp + + if ( SVC_IS_ACTIVE( sp ) ) + { ++#ifdef HAVE_POLL ++ SVC_EVENTS( sp ) = 0; ++#else + FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif /* HAVE_POLL */ + ps.rws.active_services-- ; + } + +@@ -465,7 +495,15 @@ void svc_suspend( struct service *sp ) + return ; + } + ++#ifdef HAVE_POLL ++ /* ++ * don't reap the pfd from pfd_array, since we must have it allocated for ++ * SVC_FD( sp ) ++ */ ++ SVC_EVENTS( sp ) = 0; ++#else + FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif + ps.rws.active_services-- ; + if ( debug.on ) + msg( LOG_DEBUG, func, "Suspended service %s", SVC_ID( sp ) ) ; +@@ -481,7 +519,12 @@ void svc_resume( struct service *sp ) + { + const char *func = "svc_resume" ; + ++#ifdef HAVE_POLL ++ SVC_EVENTS( sp ) = POLLIN ; ++#else + FD_SET( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif ++ + ps.rws.active_services++ ; + if ( debug.on ) + msg( LOG_DEBUG, func, "Resumed service %s", SVC_ID( sp ) ) ; +diff -Nurp xinetd-2.3.14-orig/xinetd/service.h xinetd-2.3.14-poll/xinetd/service.h +--- xinetd-2.3.14-orig/xinetd/service.h 2005-03-29 17:50:34.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/service.h 2009-09-03 16:24:16.000000000 +0200 +@@ -17,6 +17,9 @@ + #include "pset.h" + #include "xlog.h" + #include "server.h" ++#ifdef HAVE_POLL ++#include "xpoll.h" ++#endif + + /* + * $Id: service.h,v 1.5 2005/03/29 15:50:34 bbraun Exp $ +@@ -45,7 +48,13 @@ struct service + state_e svc_state ; + int svc_ref_count ; /* # of pters to this struct */ + struct service_config *svc_conf ; /* service configuration */ ++ ++#ifdef HAVE_POLL ++ struct pollfd *svc_pfd ; /* pointer to the pollfd */ ++#else + int svc_fd ; /* The Listening FD for the service */ ++#endif /* HAVE_POLL */ ++ + unsigned svc_running_servers ; + unsigned svc_retry_servers ; + unsigned svc_attempts ; /* # of attempts to start server */ +@@ -70,7 +79,17 @@ struct service + * Field access macros + */ + #define SVC_CONF( sp ) ( (sp)->svc_conf ) ++ ++#ifdef HAVE_POLL ++#define SVC_POLLFD( sp ) ( (sp)->svc_pfd ) ++#define SVC_POLLFD_OFF( sp ) ( SVC_POLLFD( sp )-ps.rws.pfd_array ) ++#define SVC_EVENTS( sp ) ( POLLFD_EVENTS( SVC_POLLFD( sp ) ) ) ++#define SVC_REVENTS( sp ) ( POLLFD_REVENTS( SVC_POLLFD( sp ) ) ) ++#define SVC_FD( sp ) ( POLLFD_FD( SVC_POLLFD( sp ) ) ) ++#else + #define SVC_FD( sp ) ( (sp)->svc_fd ) ++#endif /* HAVE_POLL */ ++ + #define SVC_RUNNING_SERVERS( sp ) (sp)->svc_running_servers + #define SVC_RETRIES( sp ) (sp)->svc_retry_servers + #define SVC_LOG( sp ) (sp)->svc_log +diff -Nurp xinetd-2.3.14-orig/xinetd/state.h xinetd-2.3.14-poll/xinetd/state.h +--- xinetd-2.3.14-orig/xinetd/state.h 2005-03-31 01:15:28.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/state.h 2009-09-02 11:30:27.000000000 +0200 +@@ -21,7 +21,10 @@ + #endif + #include "libportable.h" + +-#ifdef HAVE_SYS_SELECT_H ++#ifdef HAVE_POLL ++#include ++#endif ++#if HAVE_SYS_SELECT_H + #include + #endif + +@@ -58,8 +61,15 @@ struct read_write_state + int available_services ; /* # of available services */ + int active_services ; /* services with descriptors set */ + /* in socket mask */ ++#ifdef HAVE_POLL ++ struct pollfd *pfd_array; /* array passed to poll(2) */ ++ int pfds_last; /* index of last fd in the array */ ++ int pfds_allocated; /* size of the array */ ++#else + fd_set socket_mask ; + int mask_max ; ++#endif /* HAVE_POLL */ ++ + pset_h servers ; /* table of running servers */ + pset_h retries ; /* table of servers to retry */ + pset_h services ; /* table of services */ +diff -Nurp xinetd-2.3.14-orig/xinetd/tcpint.c xinetd-2.3.14-poll/xinetd/tcpint.c +--- xinetd-2.3.14-orig/xinetd/tcpint.c 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/tcpint.c 2009-09-02 16:49:32.000000000 +0200 +@@ -63,7 +63,15 @@ struct intercept_s *si_init( struct serv + return( ip ) ; + } + ++#ifdef HAVE_POLL ++static status_e handle_io( psi_h iter, channel_s *chp, ++ struct pollfd *pfd_handled, ++ struct pollfd *pfd_array, ++ int *pfds_last, ++ stream_status_e (*iofunc)() ); ++#else + static status_e handle_io( psi_h iter, channel_s *chp, fd_set *maskp, stream_status_e (*iofunc)() ); ++#endif + static stream_status_e tcp_local_to_remote( channel_s *chp ); + static stream_status_e tcp_remote_to_local( channel_s *chp ); + static void connection_request( struct intercept_s *ip, channel_s **chpp ); +@@ -82,14 +90,26 @@ void si_exit(void) + static void si_mux(void) + { + struct intercept_s *ip = &stream_intercept_state ; ++#ifdef HAVE_POLL ++ struct pollfd *pfd_array; ++ int pfds_last = 0; ++ int pfds_allocated = INIT_POLLFDS; ++#else + fd_set socket_mask ; + int mask_max ; ++#endif + psi_h iter ; + const char *func = "si_mux" ; + ++#ifdef HAVE_POLL ++ pfd_array = calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ pfd_array[ pfds_last ].fd = INT_REMOTE( ip ) ; ++ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; ++#else + FD_ZERO( &socket_mask ) ; + FD_SET( INT_REMOTE( ip ), &socket_mask ) ; + mask_max = INT_REMOTE( ip ) ; ++#endif + + iter = psi_create( INT_CONNECTIONS( ip ) ) ; + if ( iter == NULL ) +@@ -101,26 +121,43 @@ static void si_mux(void) + for ( ;; ) + { + channel_s *chp ; ++#ifndef HAVE_POLL + fd_set read_mask ; ++#endif + int n_ready ; + ++#ifdef HAVE_POLL ++ n_ready = int_poll( pfds_last, pfd_array ) ; ++#else + read_mask = socket_mask ; + n_ready = int_select( mask_max+1, &read_mask ) ; ++#endif + + if ( n_ready == -1 ) + return ; + ++#ifdef HAVE_POLL ++ if ( pfd_array[0].revents & ( POLLIN | POLLOUT ) ) ++#else + if ( FD_ISSET( INT_REMOTE( ip ), &read_mask ) ) ++#endif + { + connection_request( ip, &chp ) ; + if ( chp != NULL ) + { ++#ifdef HAVE_POLL ++ pfd_array[ pfds_last ].fd = chp->ch_local_socket ; ++ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; ++ pfd_array[ pfds_last ].fd = chp->ch_remote_socket ; ++ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; ++#else + FD_SET( chp->ch_local_socket, &socket_mask ) ; + if ( chp->ch_local_socket > mask_max ) + mask_max = chp->ch_local_socket ; + FD_SET( chp->ch_remote_socket, &socket_mask ) ; + if ( chp->ch_remote_socket > mask_max ) + mask_max = chp->ch_remote_socket ; ++#endif + } + if ( --n_ready == 0 ) + continue ; +@@ -128,27 +165,57 @@ static void si_mux(void) + + for ( chp = CHP( psi_start(iter) ) ; chp ; chp = CHP( psi_next(iter) ) ) + { ++#ifdef HAVE_POLL ++ int i; ++ struct pollfd *local_pfd = NULL, *remote_pfd = NULL; ++ ++ /* TODO: detection with O(n)=1 */ ++ for (i = 0 ; i < pfds_last ; i++ ) ++ if (pfd_array[i].fd == chp->ch_local_socket) ++ local_pfd = &pfd_array[i]; ++ else if (pfd_array[i] .fd== chp->ch_remote_socket) ++ remote_pfd = &pfd_array[i]; ++ ++ if ( local_pfd != NULL && ++ local_pfd->revents & ( POLLIN | POLLOUT) ) ++#else + if ( FD_ISSET( chp->ch_local_socket, &read_mask ) ) ++#endif + { + #ifdef DEBUG_TCPINT + if ( debug.on ) + msg( LOG_DEBUG, func, "Input available on local socket %d", + chp->ch_local_socket ) ; + #endif ++#ifdef HAVE_POLL ++ if ( handle_io( iter, chp, local_pfd, pfd_array, ++ &pfds_last, tcp_local_to_remote ) == FAILED ) ++#else + if ( handle_io( iter, chp, &socket_mask, tcp_local_to_remote ) == FAILED ) ++#endif + return ; + if ( --n_ready == 0 ) + break ; + } + ++#ifdef HAVE_POLL ++ if ( remote_pfd != NULL && ++ remote_pfd->revents & ( POLLIN | POLLOUT) ) ++#else + if ( FD_ISSET( chp->ch_remote_socket, &read_mask ) ) ++#endif + { + #ifdef DEBUG_TCPINT + msg( LOG_DEBUG, func, "Input available on remote socket %d", + chp->ch_remote_socket ) ; + #endif ++#ifdef HAVE_POLL ++ if ( handle_io( iter, chp, remote_pfd, pfd_array, ++ &pfds_last, tcp_local_to_remote ) == FAILED ) ++#else + if ( handle_io( iter, chp, + &socket_mask, tcp_remote_to_local ) == FAILED ) ++#endif + return ; + if ( --n_ready == 0 ) + break ; +@@ -158,10 +225,19 @@ static void si_mux(void) + } + + ++#ifdef HAVE_POLL ++static status_e handle_io( psi_h iter, ++ channel_s *chp, ++ struct pollfd *pfd_handled, ++ struct pollfd *pfd_array, ++ int *pfds_last, ++ stream_status_e (*iofunc)() ) ++#else + static status_e handle_io( psi_h iter, + channel_s *chp, + fd_set *maskp, + stream_status_e (*iofunc)() ) ++#endif + { + const char *func = "handle_io" ; + +@@ -178,8 +254,13 @@ static status_e handle_io( psi_h iter, + xaddrname( &chp->ch_from ), ntohs(xaddrport( &chp->ch_from )), + chp->ch_local_socket, chp->ch_remote_socket ) ; + ++#ifdef HAVE_POLL ++ if ( pfd_handled != NULL) ++ *pfd_handled = pfd_array[ --( *pfds_last ) ]; ++#else + FD_CLR( chp->ch_local_socket, maskp ) ; + FD_CLR( chp->ch_remote_socket, maskp ) ; ++#endif + (void) Sclose( chp->ch_remote_socket ) ; + (void) Sclose( chp->ch_local_socket ) ; + psi_remove( iter ) ; +diff -Nurp xinetd-2.3.14-orig/xinetd/udpint.c xinetd-2.3.14-poll/xinetd/udpint.c +--- xinetd-2.3.14-orig/xinetd/udpint.c 2009-07-27 13:27:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/udpint.c 2009-09-02 16:59:33.000000000 +0200 +@@ -15,6 +15,9 @@ + #include + #include + ++#ifdef HAVE_POLL ++#include ++#endif + #ifdef HAVE_SYS_SELECT_H + #include + #endif +@@ -97,34 +100,61 @@ void di_exit(void) + static void di_mux(void) + { + struct intercept_s *ip = &dgram_intercept_state ; ++#ifdef HAVE_POLL ++ struct pollfd *pfd_array; ++ int pfds_last = 0; ++ int pfds_allocated = INIT_POLLFDS; ++#else + fd_set socket_mask ; + int mask_max ; ++#endif + ++#ifdef HAVE_POLL ++ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ pfd_array[ pfds_last ].fd = INT_REMOTE( ip ); ++ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; ++#else + FD_ZERO( &socket_mask ) ; + FD_SET( INT_REMOTE( ip ), &socket_mask ) ; + mask_max = INT_REMOTE( ip ) ; ++#endif + + for ( ;; ) + { + unsigned u ; + channel_s *chp ; ++#ifndef HAVE_POLL + fd_set read_mask ; ++#endif + int n_ready ; + ++#ifdef HAVE_POLL ++ n_ready = int_poll( pfds_last, pfd_array ) ; ++#else + read_mask = socket_mask ; + n_ready = int_select( mask_max+1, &read_mask ) ; ++#endif + + if ( n_ready == -1 ) + return ; + ++#ifdef HAVE_POLL ++ if ( pfd_array[0].revents & ( POLLIN | POLLOUT ) ) ++#else + if ( FD_ISSET( INT_REMOTE( ip ), &read_mask ) ) ++#endif + { + udp_remote_to_local( ip, &chp ) ; + if ( chp != NULL ) + { ++#ifdef HAVE_POLL ++ pfd_array[ pfds_last ].fd = chp->ch_local_socket ; ++ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; ++#else + FD_SET( chp->ch_local_socket, &socket_mask ) ; + if ( chp->ch_local_socket > mask_max ) + mask_max = chp->ch_local_socket ; ++#endif + } + if ( --n_ready == 0 ) + continue ; +@@ -134,7 +164,17 @@ static void di_mux(void) + { + chp = CHP( pset_pointer( INT_CONNECTIONS( ip ), u ) ) ; + ++#ifdef HAVE_POLL ++ int i; ++ /* TODO: detection with O(n)=1 */ ++ for (i = 0 ; i < pfds_last ; i++) ++ if (pfd_array[i].fd == chp->ch_local_socket) ++ break; ++ if (pfd_array[i].fd == chp->ch_local_socket && ++ (pfd_array[i].revents & ( POLLIN | POLLOUT ))) ++#else + if ( FD_ISSET( chp->ch_local_socket, &read_mask ) ) ++#endif + { + if ( udp_local_to_remote( chp ) == FAILED ) + return ; +diff -Nurp xinetd-2.3.14-orig/xinetd/xmdns.c xinetd-2.3.14-poll/xinetd/xmdns.c +--- xinetd-2.3.14-orig/xinetd/xmdns.c 2005-04-08 23:23:07.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/xmdns.c 2009-09-02 17:01:54.000000000 +0200 +@@ -109,7 +109,26 @@ int xinetd_mdns_init(void) { + ps.rws.mdns_state = NULL; + return -1; + } ++#ifdef HAVE_POLL ++ if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) ++ { ++ ps.rws.pfds_allocated += INIT_POLLFDS; ++ struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, ++ ps.rws.pfds_allocated*sizeof(struct pollfd)); ++ if ( tmp == NULL ) ++ { ++ out_of_memory( func ); ++ return -1; ++ } ++ memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- ++ ps.rws.pfds_last)*sizeof(struct pollfd)); ++ ps.rws.pfd_array = tmp; ++ } ++ ps.rws.pfd_array[ ps.rws.pfds_last ].fd = sw_discovery_socket(*(sw_discovery *)ps.rws.mdns_state); ++ ps.rws.pfd_array[ ps.rws.pfds_last++ ].events = POLLIN; ++#else + FD_SET( sw_discovery_socket(*(sw_discovery *)ps.rws.mdns_state), &ps.rws.socket_mask ) ; ++#endif + return 0; + #endif + } +diff -Nurp xinetd-2.3.14-orig/xinetd/xpoll.h xinetd-2.3.14-poll/xinetd/xpoll.h +--- xinetd-2.3.14-orig/xinetd/xpoll.h 1970-01-01 01:00:00.000000000 +0100 ++++ xinetd-2.3.14-poll/xinetd/xpoll.h 2009-09-02 11:30:27.000000000 +0200 +@@ -0,0 +1,23 @@ ++/* ++ * (c) Copyright 2009 by Red Hat Inc. ++ * All rights reserved. The file named COPYRIGHT specifies the terms ++ * and conditions for redistribution. ++ */ ++#include "config.h" ++#ifdef HAVE_POLL ++#ifndef _X_POLL_H ++#define _X_POLL_H ++ ++#include ++#include "defs.h" ++ ++ ++/* Field accessor methods for pollfd in defined in poll.h */ ++#define POLLFD_FD( pfd ) ( (pfd)->fd ) ++#define POLLFD_EVENTS( pfd ) ( (pfd)->events ) ++#define POLLFD_REVENTS( pfd ) ( (pfd)->revents ) ++ ++/* TODO: write memory management stuff in xpoll.c if needed */ ++ ++#endif /* _X_POLL_H */ ++#endif /* HAVE_POLL */ diff --git a/xinetd.spec b/xinetd.spec index 94cccb1..e7d8452 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -19,6 +19,8 @@ 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 +Patch10: xinetd-2.3.14-autoconf.patch +Patch11: xinetd-2.3.14-poll.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -56,6 +58,8 @@ located in the /etc/xinetd.d directory. %patch6 -p1 -b .man-section %patch8 -p1 -b .ident-bind %patch9 -p1 -b .readable-debuginfo +%patch10 -p1 -b .autoconf +%patch11 -p1 -b .poll aclocal autoconf @@ -115,6 +119,10 @@ fi %{_mandir}/*/* %changelog +* Mon Sep 14 2009 Jan Zeleny - 2:2.3.14-24 +- select() function and it's supporting macros replaced by poll() and it's supporting macros +- added patch of configure.in for clean compilation + * Mon Jul 27 2009 Fedora Release Engineering - 2:2.3.14-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild From cd9fff6d3da17fe16916bee04c3223caf28e446b Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 14 Sep 2009 11:59:09 +0000 Subject: [PATCH 04/84] Corrected previously forgotten release number. --- xinetd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index e7d8452..5b06cf8 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 23%{?dist} +Release: 24%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 From 6a4c285fa7f9b5c31fd8764d909e206c4d9c30a8 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Thu, 17 Sep 2009 20:38:05 +0000 Subject: [PATCH 05/84] correction of last patch --- xinetd-2.3.14-poll.patch | 23 ++++++++++++++++++++++- xinetd.spec | 5 ++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/xinetd-2.3.14-poll.patch b/xinetd-2.3.14-poll.patch index 8aee9d3..73d3ec6 100644 --- a/xinetd-2.3.14-poll.patch +++ b/xinetd-2.3.14-poll.patch @@ -57,6 +57,19 @@ diff -Nurp xinetd-2.3.14-orig/xinetd/defs.h xinetd-2.3.14-poll/xinetd/defs.h * When explicit values are given for enum's, that is because the structures * that the enum's are in may be initialized by a memory clear operation. */ +diff -Nurp xinetd-2.3.14-orig/xinetd/child.c xinetd-2.3.14-poll/xinetd/child.c +--- xinetd-2.3.14-orig/xinetd/child.c 2003-09-06 16:41:59.000000000 +0200 ++++ xinetd-2.3.14-poll/xinetd/child.c 2009-09-02 11:30:27.000000000 +0200 +@@ -109,8 +109,7 @@ void exec_server( const struct server *s + + + #ifdef RLIMIT_NOFILE +- rl.rlim_max = ps.ros.orig_max_descriptors ; +- rl.rlim_cur = ps.ros.max_descriptors ; ++ rl.rlim_max = rl.rlim_cur = ps.ros.max_descriptors ; + (void) setrlimit( RLIMIT_NOFILE, &rl ) ; + #endif + #ifdef RLIMIT_AS diff -Nurp xinetd-2.3.14-orig/xinetd/init.c xinetd-2.3.14-poll/xinetd/init.c --- xinetd-2.3.14-orig/xinetd/init.c 2003-09-06 16:41:59.000000000 +0200 +++ xinetd-2.3.14-poll/xinetd/init.c 2009-09-02 11:30:27.000000000 +0200 @@ -831,7 +844,15 @@ diff -Nurp xinetd-2.3.14-orig/xinetd/state.h xinetd-2.3.14-poll/xinetd/state.h #include #endif -@@ -58,8 +61,15 @@ struct read_write_state +@@ -32,7 +35,6 @@ + + struct read_only_state + { +- rlim_t orig_max_descriptors ; /* original soft rlimit */ + rlim_t max_descriptors ; /* original hard rlimit or OPEN_MAX */ + rlim_t process_limit ; /* if 0, there is no limit */ + int cc_interval ; /* # of seconds the cc gets invoked. */ +@@ -58,8 +60,15 @@ struct read_write_state int available_services ; /* # of available services */ int active_services ; /* services with descriptors set */ /* in socket mask */ diff --git a/xinetd.spec b/xinetd.spec index 5b06cf8..9ef5547 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 24%{?dist} +Release: 25%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -119,6 +119,9 @@ fi %{_mandir}/*/* %changelog +* Thu Sep 17 2009 Jan Zeleny - 2:2.3.14-25 +- correction of last patch replacing select() with poll() + * Mon Sep 14 2009 Jan Zeleny - 2:2.3.14-24 - select() function and it's supporting macros replaced by poll() and it's supporting macros - added patch of configure.in for clean compilation From ad2263a1607e333fb48bbac2929ce493831ee7e4 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 12 Oct 2009 08:56:17 +0000 Subject: [PATCH 06/84] updated init script (LSB compliance) --- xinetd.init | 14 ++++++++++++++ xinetd.spec | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/xinetd.init b/xinetd.init index f350d2b..efad9b1 100644 --- a/xinetd.init +++ b/xinetd.init @@ -52,6 +52,10 @@ prog="xinetd" start(){ [ -f /usr/sbin/xinetd ] || exit 5 [ -f /etc/xinetd.conf ] || exit 6 + touch /var/run/xinetd.pid > /dev/null 2>&1 + [ $? -eq 0 ] || exit 4 + touch /var/lock/subsys/xinetd > /dev/null 2>&1 + [ $? -eq 0 ] || exit 4 echo -n $"Starting $prog: " @@ -79,6 +83,16 @@ start(){ stop(){ [ -f /usr/sbin/xinetd ] || exit 5 [ -f /etc/xinetd.conf ] || exit 6 + if [ -f /var/lock/subsys/xinetd ]; then + if [ ! -w /var/lock/subsys/xinetd ]; then + exit 4 + fi + fi + if [ -f /var/run/xinetd.pid ]; then + if [ ! -w /var/run/xinetd.pid ]; then + exit 4 + fi + fi echo -n $"Stopping $prog: " killproc -p /var/run/xinetd.pid $prog diff --git a/xinetd.spec b/xinetd.spec index 9ef5547..3d89f85 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 25%{?dist} +Release: 26%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -119,6 +119,9 @@ fi %{_mandir}/*/* %changelog +* Mon Oct 12 2009 Jan Zeleny - 2:2.3.14-26 +- updated init script (LSB compliance - #528154) + * Thu Sep 17 2009 Jan Zeleny - 2:2.3.14-25 - correction of last patch replacing select() with poll() From e476844265074d30e86ee84b787689f58f99d1a4 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Tue, 20 Oct 2009 11:51:46 +0000 Subject: [PATCH 07/84] new config option - file limit, fixed init script issues with SELinux --- xinetd.init | 20 ++++++-------------- xinetd.spec | 8 +++++++- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/xinetd.init b/xinetd.init index efad9b1..93a62ba 100644 --- a/xinetd.init +++ b/xinetd.init @@ -52,10 +52,9 @@ prog="xinetd" start(){ [ -f /usr/sbin/xinetd ] || exit 5 [ -f /etc/xinetd.conf ] || exit 6 - touch /var/run/xinetd.pid > /dev/null 2>&1 - [ $? -eq 0 ] || exit 4 - touch /var/lock/subsys/xinetd > /dev/null 2>&1 - [ $? -eq 0 ] || exit 4 + # this is suitable way considering SELinux is guarding write + # access to PID file + [ $EUID -eq 0 ] || exit 4 echo -n $"Starting $prog: " @@ -83,16 +82,9 @@ start(){ stop(){ [ -f /usr/sbin/xinetd ] || exit 5 [ -f /etc/xinetd.conf ] || exit 6 - if [ -f /var/lock/subsys/xinetd ]; then - if [ ! -w /var/lock/subsys/xinetd ]; then - exit 4 - fi - fi - if [ -f /var/run/xinetd.pid ]; then - if [ ! -w /var/run/xinetd.pid ]; then - exit 4 - fi - fi + # this is suitable way considering SELinux is guarding write + # access to PID file + [ $EUID -eq 0 ] || exit 4 echo -n $"Stopping $prog: " killproc -p /var/run/xinetd.pid $prog diff --git a/xinetd.spec b/xinetd.spec index 3d89f85..bfdc271 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 26%{?dist} +Release: 27%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -21,6 +21,7 @@ Patch8: xinetd-2.3.14-ident-bind.patch Patch9: xinetd-2.3.14-readable-debuginfo.patch Patch10: xinetd-2.3.14-autoconf.patch Patch11: xinetd-2.3.14-poll.patch +Patch12: xinetd-2.3.14-file-limit.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -60,6 +61,7 @@ located in the /etc/xinetd.d directory. %patch9 -p1 -b .readable-debuginfo %patch10 -p1 -b .autoconf %patch11 -p1 -b .poll +%patch12 -p1 -b .file-limit aclocal autoconf @@ -119,6 +121,10 @@ fi %{_mandir}/*/* %changelog +* Tue Oct 20 2009 Jan Zeleny - 2:2.3.14-27 +- last update of init script modified to work with SELinux correctly +- added support for new configuration option - file limit for service + * Mon Oct 12 2009 Jan Zeleny - 2:2.3.14-26 - updated init script (LSB compliance - #528154) From 811e1c67fe190a710aee7cbcebb66085aa5fe867 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Tue, 20 Oct 2009 12:08:42 +0000 Subject: [PATCH 08/84] added patch file belonging to the previous commit --- xinetd-2.3.14-file-limit.patch | 126 +++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 xinetd-2.3.14-file-limit.patch diff --git a/xinetd-2.3.14-file-limit.patch b/xinetd-2.3.14-file-limit.patch new file mode 100644 index 0000000..b5a8e3a --- /dev/null +++ b/xinetd-2.3.14-file-limit.patch @@ -0,0 +1,126 @@ +diff -Nurp xinetd-2.3.14-orig/xinetd/attr.h xinetd-2.3.14-files/xinetd/attr.h +--- xinetd-2.3.14-orig/xinetd/attr.h 2005-10-05 19:15:33.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/attr.h 2009-10-20 13:08:45.000000000 +0200 +@@ -61,12 +61,13 @@ + #define A_DISABLED 43 + #define A_MDNS 44 + #define A_LIBWRAP 45 ++#define A_RLIMIT_FILES 46 + + /* + * SERVICE_ATTRIBUTES is the number of service attributes and also + * the number from which defaults-only attributes start. + */ +-#define SERVICE_ATTRIBUTES ( A_MDNS + 1 ) ++#define SERVICE_ATTRIBUTES ( A_MDNS + 2 ) + + /* + * Mask of attributes that must be specified. +diff -Nurp xinetd-2.3.14-orig/xinetd/child.c xinetd-2.3.14-files/xinetd/child.c +--- xinetd-2.3.14-orig/xinetd/child.c 2009-10-20 13:07:34.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/child.c 2009-10-20 13:10:16.000000000 +0200 +@@ -109,6 +109,10 @@ void exec_server( const struct server *s + + + #ifdef RLIMIT_NOFILE ++ if ( SC_RLIM_FILES( scp )) ++ { ++ ps.ros.max_descriptors = SC_RLIM_FILES( scp ); ++ } + rl.rlim_max = rl.rlim_cur = ps.ros.max_descriptors ; + (void) setrlimit( RLIMIT_NOFILE, &rl ) ; + #endif +diff -Nurp xinetd-2.3.14-orig/xinetd/parse.c xinetd-2.3.14-files/xinetd/parse.c +--- xinetd-2.3.14-orig/xinetd/parse.c 2005-10-05 19:15:33.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/parse.c 2009-10-20 13:08:45.000000000 +0200 +@@ -92,6 +92,9 @@ static const struct attribute service_at + #ifdef RLIMIT_DATA + { "rlimit_data", A_RLIMIT_DATA, 1, rlim_data_parser }, + #endif ++#ifdef RLIMIT_NOFILE ++ { "rlimit_files", A_RLIMIT_FILES, 1, rlim_files_parser }, ++#endif + #ifdef RLIMIT_RSS + { "rlimit_rss", A_RLIMIT_RSS, 1, rlim_rss_parser }, + #endif +diff -Nurp xinetd-2.3.14-orig/xinetd/parsers.c xinetd-2.3.14-files/xinetd/parsers.c +--- xinetd-2.3.14-orig/xinetd/parsers.c 2005-10-05 23:45:41.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/parsers.c 2009-10-20 13:08:45.000000000 +0200 +@@ -1415,6 +1415,29 @@ status_e rlim_data_parser( pset_h values + } + #endif + ++#ifdef RLIMIT_NOFILE ++status_e rlim_files_parser( pset_h values, ++ struct service_config *scp, ++ enum assign_op op ) ++{ ++ char *mem = (char *) pset_pointer( values, 0 ) ; ++ const char *func = "rlim_files_parser" ; ++ ++ if ( EQ( mem, "UNLIMITED" ) ) ++ SC_RLIM_FILES(scp) = (rlim_t)RLIM_INFINITY ; ++ else ++ { ++ if ( get_limit ( mem, &SC_RLIM_FILES(scp)) ) ++ { ++ parsemsg( LOG_ERR, func, ++ "Max files limit is invalid: %s", mem ) ; ++ return( FAILED ) ; ++ } ++ } ++ return( OK ) ; ++} ++#endif ++ + #ifdef RLIMIT_RSS + status_e rlim_rss_parser( pset_h values, + struct service_config *scp, +diff -Nurp xinetd-2.3.14-orig/xinetd/parsers.h xinetd-2.3.14-files/xinetd/parsers.h +--- xinetd-2.3.14-orig/xinetd/parsers.h 2005-10-05 19:15:33.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/parsers.h 2009-10-20 13:08:45.000000000 +0200 +@@ -57,6 +57,9 @@ status_e rlim_cpu_parser(pset_h, struct + #ifdef RLIMIT_DATA + status_e rlim_data_parser(pset_h, struct service_config *, enum assign_op) ; + #endif ++#ifdef RLIMIT_NOFILE ++status_e rlim_files_parser(pset_h, struct service_config *, enum assign_op) ; ++#endif + #ifdef RLIMIT_RSS + status_e rlim_rss_parser(pset_h, struct service_config *, enum assign_op) ; + #endif +diff -Nurp xinetd-2.3.14-orig/xinetd/sconf.h xinetd-2.3.14-files/xinetd/sconf.h +--- xinetd-2.3.14-orig/xinetd/sconf.h 2009-10-20 13:07:34.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/sconf.h 2009-10-20 13:08:45.000000000 +0200 +@@ -143,6 +143,7 @@ struct service_config + rlim_t sc_rlim_as; + rlim_t sc_rlim_cpu; + rlim_t sc_rlim_data; ++ rlim_t sc_rlim_files; + rlim_t sc_rlim_rss; + rlim_t sc_rlim_stack; + mode_t sc_umask; +@@ -191,6 +192,7 @@ struct service_config + #define SC_RLIM_AS( scp ) (scp)->sc_rlim_as + #define SC_RLIM_CPU( scp ) (scp)->sc_rlim_cpu + #define SC_RLIM_DATA( scp ) (scp)->sc_rlim_data ++#define SC_RLIM_FILES( scp ) (scp)->sc_rlim_files + #define SC_RLIM_RSS( scp ) (scp)->sc_rlim_rss + #define SC_RLIM_STACK( scp ) (scp)->sc_rlim_stack + #define SC_TYPE( scp ) (scp)->sc_type +diff -Nurp xinetd-2.3.14-orig/xinetd/xinetd.conf.man xinetd-2.3.14-files/xinetd/xinetd.conf.man +--- xinetd-2.3.14-orig/xinetd/xinetd.conf.man 2009-10-20 13:07:34.000000000 +0200 ++++ xinetd-2.3.14-files/xinetd/xinetd.conf.man 2009-10-20 13:08:45.000000000 +0200 +@@ -569,6 +569,12 @@ is implemented, it is more useful to set + rlimit_rss and rlimit_stack. This resource limit is only implemented on + Linux systems. + .TP ++.B rlimit_files ++Sets the maximum number of open files that the service may use. ++One parameter is required, which is a positive integer representing ++the number of open file descriptors. Practical limit of this number ++is around 1024000. ++.TP + .B rlimit_cpu + Sets the maximum number of CPU seconds that the service may use. + One parameter is required, which is either a positive integer representing From 3354bbb91ef32fc9529c4f85be97c30f279d8a54 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 22:40:59 +0000 Subject: [PATCH 09/84] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8f300bf..72d2dbb 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: xinetd -# $Id: Makefile,v 1.1 2004/09/09 14:47:05 cvsdist Exp $ +# $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 $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +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)) From 019be5492277d65513cc913b9970090624761ee1 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:33:36 +0000 Subject: [PATCH 10/84] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8f300bf..72d2dbb 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: xinetd -# $Id: Makefile,v 1.1 2004/09/09 14:47:05 cvsdist Exp $ +# $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 $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +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)) From 3e022482d1cc95152466163b7736d8fcbcb0dcc6 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Thu, 21 Jan 2010 09:38:27 +0000 Subject: [PATCH 11/84] fixed issue with tcpmux service (#543968) --- xinetd-2.3.14-tcpmux.patch | 16 ++++++++++++++++ xinetd.spec | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-tcpmux.patch diff --git a/xinetd-2.3.14-tcpmux.patch b/xinetd-2.3.14-tcpmux.patch new file mode 100644 index 0000000..dd93a67 --- /dev/null +++ b/xinetd-2.3.14-tcpmux.patch @@ -0,0 +1,16 @@ +--- xinetd-2.3.14/xinetd/service.c.tcpmux 2010-01-21 09:50:05.000000000 +0100 ++++ xinetd-2.3.14/xinetd/service.c 2010-01-21 10:21:14.000000000 +0100 +@@ -952,7 +952,12 @@ void close_all_svc_descriptors(void) + out_of_memory( "close_all_svc_descriptors" ) ; + + for ( osp = SP( psi_start( iter ) ) ; osp ; osp = SP( psi_next( iter ) ) ) +- (void) Sclose( SVC_FD( osp ) ) ; ++ { ++#ifdef HAVE_POLL ++ if ( osp && SVC_POLLFD( osp ) ) ++#endif ++ (void) Sclose( SVC_FD( osp ) ) ; ++ } + + psi_destroy( iter ) ; + } diff --git a/xinetd.spec b/xinetd.spec index bfdc271..0954a80 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 27%{?dist} +Release: 28%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -22,6 +22,7 @@ Patch9: xinetd-2.3.14-readable-debuginfo.patch 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 BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -62,6 +63,7 @@ located in the /etc/xinetd.d directory. %patch10 -p1 -b .autoconf %patch11 -p1 -b .poll %patch12 -p1 -b .file-limit +%patch13 -p1 -b .tcpmux aclocal autoconf @@ -121,6 +123,9 @@ fi %{_mandir}/*/* %changelog +* Thu Jan 21 2010 Jan Zeleny - 2:2.3.14-28 +- fixed issue with tcpmux service (#543968) + * Tue Oct 20 2009 Jan Zeleny - 2:2.3.14-27 - last update of init script modified to work with SELinux correctly - added support for new configuration option - file limit for service From b84edf6c34c3b8171ea0a90fcf80163d6c711b2a Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Fri, 19 Mar 2010 08:08:32 +0000 Subject: [PATCH 12/84] 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 c7a1500930cd688f3f84b7eeb68ead2f3a3dc537 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Fri, 19 Mar 2010 08:50:56 +0000 Subject: [PATCH 13/84] 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 8c191cf66a3ae048078926cbada52c7ac4ac00f8 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Wed, 2 Jun 2010 08:38:49 +0000 Subject: [PATCH 14/84] 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 ba9603988bd9c937226a34b239ddf1d642004bf2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:53:37 +0000 Subject: [PATCH 15/84] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- 2 files changed, 21 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile 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) From 97a66e392f7ba4afd4a357d8416a6ac28065cf1e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:53:43 +0000 Subject: [PATCH 16/84] 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 25c7708..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-11 From 78135a135aeb509808254971a19d568c71730032 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 7 Feb 2011 23:16:36 -0600 Subject: [PATCH 17/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 308594c..b9d0e73 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 @@ -142,6 +142,9 @@ fi %{_mandir}/*/* %changelog +* Mon Feb 07 2011 Fedora Release Engineering - 2:2.3.14-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * 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 06f78f0c08d04cd2110f4258fea051a59e5dbb4c Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Mon, 14 Feb 2011 16:14:10 +0100 Subject: [PATCH 18/84] - Add -Wl,-z,relro,-z,now to LDFLAGS --- xinetd.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xinetd.spec b/xinetd.spec index b9d0e73..75fbc38 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -88,6 +88,7 @@ aclocal autoconf %build +export LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" %configure --with-loadavg --with-inet6 %{!?tcp_wrappers:--with-libwrap} --with-labeled-networking make @@ -142,6 +143,8 @@ fi %{_mandir}/*/* %changelog +- Add -Wl,-z,relro,-z,now to LDFLAGS + * Mon Feb 07 2011 Fedora Release Engineering - 2:2.3.14-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From 66e1c3bfcec55d25255454875fd68eb340bf9e56 Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Mon, 14 Feb 2011 16:15:17 +0100 Subject: [PATCH 19/84] 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 75fbc38..1ef48b2 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 @@ -143,6 +143,7 @@ fi %{_mandir}/*/* %changelog +* Mon Feb 14 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-34 - Add -Wl,-z,relro,-z,now to LDFLAGS * Mon Feb 07 2011 Fedora Release Engineering - 2:2.3.14-33 From 10720bbfa3d3d2342a840b8b1760bfe1f29df165 Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Fri, 18 Feb 2011 14:28:01 +0100 Subject: [PATCH 20/84] Add note about -pie -PIE patches to %build configure section --- xinetd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xinetd.spec b/xinetd.spec index 1ef48b2..f18639a 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -88,6 +88,7 @@ aclocal autoconf %build +# -pie -PIE flags added by separate patches export LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" %configure --with-loadavg --with-inet6 %{!?tcp_wrappers:--with-libwrap} --with-labeled-networking make From 19197c2db50806f3c75c216531b2301e89eacfd3 Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Fri, 18 Feb 2011 15:03:06 +0100 Subject: [PATCH 21/84] - fix crash when application's logfile hit size limit Related: #244063 --- xinetd-2.3.13-log-crash.patch | 17 +++++++++++++++++ xinetd.spec | 6 ++++++ 2 files changed, 23 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 f18639a..e3d05bd 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 @@ -144,6 +146,10 @@ fi %{_mandir}/*/* %changelog +* Fri Feb 18 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-35 +- fix crash when application's logfile hit size limit + Related: #244063 + * Mon Feb 14 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-34 - Add -Wl,-z,relro,-z,now to LDFLAGS From 7888d11c91aefdd18018955db6247a5b08e087dd Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Fri, 18 Feb 2011 15:04:26 +0100 Subject: [PATCH 22/84] Release build 2:2.3.14-35 --- xinetd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index e3d05bd..34a47f2 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 34%{?dist} +Release: 35%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 From f48798436d1961de0228e92a02c1fc82ce9260f5 Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Thu, 21 Apr 2011 15:25:09 +0200 Subject: [PATCH 23/84] - 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 34a47f2..38a4bb4 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 @@ -146,6 +152,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-35 - fix crash when application's logfile hit size limit Related: #244063 From 05d81c06138814c21a0e516fa110c31aeaa97cbd Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (V-Teq)" Date: Thu, 21 Apr 2011 15:26:15 +0200 Subject: [PATCH 24/84] Release build 2:2.3.14-36 --- xinetd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 38a4bb4..8a94d6c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 35%{?dist} +Release: 36%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -152,6 +152,7 @@ fi %{_mandir}/*/* %changelog +* Thu Apr 21 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-36 - Fix build warning about "dereferencing type-punned pointer" Related: #695674 - Avoid possible hang while logging an unexpected signal From 0ed034f7e8b8372cb268f2f654fe066680299c86 Mon Sep 17 00:00:00 2001 From: "Tom \"spot\" Callaway" Date: Mon, 12 Sep 2011 09:49:00 -0400 Subject: [PATCH 25/84] convert to systemd --- xinetd.service | 13 ++++++++++++ xinetd.spec | 55 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 xinetd.service diff --git a/xinetd.service b/xinetd.service new file mode 100644 index 0000000..cd8dadc --- /dev/null +++ b/xinetd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Xinetd A Powerful Replacement For Inetd +After=syslog.target network.target + +[Service] +Type=forking +PIDFile=/var/run/xinetd.pid +EnvironmentFile=-/etc/sysconfig/xinetd +ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" + +[Install] +WantedBy=multi-user.target + diff --git a/xinetd.spec b/xinetd.spec index 8a94d6c..8d6f076 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,13 +1,13 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 36%{?dist} +Release: 37%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 URL: http://www.xinetd.org Source: http://www.xinetd.org/xinetd-%{version}.tar.gz -Source1: xinetd.init +Source1: xinetd.service Source3: xinetd.sysconf Patch0: xinetd-2.3.11-pie.patch Patch1: xinetd-2.3.12-tcp_rpc.patch @@ -46,11 +46,15 @@ Patch20: xinetd-2.3.14-fix-type-punned-ptr.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 -Requires: /sbin/chkconfig /etc/init.d /sbin/service +BuildRequires: systemd-units +Requires(post): systemd-sysv +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units %{!?tcp_wrappers:BuildRequires: tcp_wrappers-devel} Requires: filesystem >= 2.0.1, initscripts, setup, fileutils Provides: inetd -BuildRoot: %{_tmppath}/%{name}-%{version}-root + %description Xinetd is a secure replacement for inetd, the Internet services @@ -102,15 +106,14 @@ export LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" make %install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT/etc/xinetd.d/ # Remove unneeded service rm -f contrib/xinetd.d/ftp-sensor %makeinstall DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} install -m 644 contrib/xinetd.conf $RPM_BUILD_ROOT/etc install -m 644 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d -install -m 755 %SOURCE1 $RPM_BUILD_ROOT/etc/rc.d/init.d/xinetd +install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox* rm -f $RPM_BUILD_ROOT/usr/sbin/itox @@ -120,38 +123,50 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl mkdir -p $RPM_BUILD_ROOT/etc/sysconfig install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd -%clean -rm -rf $RPM_BUILD_ROOT - %post -if [ $1 = 1 ]; then - /sbin/chkconfig --add xinetd +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl enable xinetd.service >/dev/null 2>&1 || : fi %preun -if [ $1 = 0 ]; then - /sbin/service xinetd stop > /dev/null 2>&1 - /sbin/chkconfig --del xinetd +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable xinetd.service > /dev/null 2>&1 || : + /bin/systemctl stop xinetd.service > /dev/null 2>&1 || : fi %postun -if [ $1 -ge 1 ]; then - /sbin/service xinetd condrestart >/dev/null 2>&1 +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : fi +%triggerun -- xinetd < 2:2.3.14-37 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply xinetd +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save xinetd >/dev/null 2>&1 ||: +/bin/systemctl --no-reload enable xinetd.service >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del xinetd >/dev/null 2>&1 || : +/bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : %files -%defattr(-,root,root) %doc INSTALL CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf - %config(noreplace) /etc/xinetd.conf %config(noreplace) /etc/sysconfig/xinetd -/etc/rc.d/init.d/xinetd +%{_unitdir}/xinetd.service %config(noreplace) /etc/xinetd.d/* /usr/sbin/xinetd %{_mandir}/*/* %changelog +* Mon Sep 12 2011 Tom Callaway - 2:2.3.14-37 +- covert to systemd + * Thu Apr 21 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-36 - Fix build warning about "dereferencing type-punned pointer" Related: #695674 From e4eaa39d98897b345f9df7ed8ea4a9a0a0738a59 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 14 Jan 2012 02:58:40 -0600 Subject: [PATCH 26/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 8d6f076..ad67f6b 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 37%{?dist} +Release: 38%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -164,6 +164,9 @@ fi %{_mandir}/*/* %changelog +* Sat Jan 14 2012 Fedora Release Engineering - 2:2.3.14-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Mon Sep 12 2011 Tom Callaway - 2:2.3.14-37 - covert to systemd From c92212b82669d20f0a2cac8bf1e83071241979f3 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 16 Jan 2012 08:36:22 +0100 Subject: [PATCH 27/84] Fix leaking file descriptors (#702670) --- xinetd-2.3.14-leaking-fds.patch | 52 +++++++++++++++++++++++++++++++++ xinetd.spec | 9 ++++-- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 xinetd-2.3.14-leaking-fds.patch diff --git a/xinetd-2.3.14-leaking-fds.patch b/xinetd-2.3.14-leaking-fds.patch new file mode 100644 index 0000000..bc1b919 --- /dev/null +++ b/xinetd-2.3.14-leaking-fds.patch @@ -0,0 +1,52 @@ +diff -up xinetd-2.3.14-dist/xinetd/service.c xinetd-2.3.14/xinetd/service.c +--- xinetd-2.3.14-dist/xinetd/service.c 2012-01-11 11:50:43.438650900 +0100 ++++ xinetd-2.3.14/xinetd/service.c 2012-01-16 08:18:09.462620084 +0100 +@@ -88,6 +88,7 @@ struct service *svc_new( struct service_ + CLEAR( *sp ) ; + + SVC_CONF(sp) = scp ; ++ sp->svc_pfd_index = -1; + return( sp ) ; + } + +@@ -346,7 +347,16 @@ status_e svc_activate( struct service *s + ps.rws.pfds_last)*sizeof(struct pollfd)); + ps.rws.pfd_array = tmp; + } +- SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; ++ if ( sp->svc_pfd_index >= 0 ) ++ { ++ SVC_POLLFD( sp ) = &ps.rws.pfd_array[sp->svc_pfd_index] ; ++ } ++ else ++ { ++ sp->svc_pfd_index = ps.rws.pfds_last ; ++ SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; ++ } ++ + #endif /* HAVE_POLL */ + + if( SC_IPV4( scp ) ) { +@@ -433,6 +443,11 @@ status_e svc_activate( struct service *s + static void deactivate( const struct service *sp ) + { + (void) Sclose( SVC_FD( sp ) ) ; ++#ifdef HAVE_POLL ++ SVC_FD( sp ) = 0; ++#else ++ FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif + + #ifdef HAVE_MDNS + xinetd_mdns_deregister(SVC_CONF(sp)); +diff -up xinetd-2.3.14-dist/xinetd/service.h xinetd-2.3.14/xinetd/service.h +--- xinetd-2.3.14-dist/xinetd/service.h 2012-01-11 11:50:43.418650925 +0100 ++++ xinetd-2.3.14/xinetd/service.h 2012-01-16 08:02:59.667553008 +0100 +@@ -47,6 +47,7 @@ struct service + { + state_e svc_state ; + int svc_ref_count ; /* # of pters to this struct */ ++ int svc_pfd_index; /* index of pfd in pfd_array */ + struct service_config *svc_conf ; /* service configuration */ + + #ifdef HAVE_POLL diff --git a/xinetd.spec b/xinetd.spec index ad67f6b..ca07944 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -43,6 +43,9 @@ 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 +# Fix leaking file descriptors and pfd_array wasting +# This fixes #702670 +Patch21: xinetd-2.3.14-leaking-fds.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -95,6 +98,7 @@ located in the /etc/xinetd.d directory. %patch18 -p1 -b .rpc-specific-port %patch19 -p1 -b .signal-log-hang %patch20 -p1 -b .fix-type-punned-ptr +%patch21 -p1 -b .leaking-fds aclocal autoconf @@ -164,8 +168,9 @@ fi %{_mandir}/*/* %changelog -* Sat Jan 14 2012 Fedora Release Engineering - 2:2.3.14-38 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild +* Mon Jan 16 2012 Jan Synáček - 2:2.3.14-38 +- Fix leaking file descriptors +- Resolves: #702670 * Mon Sep 12 2011 Tom Callaway - 2:2.3.14-37 - covert to systemd From 188e1584f768f530d193ec3f4ab3490877dbfe4d Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 16 Jan 2012 12:03:10 +0100 Subject: [PATCH 28/84] Fix previous specfile changelog mistake --- xinetd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index ca07944..d0003d9 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 38%{?dist} +Release: 39%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -168,10 +168,13 @@ fi %{_mandir}/*/* %changelog -* Mon Jan 16 2012 Jan Synáček - 2:2.3.14-38 +* Mon Jan 16 2012 Jan Synáček - 2:2.3.14-39 - Fix leaking file descriptors - Resolves: #702670 +* Sat Jan 14 2012 Fedora Release Engineering - 2:2.3.14-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Mon Sep 12 2011 Tom Callaway - 2:2.3.14-37 - covert to systemd From 7de7f60c176e9fd4cae641dff2145d7a0a8945ec Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 17 Jan 2012 09:51:04 +0100 Subject: [PATCH 29/84] Fix memory corruption when loading a large number of services (#720390) --- xinetd-2.3.14-many-services.patch | 27 +++++++++++++++++++++++++++ xinetd.spec | 10 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-many-services.patch diff --git a/xinetd-2.3.14-many-services.patch b/xinetd-2.3.14-many-services.patch new file mode 100644 index 0000000..8459b6c --- /dev/null +++ b/xinetd-2.3.14-many-services.patch @@ -0,0 +1,27 @@ +--- xinetd-2.3.14-dist/xinetd/defs.h 2012-01-16 12:20:54.739041678 +0100 ++++ xinetd-2.3.14/xinetd/defs.h 2012-01-17 08:06:56.800762230 +0100 +@@ -115,8 +115,9 @@ union xsockaddr { + */ + + #ifdef HAVE_POLL +-#define INIT_POLLFDS 1024 +-#define MAX_POLLFDS 8192 ++#define INIT_POLLFDS 4096 ++/* FIXME: not used */ ++#define MAX_POLLFDS 16384 + #endif + + /* +--- xinetd-2.3.14-dist/xinetd/service.c 2012-01-16 12:20:54.741041678 +0100 ++++ xinetd-2.3.14/xinetd/service.c 2012-01-17 08:07:28.872746991 +0100 +@@ -343,9 +343,9 @@ status_e svc_activate( struct service *s + out_of_memory( func ); + return( FAILED ); + } ++ ps.rws.pfd_array = tmp; + memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- + ps.rws.pfds_last)*sizeof(struct pollfd)); +- ps.rws.pfd_array = tmp; + } + if ( sp->svc_pfd_index >= 0 ) + { diff --git a/xinetd.spec b/xinetd.spec index d0003d9..b9e4121 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 39%{?dist} +Release: 40%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -46,6 +46,9 @@ Patch20: xinetd-2.3.14-fix-type-punned-ptr.patch # Fix leaking file descriptors and pfd_array wasting # This fixes #702670 Patch21: xinetd-2.3.14-leaking-fds.patch +# Fix memory corruption when loading a large number of services +# This fixes #720390 +Patch22: xinetd-2.3.14-many-services.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -99,6 +102,7 @@ located in the /etc/xinetd.d directory. %patch19 -p1 -b .signal-log-hang %patch20 -p1 -b .fix-type-punned-ptr %patch21 -p1 -b .leaking-fds +%patch22 -p1 -b .many-services aclocal autoconf @@ -168,6 +172,10 @@ fi %{_mandir}/*/* %changelog +* Tue Jan 17 2012 Jan Synáček - 2:2.3.14-40 +- Fix memory corruption when loading a large number of services +- Resolves #720390 + * Mon Jan 16 2012 Jan Synáček - 2:2.3.14-39 - Fix leaking file descriptors - Resolves: #702670 From 84f1870618322de0cafd9fbb7a12c9b86df729e8 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 18 Jan 2012 14:41:53 +0100 Subject: [PATCH 30/84] Remove realloc inside svc_activate that was causing memory corruption Number of alloc'd file descriptors is now determined by system limits (ulimit -n) Add patch -realloc-remove --- xinetd-2.3.14-realloc-remove.patch | 134 +++++++++++++++++++++++++++++ xinetd.spec | 10 ++- 2 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-realloc-remove.patch diff --git a/xinetd-2.3.14-realloc-remove.patch b/xinetd-2.3.14-realloc-remove.patch new file mode 100644 index 0000000..6fd1902 --- /dev/null +++ b/xinetd-2.3.14-realloc-remove.patch @@ -0,0 +1,134 @@ +diff -rup xinetd-2.3.14/xinetd/defs.h xinetd-2.3.14-mod/xinetd/defs.h +--- xinetd-2.3.14/xinetd/defs.h 2012-01-18 14:22:20.811100158 +0100 ++++ xinetd-2.3.14-mod/xinetd/defs.h 2012-01-18 13:32:46.000000000 +0100 +@@ -114,11 +114,7 @@ union xsockaddr { + * constants for limiting ps.rws.fd_list + */ + +-#ifdef HAVE_POLL +-#define INIT_POLLFDS 4096 +-/* FIXME: not used */ +-#define MAX_POLLFDS 16384 +-#endif ++#define MAX_FDS 4096 + + /* + * When explicit values are given for enum's, that is because the structures +diff -rup xinetd-2.3.14/xinetd/init.c xinetd-2.3.14-mod/xinetd/init.c +--- xinetd-2.3.14/xinetd/init.c 2012-01-18 14:22:20.779100171 +0100 ++++ xinetd-2.3.14-mod/xinetd/init.c 2012-01-18 14:07:34.000000000 +0100 +@@ -151,7 +151,7 @@ static void set_fd_limit(void) + } + + if ( rl.rlim_max == RLIM_INFINITY ) +- rl.rlim_max = FD_SETSIZE; ++ rl.rlim_max = MAX_FDS; + + ps.ros.max_descriptors = rl.rlim_max ; + #else /* ! RLIMIT_NOFILE */ +@@ -283,12 +283,12 @@ static void init_rw_state( void ) + ps.rws.descriptors_free = ps.ros.max_descriptors - DESCRIPTORS_RESERVED ; + + #ifdef HAVE_POLL +- ps.rws.pfds_allocated = INIT_POLLFDS ; ++ ps.rws.pfds_allocated = ps.ros.max_descriptors ; + ps.rws.pfd_array = (struct pollfd *) + malloc( sizeof( struct pollfd ) * ps.rws.pfds_allocated ) ; + if ( ps.rws.pfd_array == NULL ) + { +- out_of_memory(func); ++ out_of_memory(func) ; + exit( 1 ) ; + } + ps.rws.pfds_last = 0 ; +diff -rup xinetd-2.3.14/xinetd/redirect.c xinetd-2.3.14-mod/xinetd/redirect.c +--- xinetd-2.3.14/xinetd/redirect.c 2012-01-18 14:22:20.780100170 +0100 ++++ xinetd-2.3.14-mod/xinetd/redirect.c 2012-01-18 12:22:08.000000000 +0100 +@@ -149,7 +149,7 @@ void redir_handler( struct server *serp + #ifdef HAVE_POLL + #define REDIR_DESCRIP_INDEX 0 + #define REDIR_SERVER_INDEX 1 +- pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),MAX_FDS); + if (pfd_array == NULL) + { + msg( LOG_ERR, func, "Cannot allocate memory for file descriptors!\n"); +diff -rup xinetd-2.3.14/xinetd/service.c xinetd-2.3.14-mod/xinetd/service.c +--- xinetd-2.3.14/xinetd/service.c 2012-01-18 14:22:20.812100157 +0100 ++++ xinetd-2.3.14-mod/xinetd/service.c 2012-01-18 14:07:27.000000000 +0100 +@@ -114,10 +114,6 @@ struct service *svc_make_special( struct + + void svc_free( struct service *sp ) + { +-#ifdef HAVE_POLL +- *SVC_POLLFD( sp ) = ps.rws.pfd_array[--ps.rws.pfds_last] ; +-#endif /* HAVE_POLL */ +- + sc_free( SVC_CONF(sp) ) ; + CLEAR( *sp ) ; + FREE_SVC( sp ) ; +@@ -332,20 +328,10 @@ status_e svc_activate( struct service *s + } + + #ifdef HAVE_POLL +- if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) ++ if ( ps.rws.descriptors_free <= 0 ) + { +- int pos; +- ps.rws.pfds_allocated += INIT_POLLFDS; +- struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, +- ps.rws.pfds_allocated*sizeof(struct pollfd)); +- if ( tmp == NULL ) +- { +- out_of_memory( func ); +- return( FAILED ); +- } +- ps.rws.pfd_array = tmp; +- memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- +- ps.rws.pfds_last)*sizeof(struct pollfd)); ++ msg(LOG_ERR, func, "Maximum number of services reached") ; ++ return( FAILED ) ; + } + if ( sp->svc_pfd_index >= 0 ) + { +diff -rup xinetd-2.3.14/xinetd/tcpint.c xinetd-2.3.14-mod/xinetd/tcpint.c +--- xinetd-2.3.14/xinetd/tcpint.c 2012-01-18 14:22:20.782100169 +0100 ++++ xinetd-2.3.14-mod/xinetd/tcpint.c 2012-01-18 13:30:22.000000000 +0100 +@@ -93,7 +93,7 @@ static void si_mux(void) + #ifdef HAVE_POLL + struct pollfd *pfd_array; + int pfds_last = 0; +- int pfds_allocated = INIT_POLLFDS; ++ int pfds_allocated = MAX_FDS; + #else + fd_set socket_mask ; + int mask_max ; +@@ -102,7 +102,7 @@ static void si_mux(void) + const char *func = "si_mux" ; + + #ifdef HAVE_POLL +- pfd_array = calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ pfd_array = calloc(sizeof(struct pollfd),MAX_FDS); + pfd_array[ pfds_last ].fd = INT_REMOTE( ip ) ; + pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; + #else +diff -rup xinetd-2.3.14/xinetd/udpint.c xinetd-2.3.14-mod/xinetd/udpint.c +--- xinetd-2.3.14/xinetd/udpint.c 2012-01-18 14:22:20.783100169 +0100 ++++ xinetd-2.3.14-mod/xinetd/udpint.c 2012-01-18 12:22:00.000000000 +0100 +@@ -103,14 +103,14 @@ static void di_mux(void) + #ifdef HAVE_POLL + struct pollfd *pfd_array; + int pfds_last = 0; +- int pfds_allocated = INIT_POLLFDS; ++ int pfds_allocated = MAX_FDS; + #else + fd_set socket_mask ; + int mask_max ; + #endif + + #ifdef HAVE_POLL +- pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); ++ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),MAX_FDS); + pfd_array[ pfds_last ].fd = INT_REMOTE( ip ); + pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; + #else diff --git a/xinetd.spec b/xinetd.spec index b9e4121..e19bc9b 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 40%{?dist} +Release: 41%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -49,6 +49,8 @@ Patch21: xinetd-2.3.14-leaking-fds.patch # Fix memory corruption when loading a large number of services # This fixes #720390 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 BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -103,6 +105,7 @@ located in the /etc/xinetd.d directory. %patch20 -p1 -b .fix-type-punned-ptr %patch21 -p1 -b .leaking-fds %patch22 -p1 -b .many-services +%patch23 -p1 -b .realloc-remove aclocal autoconf @@ -172,6 +175,11 @@ fi %{_mandir}/*/* %changelog +* Wed Jan 18 2012 Jan Synáček - 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) +- Add patch -realloc-remove + * Tue Jan 17 2012 Jan Synáček - 2:2.3.14-40 - Fix memory corruption when loading a large number of services - Resolves #720390 From 41152253b14d86fe3e30af3c2b7e2be8dd821b13 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 2 Mar 2012 09:27:04 +0100 Subject: [PATCH 31/84] Fix leaking descriptor when starting a service fails (#795188) --- xinetd-2.3.14-leaking-fds-2.patch | 18 ++++++++++++++++++ xinetd.spec | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-leaking-fds-2.patch diff --git a/xinetd-2.3.14-leaking-fds-2.patch b/xinetd-2.3.14-leaking-fds-2.patch new file mode 100644 index 0000000..13cb163 --- /dev/null +++ b/xinetd-2.3.14-leaking-fds-2.patch @@ -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 ) ; + } + diff --git a/xinetd.spec b/xinetd.spec index e19bc9b..b654669 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -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 - 2:2.3.14-42 +- Fix leaking descriptor when starting a service fails (#795188) + * Wed Jan 18 2012 Jan Synáček - 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) From f1cc4e9d325cc2f3ff1229476f309bb902e40f8f Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 2 Mar 2012 09:27:04 +0100 Subject: [PATCH 32/84] Fix leaking descriptor when starting a service fails (#795188) --- xinetd-2.3.14-leaking-fds-2.patch | 18 ++++++++++++++++++ xinetd.spec | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-leaking-fds-2.patch diff --git a/xinetd-2.3.14-leaking-fds-2.patch b/xinetd-2.3.14-leaking-fds-2.patch new file mode 100644 index 0000000..13cb163 --- /dev/null +++ b/xinetd-2.3.14-leaking-fds-2.patch @@ -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 ) ; + } + diff --git a/xinetd.spec b/xinetd.spec index e19bc9b..b654669 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -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 - 2:2.3.14-42 +- Fix leaking descriptor when starting a service fails (#795188) + * Wed Jan 18 2012 Jan Synáček - 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) From ee9dff33c48659496df30cb7d7430c3d87b961c0 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 10:58:34 +0100 Subject: [PATCH 33/84] Fix xinetd.service permissions --- xinetd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index b654669..aeb6312 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 42%{?dist} +Release: 43%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -127,7 +127,7 @@ rm -f contrib/xinetd.d/ftp-sensor %makeinstall DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} install -m 644 contrib/xinetd.conf $RPM_BUILD_ROOT/etc install -m 644 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d -install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} +install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox* rm -f $RPM_BUILD_ROOT/usr/sbin/itox @@ -178,6 +178,9 @@ fi %{_mandir}/*/* %changelog +* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 +- Fix xinetd.service permissions + * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From 49f62e47db8e46081944f67c85cab929e537f091 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 11:00:21 +0100 Subject: [PATCH 34/84] Remove useless INSTALL from package documentation --- xinetd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index aeb6312..e6e0cdf 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -169,7 +169,7 @@ fi /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : %files -%doc INSTALL CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf +%doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf %config(noreplace) /etc/xinetd.conf %config(noreplace) /etc/sysconfig/xinetd %{_unitdir}/xinetd.service @@ -180,6 +180,7 @@ fi %changelog * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions +- Remove useless INSTALL from package documentation * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From eced601a8854f634d50da2875ff77f15d330311e Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 11:15:31 +0100 Subject: [PATCH 35/84] Implement reload in xinetd.service --- xinetd.service | 1 + xinetd.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/xinetd.service b/xinetd.service index cd8dadc..20efb2c 100644 --- a/xinetd.service +++ b/xinetd.service @@ -7,6 +7,7 @@ Type=forking PIDFile=/var/run/xinetd.pid EnvironmentFile=-/etc/sysconfig/xinetd ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" +ExecReload=/usr/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target diff --git a/xinetd.spec b/xinetd.spec index e6e0cdf..6c67988 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -181,6 +181,7 @@ fi * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions - Remove useless INSTALL from package documentation +- Implement reload in xinetd.service * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From c789a7586f0cc73d9feebdc0b71b074b424f8e34 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 15:03:46 +0100 Subject: [PATCH 36/84] Fix: Instances limit in xinetd can be easily bypassed Resolves: #770858 --- xinetd-2.3.14-instances.patch | 22 ++++++++++++++++++++++ xinetd.spec | 9 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-instances.patch diff --git a/xinetd-2.3.14-instances.patch b/xinetd-2.3.14-instances.patch new file mode 100644 index 0000000..6def242 --- /dev/null +++ b/xinetd-2.3.14-instances.patch @@ -0,0 +1,22 @@ +--- xinetd-2.3.14/xinetd/access.c 2005-10-05 19:15:33.000000000 +0200 ++++ xinetd-2.3.14-mod/xinetd/access.c 2012-03-05 14:54:30.935416926 +0100 +@@ -73,6 +73,7 @@ static void cps_service_restart(void) + unsigned int i; + time_t nowtime; + const char *func = "cps_service_restart"; ++ int rs; + + nowtime = time(NULL); + for( i=0; i < pset_count( SERVICES(ps) ); i++ ) { +@@ -84,8 +85,11 @@ static void cps_service_restart(void) + if( SVC_STATE(sp) == SVC_DISABLED ) { + scp = SVC_CONF( sp ); + if ( SC_TIME_REENABLE(scp) <= nowtime ) { ++ rs = SVC_RUNNING_SERVERS(sp); + /* re-enable the service */ + if( svc_activate(sp) == OK ) { ++ /* remember running servers after restart */ ++ SVC_RUNNING_SERVERS(sp) = rs; + msg(LOG_ERR, func, + "Activating service %s", SC_NAME(scp)); + } else { diff --git a/xinetd.spec b/xinetd.spec index 6c67988..8328304 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 43%{?dist} +Release: 44%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -53,6 +53,8 @@ Patch22: xinetd-2.3.14-many-services.patch 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 +# Fix #770858 - Instances limit in xinetd can be easily bypassed +Patch25: xinetd-2.3.14-instances.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -109,6 +111,7 @@ located in the /etc/xinetd.d directory. %patch22 -p1 -b .many-services %patch23 -p1 -b .realloc-remove %patch24 -p1 -b .leaking-fds-2 +%patch25 -p1 -b .instances aclocal autoconf @@ -178,6 +181,10 @@ fi %{_mandir}/*/* %changelog +* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-44 +- Fix: Instances limit in xinetd can be easily bypassed +- Resolves: #770858 + * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions - Remove useless INSTALL from package documentation From 23ddc9f8a32b326d51ead4677d0d75b0f1ee04f6 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 10:58:34 +0100 Subject: [PATCH 37/84] Fix xinetd.service permissions --- xinetd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index b654669..aeb6312 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 42%{?dist} +Release: 43%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -127,7 +127,7 @@ rm -f contrib/xinetd.d/ftp-sensor %makeinstall DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} install -m 644 contrib/xinetd.conf $RPM_BUILD_ROOT/etc install -m 644 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d -install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} +install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox* rm -f $RPM_BUILD_ROOT/usr/sbin/itox @@ -178,6 +178,9 @@ fi %{_mandir}/*/* %changelog +* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 +- Fix xinetd.service permissions + * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From d038b394141559a6bc02843091233137e057327a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 11:00:21 +0100 Subject: [PATCH 38/84] Remove useless INSTALL from package documentation --- xinetd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index aeb6312..e6e0cdf 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -169,7 +169,7 @@ fi /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : %files -%doc INSTALL CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf +%doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf %config(noreplace) /etc/xinetd.conf %config(noreplace) /etc/sysconfig/xinetd %{_unitdir}/xinetd.service @@ -180,6 +180,7 @@ fi %changelog * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions +- Remove useless INSTALL from package documentation * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From 7b9af589de83583223357c654324de1ac67e065e Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 11:15:31 +0100 Subject: [PATCH 39/84] Implement reload in xinetd.service --- xinetd.service | 1 + xinetd.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/xinetd.service b/xinetd.service index cd8dadc..20efb2c 100644 --- a/xinetd.service +++ b/xinetd.service @@ -7,6 +7,7 @@ Type=forking PIDFile=/var/run/xinetd.pid EnvironmentFile=-/etc/sysconfig/xinetd ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" +ExecReload=/usr/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target diff --git a/xinetd.spec b/xinetd.spec index e6e0cdf..6c67988 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -181,6 +181,7 @@ fi * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions - Remove useless INSTALL from package documentation +- Implement reload in xinetd.service * Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 - Fix leaking descriptor when starting a service fails (#795188) From 5ae7170961e48c7ef7d3ea8b503b3348ba8a7057 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Mar 2012 15:03:46 +0100 Subject: [PATCH 40/84] Fix: Instances limit in xinetd can be easily bypassed Resolves: #770858 --- xinetd-2.3.14-instances.patch | 22 ++++++++++++++++++++++ xinetd.spec | 9 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.14-instances.patch diff --git a/xinetd-2.3.14-instances.patch b/xinetd-2.3.14-instances.patch new file mode 100644 index 0000000..6def242 --- /dev/null +++ b/xinetd-2.3.14-instances.patch @@ -0,0 +1,22 @@ +--- xinetd-2.3.14/xinetd/access.c 2005-10-05 19:15:33.000000000 +0200 ++++ xinetd-2.3.14-mod/xinetd/access.c 2012-03-05 14:54:30.935416926 +0100 +@@ -73,6 +73,7 @@ static void cps_service_restart(void) + unsigned int i; + time_t nowtime; + const char *func = "cps_service_restart"; ++ int rs; + + nowtime = time(NULL); + for( i=0; i < pset_count( SERVICES(ps) ); i++ ) { +@@ -84,8 +85,11 @@ static void cps_service_restart(void) + if( SVC_STATE(sp) == SVC_DISABLED ) { + scp = SVC_CONF( sp ); + if ( SC_TIME_REENABLE(scp) <= nowtime ) { ++ rs = SVC_RUNNING_SERVERS(sp); + /* re-enable the service */ + if( svc_activate(sp) == OK ) { ++ /* remember running servers after restart */ ++ SVC_RUNNING_SERVERS(sp) = rs; + msg(LOG_ERR, func, + "Activating service %s", SC_NAME(scp)); + } else { diff --git a/xinetd.spec b/xinetd.spec index 6c67988..8328304 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 43%{?dist} +Release: 44%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -53,6 +53,8 @@ Patch22: xinetd-2.3.14-many-services.patch 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 +# Fix #770858 - Instances limit in xinetd can be easily bypassed +Patch25: xinetd-2.3.14-instances.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -109,6 +111,7 @@ located in the /etc/xinetd.d directory. %patch22 -p1 -b .many-services %patch23 -p1 -b .realloc-remove %patch24 -p1 -b .leaking-fds-2 +%patch25 -p1 -b .instances aclocal autoconf @@ -178,6 +181,10 @@ fi %{_mandir}/*/* %changelog +* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-44 +- Fix: Instances limit in xinetd can be easily bypassed +- Resolves: #770858 + * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions - Remove useless INSTALL from package documentation From 49f479d3ff873774d69a783af8ecdd55d7d3e0b0 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 3 Apr 2012 09:35:00 +0200 Subject: [PATCH 41/84] Fix: Service disabled due to bind failure Update patch: xinetd-2.3.14-leaking-fds-2.patch Resolves: #809272 --- xinetd-2.3.14-leaking-fds-2.patch | 18 ------- xinetd-2.3.14-leaking-fds-2a.patch | 41 ++++++++++++++ ...14-retry-svc-activate-in-cps-restart.patch | 54 +++++++++++++++++++ xinetd.spec | 14 +++-- 4 files changed, 106 insertions(+), 21 deletions(-) delete mode 100644 xinetd-2.3.14-leaking-fds-2.patch create mode 100644 xinetd-2.3.14-leaking-fds-2a.patch create mode 100644 xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch diff --git a/xinetd-2.3.14-leaking-fds-2.patch b/xinetd-2.3.14-leaking-fds-2.patch deleted file mode 100644 index 13cb163..0000000 --- a/xinetd-2.3.14-leaking-fds-2.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- 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 ) ; - } - diff --git a/xinetd-2.3.14-leaking-fds-2a.patch b/xinetd-2.3.14-leaking-fds-2a.patch new file mode 100644 index 0000000..90901e5 --- /dev/null +++ b/xinetd-2.3.14-leaking-fds-2a.patch @@ -0,0 +1,41 @@ +diff -Naur xinetd-2.3.14-dist/xinetd/service.c xinetd-2.3.14/xinetd/service.c +--- xinetd-2.3.14-dist/xinetd/service.c 2012-04-03 08:59:19.000000000 +0200 ++++ xinetd-2.3.14/xinetd/service.c 2012-04-03 09:02:34.588160317 +0200 +@@ -366,12 +366,24 @@ + + msg( LOG_ERR, func, + "socket creation failed (%m). service = %s", SC_ID( scp ) ) ; ++#ifdef HAVE_POLL ++ SVC_EVENTS( sp ) = 0; ++ SVC_FD( sp ) = 0; ++#else ++ FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; ++#endif /* HAVE_POLL */ + return( FAILED ) ; + } + + if ( set_fd_modes( sp ) == FAILED ) + { + (void) Sclose( SVC_FD(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 */ + return( FAILED ) ; + } + +@@ -385,6 +397,12 @@ + if ( status == FAILED ) + { + (void) Sclose( SVC_FD(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 */ + return( FAILED ) ; + } + diff --git a/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch b/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch new file mode 100644 index 0000000..7ff5c0b --- /dev/null +++ b/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch @@ -0,0 +1,54 @@ +diff -Napur xinetd-2.3.14.old/xinetd/access.c xinetd-2.3.14.new/xinetd/access.c +--- xinetd-2.3.14.old/xinetd/access.c 2005-10-05 10:15:33.000000000 -0700 ++++ xinetd-2.3.14.new/xinetd/access.c 2012-02-22 20:12:09.120973124 -0800 +@@ -89,9 +89,20 @@ static void cps_service_restart(void) + msg(LOG_ERR, func, + "Activating service %s", SC_NAME(scp)); + } else { +- msg(LOG_ERR, func, +- "Error activating service %s", +- SC_NAME(scp)) ; ++ /* Try to restart the service */ ++ SVC_ATTEMPTS(sp) += 1; ++ if ( SVC_ATTEMPTS(sp) < MAX_SVC_ATTEMPTS ) { ++ msg(LOG_ERR, func, ++ "Error activating service %s, retrying %d more time(s)...", ++ SC_NAME(scp), ++ MAX_SVC_ATTEMPTS - SVC_ATTEMPTS(sp)); ++ xtimer_add(cps_service_restart, 1); ++ } else { ++ /* Give up */ ++ msg(LOG_ERR, func, ++ "Error activating service %s", ++ SC_NAME(scp)); ++ } + } /* else */ + } + } +diff -Napur xinetd-2.3.14.old/xinetd/service.c xinetd-2.3.14.new/xinetd/service.c +--- xinetd-2.3.14.old/xinetd/service.c 2012-02-22 19:16:56.288912783 -0800 ++++ xinetd-2.3.14.new/xinetd/service.c 2012-02-22 19:25:03.059356909 -0800 +@@ -397,6 +408,7 @@ status_e svc_activate( struct service *s + * Initialize the service data + */ + SVC_RUNNING_SERVERS(sp) = SVC_RETRIES(sp) = 0 ; ++ SVC_ATTEMPTS(sp) = 0; + + if ( SC_MUST_LISTEN( scp ) ) + (void) listen( SVC_FD(sp), LISTEN_BACKLOG ) ; +diff -Napur xinetd-2.3.14.old/xinetd/xconfig.h xinetd-2.3.14.new/xinetd/xconfig.h +--- xinetd-2.3.14.old/xinetd/xconfig.h 2003-02-19 09:29:28.000000000 -0800 ++++ xinetd-2.3.14.new/xinetd/xconfig.h 2012-02-22 19:20:20.360855514 -0800 +@@ -59,6 +59,12 @@ + #define DEFAULT_LOOP_TIME 10 + + /* ++ * The number of times to attempt re-activating a service after being ++ * deactivated due to the above. ++ */ ++#define MAX_SVC_ATTEMPTS 30 ++ ++/* + * Signal-to-action mapping + */ + #ifndef RECONFIG_HARD_SIG diff --git a/xinetd.spec b/xinetd.spec index 8328304..7d9d521 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 44%{?dist} +Release: 45%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -52,9 +52,11 @@ 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 +Patch24: xinetd-2.3.14-leaking-fds-2a.patch # Fix #770858 - Instances limit in xinetd can be easily bypassed Patch25: xinetd-2.3.14-instances.patch +# Fix #809272 - Service disabled due to bind failure +Patch26: xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -110,8 +112,9 @@ 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 +%patch24 -p1 -b .leaking-fds-2a %patch25 -p1 -b .instances +%patch26 -p1 -b .retry-svc-activate aclocal autoconf @@ -181,6 +184,11 @@ fi %{_mandir}/*/* %changelog +* Fri Apr 13 2012 Jan Synáček - 2:2.3.14-45 +- Fix: Service disabled due to bind failure +- Update patch: xinetd-2.3.14-leaking-fds-2.patch +- Resolves: #809272 + * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-44 - Fix: Instances limit in xinetd can be easily bypassed - Resolves: #770858 From 8be953dc1facc8ae9c4a8f9cdd3c848048fb27c0 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 13 Apr 2012 15:24:27 +0200 Subject: [PATCH 42/84] Fix: service file: avoid problems when name resolution is not ready Resolves: #748931 --- xinetd.service | 2 +- xinetd.spec | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xinetd.service b/xinetd.service index 20efb2c..0322631 100644 --- a/xinetd.service +++ b/xinetd.service @@ -1,6 +1,6 @@ [Unit] Description=Xinetd A Powerful Replacement For Inetd -After=syslog.target network.target +After=syslog.target network.target NetworkManager-wait-online.service [Service] Type=forking diff --git a/xinetd.spec b/xinetd.spec index 7d9d521..8ecf3c0 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.14 -Release: 45%{?dist} +Release: 46%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -184,6 +184,10 @@ fi %{_mandir}/*/* %changelog +* Fri Apr 13 2012 Jan Synáček - 2:2.3.14-46 +- Fix: service file: avoid problems when name resolution is not ready +- Resolves: #748931 + * Fri Apr 13 2012 Jan Synáček - 2:2.3.14-45 - Fix: Service disabled due to bind failure - Update patch: xinetd-2.3.14-leaking-fds-2.patch From 8335f4629592c46677ed0e5fac75dc9b0fc265ec Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 16 Apr 2012 12:37:56 +0200 Subject: [PATCH 43/84] remove unnecessary patch after a faulty merge --- xinetd-2.3.14-leaking-fds-2.patch | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 xinetd-2.3.14-leaking-fds-2.patch diff --git a/xinetd-2.3.14-leaking-fds-2.patch b/xinetd-2.3.14-leaking-fds-2.patch deleted file mode 100644 index 13cb163..0000000 --- a/xinetd-2.3.14-leaking-fds-2.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- 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 ) ; - } - From 8b25de519ca3bcfe4fda7fe709995e66dc25ee46 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 14 May 2012 09:55:36 +0200 Subject: [PATCH 44/84] Update to 2.3.15 Drop patches merged by upstream (-log-crash, -tcp_rpc, -label, -contextconf, -ssize_t) Update -pie, -PIE, -poll patch Resolves: #820927 --- .gitignore | 1 + sources | 2 +- xinetd-2.3.11-PIE.patch | 22 -- xinetd-2.3.11-pie.patch | 22 -- xinetd-2.3.12-tcp_rpc.patch | 34 -- xinetd-2.3.13-log-crash.patch | 17 - xinetd-2.3.14-contextconf.patch | 110 ------ xinetd-2.3.14-label.patch | 227 ----------- xinetd-2.3.14-poll.patch | 2 +- xinetd-2.3.14-ssize_t.patch | 660 -------------------------------- xinetd-2.3.15-PIE.patch | 22 ++ xinetd-2.3.15-pie.patch | 22 ++ xinetd.spec | 29 +- 13 files changed, 60 insertions(+), 1110 deletions(-) delete mode 100644 xinetd-2.3.11-PIE.patch delete mode 100644 xinetd-2.3.11-pie.patch delete mode 100644 xinetd-2.3.12-tcp_rpc.patch delete mode 100644 xinetd-2.3.13-log-crash.patch delete mode 100644 xinetd-2.3.14-contextconf.patch delete mode 100644 xinetd-2.3.14-label.patch delete mode 100644 xinetd-2.3.14-ssize_t.patch create mode 100644 xinetd-2.3.15-PIE.patch create mode 100644 xinetd-2.3.15-pie.patch diff --git a/.gitignore b/.gitignore index 85e4324..bb93fed 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ xinetd-2.3.14.tar.gz +/xinetd-2.3.15.tar.gz diff --git a/sources b/sources index a7d61b7..d77687c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -567382d7972613090215c6c54f9b82d9 xinetd-2.3.14.tar.gz +77358478fd58efa6366accae99b8b04c xinetd-2.3.15.tar.gz diff --git a/xinetd-2.3.11-PIE.patch b/xinetd-2.3.11-PIE.patch deleted file mode 100644 index ee274a2..0000000 --- a/xinetd-2.3.11-PIE.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xinetd/Makefile.in.pie 2003-06-07 09:47:24.000000000 -0700 -+++ xinetd/Makefile.in 2003-10-28 10:59:55.000000000 -0800 -@@ -119,7 +119,7 @@ - $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) - - xinetd: $(OBJS) -- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ -+ $(CC) $(CFLAGS) $(DEBUG) -o $@ -PIE $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ - - clean: - rm -f $(OBJS) $(NAME) core itox ---- Makefile.in.pie 2003-10-28 10:54:39.000000000 -0800 -+++ Makefile.in 2003-10-28 10:54:39.000000000 -0800 -@@ -14,7 +14,7 @@ - - LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ - --CFLAGS += @CFLAGS@ -+CFLAGS += @CFLAGS@ -fPIE - DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -g - - diff --git a/xinetd-2.3.11-pie.patch b/xinetd-2.3.11-pie.patch deleted file mode 100644 index 330bde2..0000000 --- a/xinetd-2.3.11-pie.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xinetd/Makefile.in.pie 2003-06-07 09:47:24.000000000 -0700 -+++ xinetd/Makefile.in 2003-10-28 10:59:55.000000000 -0800 -@@ -119,7 +119,7 @@ - $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) - - xinetd: $(OBJS) -- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ -+ $(CC) $(CFLAGS) $(DEBUG) -o $@ -pie $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ - - clean: - rm -f $(OBJS) $(NAME) core itox ---- Makefile.in.pie 2003-10-28 10:54:39.000000000 -0800 -+++ Makefile.in 2003-10-28 10:54:39.000000000 -0800 -@@ -14,7 +14,7 @@ - - LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ - --CFLAGS += @CFLAGS@ -+CFLAGS += @CFLAGS@ -fpie - DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -g - - diff --git a/xinetd-2.3.12-tcp_rpc.patch b/xinetd-2.3.12-tcp_rpc.patch deleted file mode 100644 index adfd8bc..0000000 --- a/xinetd-2.3.12-tcp_rpc.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- xinetd-2.3.12/xinetd/service.c.tcp_rpc 2003-06-27 21:05:06.000000000 -0400 -+++ xinetd-2.3.12/xinetd/service.c 2004-01-29 23:09:29.000000000 -0500 -@@ -181,6 +181,9 @@ - else - memset( &tsin, 0, sizeof(tsin)); - -+ if ( SC_PROTOVAL ( scp ) == IPPROTO_TCP ) { -+ M_SET ( scp->sc_xflags, SF_NOLIBWRAP ); -+ } - if( SC_IPV4( scp ) ) { - tsin.sa_in.sin_family = AF_INET ; - sin_len = sizeof(struct sockaddr_in); ---- xinetd-2.3.12/xinetd/xinetd.conf.man.tcp_rpc 2004-01-30 12:38:59.000000000 -0500 -+++ xinetd-2.3.12/xinetd/xinetd.conf.man 2004-01-30 12:43:50.000000000 -0500 -@@ -123,6 +123,8 @@ - to the service. This may be needed in order to use libwrap functionality - not available to long-running processes such as xinetd; in this case, - the tcpd program can be called explicitly (see also the NAMEINARGS flag). -+For RPC services using TCP transport, this flag is automatically turned on, -+because xinetd cannot get remote host address information for the rpc port. - .TP - .B SENSOR - This replaces the service with a sensor that detects accesses to the -@@ -1215,6 +1217,10 @@ - access control on the address of the remote host is not performed when - \fIwait\fP is \fIyes\fP and \fIsocket_type\fP is \fIstream\fP. - .LP -+The NOLIBWRAP flag is automatically turned on for RPC services whose -+\fIsocket_type\fP is \fIstream\fP because xinetd cannot determine the -+address of the remote host. -+.LP - If the - .B INTERCEPT - flag is not used, diff --git a/xinetd-2.3.13-log-crash.patch b/xinetd-2.3.13-log-crash.patch deleted file mode 100644 index abd4d42..0000000 --- a/xinetd-2.3.13-log-crash.patch +++ /dev/null @@ -1,17 +0,0 @@ -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-2.3.14-contextconf.patch b/xinetd-2.3.14-contextconf.patch deleted file mode 100644 index 7bc6b13..0000000 --- a/xinetd-2.3.14-contextconf.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff -rup xinetd-2.3.14-orig/xinetd/child.c xinetd-2.3.14/xinetd/child.c ---- xinetd-2.3.14-orig/xinetd/child.c 2006-11-28 14:03:07.000000000 -0500 -+++ xinetd-2.3.14/xinetd/child.c 2006-11-29 17:04:19.000000000 -0500 -@@ -33,6 +33,8 @@ - #endif - #ifdef LABELED_NET - #include -+#include -+#include - #endif - - #include "str.h" -@@ -49,7 +51,7 @@ - - /* Local declarations */ - #ifdef LABELED_NET --static int set_context_from_socket( int fd ); -+static int set_context_from_socket( const struct service_config *scp, int fd ); - #endif - - -@@ -158,7 +160,7 @@ void exec_server( const struct server *s - #ifdef LABELED_NET - if (SC_LABELED_NET(scp)) - { -- if (set_context_from_socket( descriptor ) < 0) { -+ if (set_context_from_socket( scp, descriptor ) < 0) { - msg( LOG_ERR, func, - "Changing process context failed for %s", SC_ID( scp )) ; - _exit( 1 ) ; -@@ -485,16 +487,11 @@ void child_exit(void) - } - - #ifdef LABELED_NET --static int set_context_from_socket( int fd ) -+static int set_context( security_context_t cntx ) - { -- const char *func = "set_context_from_socket" ; -- security_context_t peer_context; -+ const char *func = "set_context" ; - -- if (getpeercon(fd, &peer_context) < 0) -- return -1; -- -- int retval = setexeccon(peer_context); -- freecon( peer_context ); -+ int retval = setexeccon(cntx); - - if (debug.on) - { -@@ -513,4 +510,59 @@ static int set_context_from_socket( int - - return retval; - } -+ -+static int set_context_from_socket( const struct service_config *scp, int fd ) -+{ -+ security_context_t curr_context = NULL; -+ security_context_t peer_context = NULL; -+ security_context_t exec_context = NULL; -+ context_t bcon = NULL; -+ context_t pcon = NULL; -+ security_context_t new_context = NULL; -+ security_context_t new_exec_context = NULL; -+ int retval = -1; -+ const char *exepath = NULL; -+ -+ if (getcon(&curr_context) < 0) -+ goto fail; -+ -+ if (getpeercon(fd, &peer_context) < 0) -+ goto fail; -+ -+ exepath = SC_SERVER( scp ); -+ if (getfilecon(exepath, &exec_context) < 0) -+ goto fail; -+ -+ if (!(bcon = context_new(curr_context))) -+ goto fail; -+ -+ if (!(pcon = context_new(peer_context))) -+ goto fail; -+ -+ if (!context_range_get(pcon)) -+ goto fail; -+ -+ if (context_range_set(bcon, context_range_get(pcon))) -+ goto fail; -+ -+ if (!(new_context = context_str(bcon))) -+ goto fail; -+ -+ if (security_compute_create(new_context, exec_context, SECCLASS_PROCESS, -+ &new_exec_context) < 0) -+ goto fail; -+ -+ retval = set_context(new_exec_context); -+ -+ freecon(new_exec_context); -+ -+ fail: -+ context_free(pcon); -+ context_free(bcon); -+ freecon(exec_context); -+ freecon(peer_context); -+ freecon(curr_context); -+ -+ return retval; -+} - #endif diff --git a/xinetd-2.3.14-label.patch b/xinetd-2.3.14-label.patch deleted file mode 100644 index aebba77..0000000 --- a/xinetd-2.3.14-label.patch +++ /dev/null @@ -1,227 +0,0 @@ -diff -urp xinetd-2.3.14.orig/config.h.in xinetd-2.3.14/config.h.in ---- xinetd-2.3.14.orig/config.h.in 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/config.h.in 2006-09-20 17:12:00.000000000 -0400 -@@ -112,6 +112,7 @@ - /* Options */ - #undef HAVE_LIBWRAP - #undef LIBWRAP -+#undef LABELED_NET - - #undef HAVE_LOADAVG - -diff -urp xinetd-2.3.14.orig/configure.in xinetd-2.3.14/configure.in ---- xinetd-2.3.14.orig/configure.in 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/configure.in 2006-09-20 17:12:00.000000000 -0400 -@@ -289,6 +289,34 @@ AC_ARG_WITH(libwrap, - AC_MSG_RESULT(no) - ) - -+AC_MSG_CHECKING(whether to use labeled-networking) -+AC_ARG_WITH(labeled-networking, -+[ --with-labeled-networking[=PATH] Compile in labeled networking support.], -+[ case "$withval" in -+ no) -+ AC_MSG_RESULT(no) -+ ;; -+ yes) -+ AC_MSG_RESULT(yes) -+ AC_CHECK_LIB(selinux, setexeccon, [ -+ AC_DEFINE(LABELED_NET) -+ LABELLIBS="-lselinux" ]) -+ LIBS="$LABELLIBS $LIBS" -+ ;; -+ *) -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(LABELED_NET) -+ if test -d "$withval"; then -+ LABELLIBS="-L$withval -lselinux" -+ else -+ LABELLIBS="$withval" -+ fi -+ LIBS="$LABELLIBS $LIBS" -+ ;; -+ esac ], -+ AC_MSG_RESULT(no) -+) -+ - AC_FUNC_MMAP - - AC_CHECK_FUNCS(isatty) -diff -urp xinetd-2.3.14.orig/xinetd/child.c xinetd-2.3.14/xinetd/child.c ---- xinetd-2.3.14.orig/xinetd/child.c 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/child.c 2006-09-20 17:12:00.000000000 -0400 -@@ -31,6 +31,9 @@ - #ifdef HAVE_NETDB_H - #include - #endif -+#ifdef LABELED_NET -+#include -+#endif - - #include "str.h" - #include "child.h" -@@ -44,6 +47,12 @@ - #include "options.h" - #include "redirect.h" - -+/* Local declarations */ -+#ifdef LABELED_NET -+static int set_context_from_socket( int fd ); -+#endif -+ -+ - /* - * This function is running in the new process - */ -@@ -143,6 +152,20 @@ void exec_server( const struct server *s - } - #endif - -+ /* -+ Set the context if the option was given -+ */ -+#ifdef LABELED_NET -+ if (SC_LABELED_NET(scp)) -+ { -+ if (set_context_from_socket( descriptor ) < 0) { -+ msg( LOG_ERR, func, -+ "Changing process context failed for %s", SC_ID( scp )) ; -+ _exit( 1 ) ; -+ } -+ } -+#endif -+ - (void) Sclose( descriptor ) ; - - #ifndef solaris -@@ -461,3 +484,33 @@ void child_exit(void) - } - } - -+#ifdef LABELED_NET -+static int set_context_from_socket( int fd ) -+{ -+ const char *func = "set_context_from_socket" ; -+ security_context_t peer_context; -+ -+ if (getpeercon(fd, &peer_context) < 0) -+ return -1; -+ -+ int retval = setexeccon(peer_context); -+ freecon( peer_context ); -+ -+ if (debug.on) -+ { -+ security_context_t current_exec_context; -+ if ( getexeccon( ¤t_exec_context ) == 0 ) { -+ -+ msg( LOG_DEBUG, func, -+ "current security exec context now: %s", -+ current_exec_context ? current_exec_context : "unknown" ); -+ -+ freecon( current_exec_context ); -+ } -+ else -+ msg( LOG_DEBUG, func, "Error calling getexeccon: %m" ); -+ } -+ -+ return retval; -+} -+#endif -diff -urp xinetd-2.3.14.orig/xinetd/confparse.c xinetd-2.3.14/xinetd/confparse.c ---- xinetd-2.3.14.orig/xinetd/confparse.c 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/confparse.c 2006-09-20 17:16:35.000000000 -0400 -@@ -697,6 +697,35 @@ static status_e check_entry( struct serv - return( FAILED ) ; - } - -+#ifdef LABELED_NET -+ if (SC_LABELED_NET(scp)) { -+ if ( SC_IS_INTERNAL( scp ) ) { -+ msg( LOG_ERR, func, -+ "Internal services cannot support labeled networking: %s", -+ SC_ID(scp) ) ; -+ return( FAILED ) ; -+ } -+ if ( SC_SOCKET_TYPE(scp) != SOCK_STREAM ) { -+ msg( LOG_ERR, func, -+ "Non-stream socket types cannot support labeled networking: %s", -+ SC_ID(scp) ) ; -+ return( FAILED ) ; -+ } -+ if ( SC_WAITS( scp ) ) { -+ msg( LOG_ERR, func, -+ "Tcp wait services cannot support labeled networking: %s", -+ SC_ID(scp) ) ; -+ return( FAILED ) ; -+ } -+ if ( SC_REDIR_ADDR( scp ) != NULL) { -+ msg( LOG_ERR, func, -+ "Redirected services cannot support labeled networking: %s", -+ SC_ID(scp) ) ; -+ return( FAILED ) ; -+ } -+ } -+#endif -+ - if ( SC_IS_MUXCLIENT( scp ) ) - { - if ( !SC_IS_UNLISTED( scp ) ) -diff -urp xinetd-2.3.14.orig/xinetd/main.c xinetd-2.3.14/xinetd/main.c ---- xinetd-2.3.14.orig/xinetd/main.c 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/main.c 2006-09-20 17:12:00.000000000 -0400 -@@ -80,7 +80,10 @@ int main( int argc, char *argv[] ) - #ifdef HAVE_DNSREGISTRATION - "rendezvous " - #endif --#if !defined(LIBWRAP) && !defined(HAVE_LOADAVG) && !defined(HAVE_MDNS) && !defined(HAVE_HOWL) && !defined(HAVE_DNSREGISTRATION) -+#ifdef LABELED_NET -+ "labeled-networking " -+#endif -+#if !defined(LIBWRAP) && !defined(HAVE_LOADAVG) && !defined(HAVE_MDNS) && !defined(HAVE_HOWL) && !defined(HAVE_DNSREGISTRATION) && !defined(LABELED_NET) - "no " - #endif - "options compiled in." -diff -urp xinetd-2.3.14.orig/xinetd/nvlists.c xinetd-2.3.14/xinetd/nvlists.c ---- xinetd-2.3.14.orig/xinetd/nvlists.c 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/nvlists.c 2006-09-20 17:12:00.000000000 -0400 -@@ -47,6 +47,7 @@ const struct name_value service_flags[] - { "SENSOR", SF_SENSOR }, - { "IPv4", SF_IPV4 }, - { "IPv6", SF_IPV6 }, -+ { "LABELED", SF_LABELED }, - { CHAR_NULL, 0 } - } ; - -diff -urp xinetd-2.3.14.orig/xinetd/sconf.h xinetd-2.3.14/xinetd/sconf.h ---- xinetd-2.3.14.orig/xinetd/sconf.h 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/sconf.h 2006-09-20 17:12:00.000000000 -0400 -@@ -58,6 +58,7 @@ - #define SF_SENSOR 9 - #define SF_IPV4 10 - #define SF_IPV6 11 -+#define SF_LABELED 12 - - /* - * Values for log options -@@ -239,6 +240,7 @@ struct service_config - #define SC_SENSOR( scp ) M_IS_SET( (scp)->sc_xflags, SF_SENSOR ) - #define SC_IPV4( scp ) M_IS_SET( (scp)->sc_xflags, SF_IPV4 ) - #define SC_IPV6( scp ) M_IS_SET( (scp)->sc_xflags, SF_IPV6 ) -+#define SC_LABELED_NET( scp ) M_IS_SET( (scp)->sc_xflags, SF_LABELED ) - - #define SC_IS_RPC( scp ) ( M_IS_SET( (scp)->sc_type, ST_RPC ) ) - #define SC_IS_INTERNAL( scp ) ( M_IS_SET( (scp)->sc_type, ST_INTERNAL ) ) -diff -urp xinetd-2.3.14.orig/xinetd/xinetd.conf.man xinetd-2.3.14/xinetd/xinetd.conf.man ---- xinetd-2.3.14.orig/xinetd/xinetd.conf.man 2006-06-16 13:20:01.000000000 -0400 -+++ xinetd-2.3.14/xinetd/xinetd.conf.man 2006-09-20 17:12:00.000000000 -0400 -@@ -145,6 +145,9 @@ Sets the service to be an IPv4 service ( - .B IPv6 - Sets the service to be an IPv6 service (AF_INET6), if IPv6 is available on the system. - .TP -+.B LABELED -+The LABELED flag will tell xinetd to change the child processes SE Linux context to match that of the incoming connection as it starts the service. This only works for external tcp non-waiting servers and is an error if applied to an internal, udp, or tcp-wait server. -+.TP - .B REUSE - The REUSE flag is deprecated. All services now implicitly use the REUSE flag. - .RE diff --git a/xinetd-2.3.14-poll.patch b/xinetd-2.3.14-poll.patch index 73d3ec6..bd87ae5 100644 --- a/xinetd-2.3.14-poll.patch +++ b/xinetd-2.3.14-poll.patch @@ -796,7 +796,7 @@ diff -Nurp xinetd-2.3.14-orig/xinetd/service.h xinetd-2.3.14-poll/xinetd/service +#endif /* - * $Id: service.h,v 1.5 2005/03/29 15:50:34 bbraun Exp $ + * $Id: service.h,v 1.6 2012-05-09 15:40:29 bbraun Exp $ @@ -45,7 +48,13 @@ struct service state_e svc_state ; int svc_ref_count ; /* # of pters to this struct */ diff --git a/xinetd-2.3.14-ssize_t.patch b/xinetd-2.3.14-ssize_t.patch deleted file mode 100644 index c255edd..0000000 --- a/xinetd-2.3.14-ssize_t.patch +++ /dev/null @@ -1,660 +0,0 @@ ---- xinetd-2.3.14/libs/src/sio/impl.h.ssize_t 2006-10-27 12:33:29.000000000 -0400 -+++ xinetd-2.3.14/libs/src/sio/impl.h 2006-10-27 12:40:21.000000000 -0400 -@@ -142,9 +142,9 @@ - * Internal functions that are visible - */ - int __sio_writef( __sio_od_t *odp, int fd ) ; --int __sio_extend_buffer( __sio_id_t *idp, int fd, int b_left ) ; -+ssize_t __sio_extend_buffer( __sio_id_t *idp, int fd, ssize_t b_left ) ; - int __sio_init( __sio_descriptor_t *dp, int fd, enum __sio_stream stream_type ); --int __sio_more( __sio_id_t *idp, int fd ) ; -+ssize_t __sio_more( __sio_id_t *idp, int fd ) ; - sio_status_e __sio_switch( __sio_id_t *idp, int fd ) ; - - ---- xinetd-2.3.14/libs/src/sio/siosup.c.ssize_t 2003-09-06 10:41:59.000000000 -0400 -+++ xinetd-2.3.14/libs/src/sio/siosup.c 2006-10-27 12:40:23.000000000 -0400 -@@ -599,9 +599,9 @@ - * If it does not return SIO_ERR, it sets start, nextb, end - * If it returns SIO_ERR, it does not change anything - */ --static int __sio_readf( __sio_id_t *idp, int fd ) -+static ssize_t __sio_readf( __sio_id_t *idp, int fd ) - { -- int cc ; -+ ssize_t cc ; - - /* - * First check for a tied fd and flush the stream if necessary -@@ -634,7 +634,7 @@ - { - if ( __sio_switch( idp, fd ) == FAILURE ) - return( SIO_ERR ) ; -- cc = -1 ; -+ cc = (ssize_t)-1 ; - } - } - else -@@ -680,7 +680,7 @@ - for ( ;; ) - { - cc = read( fd, idp->buf, (int) idp->buffer_size ) ; -- if ( cc == -1 ) -+ if ( cc == (ssize_t)-1 ) - if ( errno == EINTR ) - continue ; - else -@@ -705,9 +705,9 @@ - * auxiliary buffer) - * Also, if successful, idp->nextb is set to idp->buf, idp->end is modified. - */ --int __sio_extend_buffer( __sio_id_t *idp, int fd, int b_left ) -+ssize_t __sio_extend_buffer( __sio_id_t *idp, int fd, ssize_t b_left ) - { -- int b_read ; -+ ssize_t b_read ; - - /* - * copy to auxiliary buffer -@@ -733,10 +733,10 @@ - * - * Return value: the number of bytes read. - */ --int __sio_more( __sio_id_t *idp, int fd ) -+ssize_t __sio_more( __sio_id_t *idp, int fd ) - { - int b_left = &idp->buf[ idp->buffer_size ] - idp->end ; -- int cc ; -+ ssize_t cc ; - - if ( b_left <= 0 ) - return( 0 ) ; ---- xinetd-2.3.14/libs/src/sio/sprint.c.ssize_t 2006-10-27 13:14:49.000000000 -0400 -+++ xinetd-2.3.14/libs/src/sio/sprint.c 2006-10-27 13:14:51.000000000 -0400 -@@ -18,7 +18,7 @@ - typedef unsigned long long u_wide_int ; - typedef int bool_int ; - --static char *conv_10( wide_int num, bool_int is_unsigned, bool_int *is_negative, char *buf_end, int *len ); -+static char *conv_10( wide_int num, bool_int is_unsigned, bool_int *is_negative, char *buf_end, size_t *len ); - - #define S_NULL_LEN 6 - static char S_NULL[S_NULL_LEN+1] = "(null)"; -@@ -69,7 +69,7 @@ - } \ - if ( __SIO_MUST_FLUSH( *odp, c ) && fd >= 0 ) \ - { \ -- int b_in_buffer = sp - odp->start ; \ -+ ssize_t b_in_buffer = sp - odp->start ; \ - \ - odp->nextb = sp ; \ - if ( __sio_writef( odp, fd ) != b_in_buffer ) \ -@@ -122,11 +122,11 @@ - * - all floating point arguments are passed as doubles - */ - /* VARARGS2 */ --int Sprint( int fd, const char *fmt, ...) -+ssize_t Sprint( int fd, const char *fmt, ...) - { - __sio_descriptor_t *dp ; - __sio_od_t *odp ; -- int cc ; -+ ssize_t cc ; - va_list ap ; - - if( sio_setup( fd, &dp, __SIO_OUTPUT_STREAM ) == SIO_ERR ) -@@ -143,7 +143,7 @@ - /* - * This is the equivalent of vfprintf for SIO - */ --int Sprintv( int fd, const char *fmt, va_list ap) -+ssize_t Sprintv( int fd, const char *fmt, va_list ap) - { - __sio_descriptor_t *dp ; - __sio_od_t *odp ; -@@ -162,7 +162,7 @@ - * in buf). - */ - static char *conv_fp( char format, double num, boolean_e add_dp, -- int precision, bool_int *is_negative, char buf[], int *len ) -+ size_t precision, bool_int *is_negative, char buf[], size_t *len ) - /* always add decimal point if YES */ - { - char *s = buf ; -@@ -220,7 +220,7 @@ - if ( format != 'f' ) - { - char temp[ EXPONENT_LENGTH ] ; /* for exponent conversion */ -- int t_len ; -+ size_t t_len ; - bool_int exponent_is_negative ; - - *s++ = format ; /* either e or E */ -@@ -261,7 +261,7 @@ - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ --static char *conv_p2( u_wide_int num, int nbits, char format, char *buf_end, int *len ) -+static char *conv_p2( u_wide_int num, int nbits, char format, char *buf_end, size_t *len ) - { - int mask = ( 1 << nbits ) - 1 ; - char *p = buf_end ; -@@ -292,7 +292,7 @@ - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ --static char *conv_10( wide_int num, bool_int is_unsigned, bool_int *is_negative, char *buf_end, int *len ) -+static char *conv_10( wide_int num, bool_int is_unsigned, bool_int *is_negative, char *buf_end, size_t *len ) - { - char *p = buf_end ; - u_wide_int magnitude ; -@@ -346,19 +346,19 @@ - * Do format conversion placing the output in odp. - * Note: we do not support %n for security reasons. - */ --int __sio_converter( __sio_od_t *odp, int fd, const char *fmt, va_list ap ) -+ssize_t __sio_converter( __sio_od_t *odp, int fd, const char *fmt, va_list ap ) - { - char *sp = NULL; - char *bep = NULL; -- int cc = 0 ; -- int i ; -+ ssize_t cc = 0 ; -+ size_t i ; - - char *s = NULL; - char *q = NULL; -- int s_len ; -+ size_t s_len ; - - int min_width = 0 ; -- int precision = 0 ; -+ size_t precision = 0 ; - enum { LEFT, RIGHT } adjust ; - char pad_char ; - char prefix_char ; ---- xinetd-2.3.14/libs/src/sio/sio.c.ssize_t 2006-10-27 12:35:12.000000000 -0400 -+++ xinetd-2.3.14/libs/src/sio/sio.c 2006-10-27 13:28:09.000000000 -0400 -@@ -28,17 +28,17 @@ - /* - * Stream write call: arguments same as those of write(2) - */ --int Swrite( int fd, const char *addr, unsigned int nbytes ) -+ssize_t Swrite( int fd, const char *addr, size_t nbytes ) - { - __sio_descriptor_t *dp ; - __sio_od_t *odp ; -- unsigned int b_transferred ; -- unsigned int b_avail ; -- int total_b_transferred ; -- int b_written ; -- int b_in_buffer ; -+ size_t b_transferred ; -+ size_t b_avail ; -+ ssize_t total_b_transferred ; -+ ssize_t b_written ; -+ ssize_t b_in_buffer ; - -- if ( nbytes > INT_MAX ) -+ if ( nbytes > SSIZE_MAX ) - return( SIO_ERR ); - if( sio_setup( fd, &dp, __SIO_OUTPUT_STREAM ) == SIO_ERR ) - return( SIO_ERR ); -@@ -62,7 +62,7 @@ - b_in_buffer = odp->buf_end - odp->start ; - b_written = __sio_writef( odp, fd ) ; - if ( b_written != b_in_buffer ) -- return( (b_written >= (int)nbytes) ? (int)nbytes : b_written ) ; -+ return( (b_written >= (ssize_t)nbytes) ? (ssize_t)nbytes : b_written ) ; - - total_b_transferred = b_transferred ; - addr += b_transferred ; -@@ -83,7 +83,7 @@ - * the buffer is full - */ - b_written = __sio_writef( odp, fd ) ; -- if ( b_written != (int)odp->buffer_size ) -+ if ( b_written != (ssize_t)odp->buffer_size ) - { - if ( b_written != SIO_ERR ) - { -@@ -157,8 +157,8 @@ - __sio_id_t *idp ; - char *cp ; - char *line_start ; -- int b_left ; -- int extension ; -+ ssize_t b_left ; -+ ssize_t extension ; - - if( sio_setup( fd, &dp, __SIO_INPUT_STREAM ) == SIO_ERR ) - return( NULL ); -@@ -361,7 +361,7 @@ - - #ifndef sio_memscan - --static char *sio_memscan( const char *from, int how_many, char ch ) -+static char *sio_memscan( const char *from, size_t how_many, char ch ) - { - char *p ; - char *last = from + how_many ; -@@ -377,7 +377,7 @@ - - #ifdef NEED_MEMCOPY - --void __sio_memcopy( const char *from, char *to, int nbytes ) -+void __sio_memcopy( const char *from, char *to, size_t nbytes ) - { - while ( nbytes-- ) - *to++ = *from++ ; ---- xinetd-2.3.14/xinetd/udpint.c.ssize_t 2005-10-05 13:20:11.000000000 -0400 -+++ xinetd-2.3.14/xinetd/udpint.c 2006-10-27 12:17:10.000000000 -0400 -@@ -226,7 +226,7 @@ - { - char *p ; - int left ; -- int cc ; -+ ssize_t cc ; - const char *func = "send_data" ; - - for ( p = buf, left = len ; left > 0 ; left -= cc, p+= cc ) -@@ -236,7 +236,7 @@ - else - cc = sendto( sd, p, left, 0, SA( addr ), sizeof( *addr ) ) ; - -- if ( cc == -1 ) { -+ if ( cc == (ssize_t)-1 ) { - if ( errno == EINTR ) - { - cc = 0 ; -@@ -264,12 +264,12 @@ - - for ( ;; ) - { -- int cc ; -+ ssize_t cc ; - - from_len = sizeof( pp->from ) ; - cc = recvfrom( INT_REMOTE( ip ), pp->data, pp->size, - 0, SA( &pp->from ), &from_len ) ; -- if ( cc == -1 ) -+ if ( cc == (ssize_t)-1 ) - { - if ( errno != EINTR ) - { -@@ -306,14 +306,14 @@ - static status_e udp_local_to_remote( channel_s *chp ) - { - char buf[ MAX_DATAGRAM_SIZE ] ; -- int cc ; -+ ssize_t cc ; - const char *func = "udp_local_to_remote" ; - - for ( ;; ) - { - cc = recv( chp->ch_local_socket, buf, sizeof( buf ), 0 ) ; - -- if ( cc == -1 ) -+ if ( cc == (ssize_t)-1 ) - { - if ( errno != EINTR ) - { ---- xinetd-2.3.14/xinetd/service.c.ssize_t 2006-10-27 12:17:10.000000000 -0400 -+++ xinetd-2.3.14/xinetd/service.c 2006-10-27 12:17:10.000000000 -0400 -@@ -610,7 +610,7 @@ - /* print the banner regardless of access control */ - if ( SC_BANNER(scp) != NULL ) { - char tmpbuf[TMPSIZE]; -- int retval; -+ ssize_t retval; - int bannerfd = open(SC_BANNER(scp), O_RDONLY); - - if( bannerfd < 0 ) { -@@ -620,7 +620,7 @@ - } - - while( (retval = read(bannerfd, tmpbuf, sizeof(tmpbuf))) ) { -- if (retval == -1) -+ if (retval == (ssize_t)-1) - { - if (errno == EINTR) - continue; ---- xinetd-2.3.14/xinetd/signals.c.ssize_t 2003-12-23 10:30:10.000000000 -0500 -+++ xinetd-2.3.14/xinetd/signals.c 2006-10-27 12:17:10.000000000 -0400 -@@ -402,7 +402,7 @@ - */ - static void my_handler( int sig ) - { -- int ret_val; -+ ssize_t ret_val; - int saved_errno = errno; - #if NSIG < 256 - unsigned char sig_byte; -@@ -412,13 +412,13 @@ - do - { - ret_val = write(signals_pending[1], &sig_byte, 1); -- } while (ret_val == -1 && errno == EINTR); -+ } while (ret_val == (ssize_t)-1 && errno == EINTR); - #else - if (signals_pending[1] < 0) return; - do - { - ret_val = write(signals_pending[1], &sig, sizeof(int)); -- } while (ret_val == -1 && errno == EINTR); -+ } while (ret_val == (ssize_t)-1 && errno == EINTR); - #endif - errno = saved_errno; - } -@@ -470,12 +470,12 @@ - #endif - - while( --i >= 0 ) { -- int ret_val; -+ ssize_t ret_val; - do - { - ret_val = read(signals_pending[0], &sig, sizeof(sig)); -- } while (ret_val == -1 && errno == EINTR); -- if (ret_val != sizeof(sig) ) { -+ } while (ret_val == (ssize_t)-1 && errno == EINTR); -+ if (ret_val != (ssize_t)sizeof(sig) ) { - msg(LOG_ERR, func, "Error retrieving pending signal: %m"); - return; - } ---- xinetd-2.3.14/xinetd/connection.c.ssize_t 2005-10-05 13:20:11.000000000 -0400 -+++ xinetd-2.3.14/xinetd/connection.c 2006-10-27 12:17:10.000000000 -0400 -@@ -96,13 +96,15 @@ - if ( SVC_SOCKET_TYPE( sp ) == SOCK_DGRAM ) - { - char t_ch ; -+ ssize_t val; - - /* - * This trick is done to get the remote address. - * select(2) guaranteed that we won't block on the recvfrom - */ -- if ( recvfrom( SVC_FD( sp ), &t_ch, 1, MSG_PEEK, -- &cp->co_remote_address.sa, &sin_len ) == -1 ) -+ val = recvfrom( SVC_FD( sp ), &t_ch, 1, MSG_PEEK, -+ &cp->co_remote_address.sa, &sin_len ); -+ if ( val == (ssize_t)-1 ) - { - msg( LOG_ERR, func, "service %s, recvfrom: %m", SVC_ID( sp ) ) ; - return( FAILED ) ; ---- xinetd-2.3.14/xinetd/util.c.ssize_t 2005-10-05 17:45:41.000000000 -0400 -+++ xinetd-2.3.14/xinetd/util.c 2006-10-27 12:17:10.000000000 -0400 -@@ -198,7 +198,8 @@ - */ - status_e write_buf( int fd, const char *buf, int len ) - { -- int cc, i ; -+ int i ; -+ ssize_t cc; - - for ( i = 0 ; len > 0 ; i += cc, len -= cc ) - { -@@ -234,7 +235,7 @@ - void drain( int sd ) - { - char buf[ 256 ] ; /* This size is arbitrarily chosen */ -- int ret ; -+ ssize_t ret ; - int old_val ; - - /* Put in non-blocking mode so we don't hang. */ ---- xinetd-2.3.14/xinetd/redirect.c.ssize_t 2003-08-06 02:12:10.000000000 -0400 -+++ xinetd-2.3.14/xinetd/redirect.c 2006-10-27 12:17:10.000000000 -0400 -@@ -58,7 +58,8 @@ - struct service *sp = SERVER_SERVICE( serp ); - struct service_config *scp = SVC_CONF( sp ); - int RedirDescrip = SERVER_FD( serp ); -- int maxfd, num_read, num_wrote=0, ret=0; -+ int maxfd; -+ ssize_t num_read, num_wrote=0, ret=0; - unsigned int sin_len = 0; - unsigned long bytes_in = 0, bytes_out = 0; - int no_to_nagle = 1; -@@ -156,7 +157,7 @@ - do { - num_read = read(RedirDescrip, - buff, sizeof(buff)); -- if (num_read == -1 && errno == EINTR) -+ if (num_read == (ssize_t)-1 && errno == EINTR) - continue; - if (num_read <= 0) - goto REDIROUT; ---- xinetd-2.3.14/xinetd/tcpint.c.ssize_t 2005-10-05 13:20:11.000000000 -0400 -+++ xinetd-2.3.14/xinetd/tcpint.c 2006-10-27 12:17:10.000000000 -0400 -@@ -273,7 +273,7 @@ - static stream_status_e tcp_local_to_remote( channel_s *chp ) - { - char buf[ DATAGRAM_SIZE ] ; -- int rcc, wcc ; -+ ssize_t rcc, wcc ; - char *p ; - int left ; - const char *func = "tcp_local_to_remote" ; -@@ -283,7 +283,7 @@ - rcc = recv( chp->ch_local_socket, buf, sizeof( buf ), 0 ) ; - if ( rcc == 0 ) - return( S_SERVER_ERR ) ; -- else if ( rcc == -1 ) -+ else if ( rcc == (ssize_t)-1 ) - { - if ( errno != EINTR ) - { -@@ -300,7 +300,7 @@ - wcc = send( chp->ch_remote_socket, p, left, 0 ) ; - if ( wcc == 0 ) - return( S_CLIENT_ERR ) ; -- else if ( wcc == -1 ) -+ else if ( wcc == (ssize_t)-1 ) - { - if ( errno == EINTR ) - wcc = 0 ; -@@ -326,7 +326,7 @@ - static stream_status_e tcp_remote_to_local( channel_s *chp ) - { - char buf[ DATAGRAM_SIZE ] ; -- int rcc, wcc ; -+ ssize_t rcc, wcc ; - int left ; - char *p ; - const char *func = "tcp_remote_to_local" ; -@@ -336,7 +336,7 @@ - rcc = recv( chp->ch_remote_socket, buf, sizeof( buf ), 0 ) ; - if ( rcc == 0 ) - return( S_CLIENT_ERR ) ; -- else if ( rcc == -1 ) -+ else if ( rcc == (ssize_t)-1 ) - { - if ( errno != EINTR ) - { -@@ -353,7 +353,7 @@ - wcc = send( chp->ch_local_socket, p, left, 0 ) ; - if ( wcc == 0 ) { - return( S_SERVER_ERR ) ; -- } else if ( wcc == -1 ) { -+ } else if ( wcc == (ssize_t)-1 ) { - if ( errno == EINTR ) { - rcc = 0 ; - } else { ---- xinetd-2.3.14/xinetd/builtins.c.ssize_t 2005-10-06 11:38:04.000000000 -0400 -+++ xinetd-2.3.14/xinetd/builtins.c 2006-10-27 12:17:10.000000000 -0400 -@@ -129,7 +129,7 @@ - static void stream_echo( const struct server *serp ) - { - char buf[ BUFFER_SIZE ] ; -- int cc ; -+ ssize_t cc ; - int descriptor = SERVER_FD( serp ) ; - struct service *svc = SERVER_SERVICE( serp ) ;; - -@@ -149,7 +149,7 @@ - cc = read( descriptor, buf, sizeof( buf ) ) ; - if ( cc == 0 ) - break ; -- if ( cc == -1 ) { -+ if ( cc == (ssize_t)-1 ) { - if ( errno == EINTR ) - continue ; - else -@@ -167,7 +167,7 @@ - { - char buf[ DATAGRAM_SIZE ] ; - union xsockaddr lsin; -- int cc ; -+ ssize_t cc ; - socklen_t sin_len = 0; - int descriptor = SERVER_FD( serp ) ; - const char *func = "dgram_echo"; -@@ -178,15 +178,15 @@ - sin_len = sizeof( struct sockaddr_in6 ); - - cc = recvfrom( descriptor, buf, sizeof( buf ), 0, SA( &lsin ), &sin_len ) ; -- if ( cc != -1 ) { -- (void) sendto( descriptor, buf, cc, 0, SA( &lsin ), sizeof( lsin ) ) ; -+ if ( cc != (ssize_t)-1 ) { -+ (void) sendto( descriptor, buf, (size_t)cc, 0, SA( &lsin ), sizeof( lsin ) ) ; - } - } - - static void stream_discard( const struct server *serp ) - { - char buf[ BUFFER_SIZE ] ; -- int cc ; -+ ssize_t cc ; - int descriptor = SERVER_FD( serp ) ; - struct service *svc = SERVER_SERVICE( serp ) ;; - -@@ -204,7 +204,7 @@ - for ( ;; ) - { - cc = read( descriptor, buf, sizeof( buf ) ) ; -- if ( (cc == 0) || ((cc == -1) && (errno != EINTR)) ) -+ if ( (cc == 0) || ((cc == (ssize_t)-1) && (errno != EINTR)) ) - break ; - } - if( SVC_WAITS( svc ) ) /* Service forks, so close it */ -@@ -293,14 +293,16 @@ - unsigned int buflen = sizeof( time_buf ) ; - int descriptor = SERVER_FD( serp ) ; - const char *func = "dgram_daytime"; -+ ssize_t val; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); - else if ( SC_IPV6( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in6 ); - -- if ( recvfrom( descriptor, time_buf, sizeof( time_buf ), 0, -- SA( &lsin ), &sin_len ) == -1 ) -+ val = recvfrom( descriptor, time_buf, sizeof( time_buf ), 0, -+ SA( &lsin ), &sin_len ); -+ if ( val == (ssize_t)-1 ) - return ; - - daytime_protocol( time_buf, &buflen ) ; -@@ -359,13 +361,15 @@ - socklen_t sin_len = 0 ; - int fd = SERVER_FD( serp ) ; - const char *func = "dgram_daytime"; -+ ssize_t val; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); - else if ( SC_IPV6( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in6 ); - -- if ( recvfrom( fd, buf, sizeof( buf ), 0, SA( &lsin ), &sin_len ) == -1 ) -+ val = recvfrom( fd, buf, sizeof( buf ), 0, SA( &lsin ), &sin_len ); -+ if ( val == (ssize_t)-1 ) - return ; - - time_protocol( time_buf ) ; -@@ -465,13 +469,15 @@ - int fd = SERVER_FD( serp ) ; - unsigned int left = sizeof( buf ) ; - const char *func = "dgram_chargen"; -+ ssize_t val; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); - else if ( SC_IPV6( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in6 ); - -- if ( recvfrom( fd, buf, sizeof( buf ), 0, SA( &lsin ), &sin_len ) == -1 ) -+ val = recvfrom( fd, buf, sizeof( buf ), 0, SA( &lsin ), &sin_len ); -+ if ( val == (ssize_t)-1 ) - return ; - - #if BUFFER_SIZE < LINE_LENGTH+2 ---- xinetd-2.3.14/xinetd/ident.c.ssize_t 2005-10-05 13:20:11.000000000 -0400 -+++ xinetd-2.3.14/xinetd/ident.c 2006-10-27 12:17:10.000000000 -0400 -@@ -267,7 +267,7 @@ - static char *get_line( int sd, char *buf, unsigned bufsize ) - { - int size ; -- int cc ; -+ ssize_t cc ; - char *p ; - char *s ; - const char *func = "get_line" ; -@@ -275,7 +275,7 @@ - for ( p = buf, size = bufsize ; size > 0 ; p += cc, size -= cc ) - { - cc = read( sd, p, size ) ; -- if ( cc == -1 ) { -+ if ( cc == (ssize_t)-1 ) { - if ( errno == EINTR ) - { - cc = 0 ; ---- xinetd-2.3.14/libs/src/sio/sio.h.ssize_t 2003-06-10 09:15:44.000000000 -0400 -+++ xinetd-2.3.14/libs/src/sio/sio.h 2006-10-27 15:47:37.000000000 -0400 -@@ -12,6 +12,8 @@ - #define __SIO_H - - #include -+#include -+#include - #include - - /* -@@ -56,7 +58,7 @@ - * buffer is right below buf and is of the same size. - */ - char *buf ; -- unsigned buffer_size ; -+ size_t buffer_size ; - - char *start ; /* start of valid buffer contents */ - char *end ; /* end of valid buffer contents + 1 */ -@@ -163,15 +165,15 @@ - /* - * The Write functions - */ --int Swrite ( int fd, const char *buf, unsigned int nbytes ); --int Sprint ( int fd, const char *format, ... ) -+ssize_t Swrite ( int fd, const char *buf, size_t ); -+ssize_t Sprint ( int fd, const char *format, ... ) - #ifdef __GNUC__ - __attribute__ ((format (printf, 2, 3))); - #else - ; - #endif - int Sputchar( int fd, char c ); --int Sprintv ( int fd, const char *format, va_list ap ) -+ssize_t Sprintv ( int fd, const char *format, va_list ap ) - #ifdef __GNUC__ - __attribute__ ((format (printf, 2, 0))); - #else -@@ -186,7 +188,7 @@ - int Sclose ( int fd ) ; - int Sbuftype ( int fd, int type ) ; - int Smorefds ( int ) ; --int __sio_converter( __sio_od_t *, int , const char *, va_list ); -+ssize_t __sio_converter( __sio_od_t *, int , const char *, va_list ); - int sio_setup(int fd, __sio_descriptor_t **dp, unsigned int type ); - - #ifdef __GNUC__ diff --git a/xinetd-2.3.15-PIE.patch b/xinetd-2.3.15-PIE.patch new file mode 100644 index 0000000..d601949 --- /dev/null +++ b/xinetd-2.3.15-PIE.patch @@ -0,0 +1,22 @@ +--- xinetd-2.3.15/Makefile.in 2012-05-14 09:22:22.661617117 +0200 ++++ xinetd-2.3.15.new/Makefile.in 2012-05-14 09:32:05.260103054 +0200 +@@ -14,7 +14,7 @@ topdir = @top_srcdir@ + + LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ + +-CFLAGS += @CFLAGS@ ++CFLAGS += @CFLAGS@ -fPIE + DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wno-unused -g + + +--- xinetd-2.3.15/xinetd/Makefile.in 2005-03-31 01:15:28.000000000 +0200 ++++ xinetd-2.3.15.new/xinetd/Makefile.in 2012-05-14 09:32:24.183659971 +0200 +@@ -119,7 +119,7 @@ itox: itox.c + $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) + + xinetd: $(OBJS) +- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ ++ $(CC) $(CFLAGS) $(DEBUG) -o $@ -PIE $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ + + clean: + rm -f $(OBJS) $(NAME) core itox diff --git a/xinetd-2.3.15-pie.patch b/xinetd-2.3.15-pie.patch new file mode 100644 index 0000000..255a10a --- /dev/null +++ b/xinetd-2.3.15-pie.patch @@ -0,0 +1,22 @@ +--- xinetd-2.3.15/Makefile.in 2012-05-14 09:22:22.661617117 +0200 ++++ xinetd-2.3.15.new/Makefile.in 2012-05-14 09:32:05.260103054 +0200 +@@ -14,7 +14,7 @@ topdir = @top_srcdir@ + + LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ + +-CFLAGS += @CFLAGS@ ++CFLAGS += @CFLAGS@ -fpie + DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wno-unused -g + + +--- xinetd-2.3.15/xinetd/Makefile.in 2005-03-31 01:15:28.000000000 +0200 ++++ xinetd-2.3.15.new/xinetd/Makefile.in 2012-05-14 09:32:24.183659971 +0200 +@@ -119,7 +119,7 @@ itox: itox.c + $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) + + xinetd: $(OBJS) +- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ ++ $(CC) $(CFLAGS) $(DEBUG) -o $@ -pie $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ + + clean: + rm -f $(OBJS) $(NAME) core itox diff --git a/xinetd.spec b/xinetd.spec index 8ecf3c0..4760642 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd -Version: 2.3.14 -Release: 46%{?dist} +Version: 2.3.15 +Release: 1%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -9,14 +9,10 @@ URL: http://www.xinetd.org Source: http://www.xinetd.org/xinetd-%{version}.tar.gz Source1: xinetd.service Source3: xinetd.sysconf -Patch0: xinetd-2.3.11-pie.patch -Patch1: xinetd-2.3.12-tcp_rpc.patch -Patch2: xinetd-2.3.14-label.patch -Patch3: xinetd-2.3.14-contextconf.patch +Patch0: xinetd-2.3.15-pie.patch Patch4: xinetd-2.3.14-bind-ipv6.patch -Patch5: xinetd-2.3.14-ssize_t.patch Patch6: xinetd-2.3.14-man-section.patch -Patch7: xinetd-2.3.11-PIE.patch +Patch7: xinetd-2.3.15-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 @@ -39,7 +35,6 @@ 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 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 @@ -86,15 +81,11 @@ located in the /etc/xinetd.d directory. # SPARC/SPARC64 needs -fPIE/-PIE # This really should be detected by configure. %ifarch sparcv9 sparc64 -%patch7 -p0 -b .PIE +%patch7 -p1 -b .PIE %else -%patch0 -p0 -b .pie +%patch0 -p1 -b .pie %endif -%patch1 -p1 -b .tcp_rpc -%patch2 -p1 -b .lspp -%patch3 -p1 -b .confcntx %patch4 -p1 -b .bind -%patch5 -p1 -b .ssize_t %patch6 -p1 -b .man-section %patch8 -p1 -b .ident-bind %patch9 -p1 -b .readable-debuginfo @@ -105,7 +96,6 @@ 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 %patch18 -p1 -b .rpc-specific-port %patch19 -p1 -b .signal-log-hang %patch20 -p1 -b .fix-type-punned-ptr @@ -184,6 +174,13 @@ fi %{_mandir}/*/* %changelog +* Mon May 14 2012 Jan Synáček - 2:2.3.15-1 +- Update to 2.3.15 +- Drop patches merged by upstream + (-log-crash, -tcp_rpc, -label, -contextconf, -ssize_t) +- Update -pie, -PIE, -poll patch +- Resolves: #820927 + * Fri Apr 13 2012 Jan Synáček - 2:2.3.14-46 - Fix: service file: avoid problems when name resolution is not ready - Resolves: #748931 From 620e84db8e50864ce8dc168b0535d27f2743e67d Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 14 May 2012 10:01:31 +0200 Subject: [PATCH 45/84] Remove trailing spaces in spec --- xinetd.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 4760642..372107f 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -2,7 +2,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 Release: 1%{?dist} -License: xinetd +License: xinetd Group: System Environment/Daemons Epoch: 2 URL: http://www.xinetd.org @@ -17,7 +17,7 @@ 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 +# 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) @@ -76,7 +76,7 @@ has its own specific configuration file for Xinetd; the files are located in the /etc/xinetd.d directory. %prep -%setup -q +%setup -q # SPARC/SPARC64 needs -fPIE/-PIE # This really should be detected by configure. @@ -134,7 +134,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %post -if [ $1 -eq 1 ] ; then +if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl enable xinetd.service >/dev/null 2>&1 || : fi @@ -165,7 +165,7 @@ fi /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : %files -%doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf +%doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf %config(noreplace) /etc/xinetd.conf %config(noreplace) /etc/sysconfig/xinetd %{_unitdir}/xinetd.service @@ -192,7 +192,7 @@ fi * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-44 - Fix: Instances limit in xinetd can be easily bypassed -- Resolves: #770858 +- Resolves: #770858 * Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 - Fix xinetd.service permissions From 63004d1702caf98a5fb42a94cc2211e65bc50227 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 14 May 2012 10:36:13 +0200 Subject: [PATCH 46/84] Add -bad-port-check patch --- xinetd-2.3.15-bad-port-check.patch | 106 +++++++++++++++++++++++++++++ xinetd.spec | 3 + 2 files changed, 109 insertions(+) create mode 100644 xinetd-2.3.15-bad-port-check.patch diff --git a/xinetd-2.3.15-bad-port-check.patch b/xinetd-2.3.15-bad-port-check.patch new file mode 100644 index 0000000..7849a96 --- /dev/null +++ b/xinetd-2.3.15-bad-port-check.patch @@ -0,0 +1,106 @@ +Re-introduce bad_port_check(), which upstream dropped between 2.3.13 and 2.3.14 +for it having been "rather antiquated for years", with no justification given +for that claim. + +--- xinetd-2.3.15/xinetd/builtins.c 2012-05-09 17:40:29.000000000 +0200 ++++ xinetd-2.3.15.new/xinetd/builtins.c 2012-05-14 10:25:00.431529805 +0200 +@@ -52,6 +52,7 @@ static void dgram_daytime(const struct s + static void stream_chargen(const struct server *) ; + static void dgram_chargen(const struct server *) ; + static void tcpmux_handler(const struct server *) ; ++static int bad_port_check(const union xsockaddr *, const char *); + + /* + * SG - This is the call sequence to get to a built-in service +@@ -163,6 +164,25 @@ static void stream_echo( const struct se + Sclose(descriptor); + } + ++/* For internal UDP services, make sure we don't respond to our ports ++ * on other servers and to low ports of other services (such as DNS). ++ * This can cause looping. ++ */ ++static int bad_port_check( const union xsockaddr *sa, const char *func ) ++{ ++ uint16_t port = 0; ++ ++ port = ntohs( xaddrport( sa ) ); ++ ++ if ( port < 1024 ) { ++ msg(LOG_WARNING, func, ++ "Possible Denial of Service attack from %s %d", xaddrname(sa), port); ++ return (-1); ++ } ++ ++ return (0); ++} ++ + static void dgram_echo( const struct server *serp ) + { + char buf[ DATAGRAM_SIZE ] ; +@@ -170,6 +190,7 @@ static void dgram_echo( const struct ser + ssize_t cc ; + socklen_t sin_len = 0; + int descriptor = SERVER_FD( serp ) ; ++ const char *func = "dgram_echo" ; + + if( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) + sin_len = sizeof( struct sockaddr_in ); +@@ -178,6 +199,7 @@ static void dgram_echo( const struct ser + + cc = recvfrom( descriptor, buf, sizeof( buf ), 0, (struct sockaddr *)( &lsin ), &sin_len ) ; + if ( cc != (ssize_t)-1 ) { ++ if( bad_port_check(&lsin, func) != 0 ) return; + (void) sendto( descriptor, buf, (size_t)cc, 0, SA( &lsin ), sizeof( lsin ) ) ; + } + } +@@ -292,6 +314,7 @@ static void dgram_daytime( const struct + unsigned int buflen = sizeof( time_buf ) ; + int descriptor = SERVER_FD( serp ) ; + ssize_t val; ++ const char *func = "dgram_daytime" ; + + if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) + sin_len = sizeof( struct sockaddr_in ); +@@ -303,6 +326,8 @@ static void dgram_daytime( const struct + if ( val == (ssize_t)-1 ) + return ; + ++ if( bad_port_check(&lsin, func) != 0 ) return; ++ + daytime_protocol( time_buf, &buflen ) ; + + (void) sendto( descriptor, time_buf, buflen, 0, SA(&lsin), sizeof( lsin ) ) ; +@@ -359,6 +384,7 @@ static void dgram_time( const struct ser + socklen_t sin_len = 0 ; + int fd = SERVER_FD( serp ) ; + ssize_t val; ++ const char *func = "dgram_time" ; + + if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) + sin_len = sizeof( struct sockaddr_in ); +@@ -368,6 +394,7 @@ static void dgram_time( const struct ser + val = recvfrom( fd, buf, sizeof( buf ), 0, (struct sockaddr *)( &lsin ), &sin_len ); + if ( val == (ssize_t)-1 ) + return ; ++ if( bad_port_check(&lsin, func) != 0 ) return; + + time_protocol( time_buf ) ; + (void) sendto( fd, (char *) time_buf, 4, 0, SA( &lsin ), sin_len ) ; +@@ -466,6 +493,7 @@ static void dgram_chargen( const struct + int fd = SERVER_FD( serp ) ; + unsigned int left = sizeof( buf ) ; + ssize_t val; ++ const char *func = "dgram_chargen" ; + + if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) + sin_len = sizeof( struct sockaddr_in ); +@@ -480,6 +508,8 @@ static void dgram_chargen( const struct + bad_variable = 1 ; /* this will cause a compilation error */ + #endif + ++ if( bad_port_check(&lsin, func) != 0 ) return; ++ + for ( p = buf ; left > 2 ; left -= len, p += len ) + { + len = min( LINE_LENGTH+2, left ) ; diff --git a/xinetd.spec b/xinetd.spec index 372107f..6abb400 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -52,6 +52,7 @@ Patch24: xinetd-2.3.14-leaking-fds-2a.patch Patch25: xinetd-2.3.14-instances.patch # Fix #809272 - Service disabled due to bind failure Patch26: xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch +Patch27: xinetd-2.3.15-bad-port-check.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -105,6 +106,7 @@ located in the /etc/xinetd.d directory. %patch24 -p1 -b .leaking-fds-2a %patch25 -p1 -b .instances %patch26 -p1 -b .retry-svc-activate +%patch27 -p1 -b .bad-port-check aclocal autoconf @@ -180,6 +182,7 @@ fi (-log-crash, -tcp_rpc, -label, -contextconf, -ssize_t) - Update -pie, -PIE, -poll patch - Resolves: #820927 +- Add -bad-port-check patch * Fri Apr 13 2012 Jan Synáček - 2:2.3.14-46 - Fix: service file: avoid problems when name resolution is not ready From cf35130420a819320dff1d6f1eee315dc776eb13 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 22 Jul 2012 00:36:54 -0500 Subject: [PATCH 47/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 6abb400..2a1da76 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 1%{?dist} +Release: 2%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -176,6 +176,9 @@ fi %{_mandir}/*/* %changelog +* Sun Jul 22 2012 Fedora Release Engineering - 2:2.3.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Mon May 14 2012 Jan Synáček - 2:2.3.15-1 - Update to 2.3.15 - Drop patches merged by upstream From 11b009e37cf05c87914dca358ff8b123910a0680 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 22 Aug 2012 10:25:15 +0200 Subject: [PATCH 48/84] Replace the makeinstall macro --- xinetd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 2a1da76..4e60b37 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 2%{?dist} +Release: 3%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -122,7 +122,7 @@ mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT/etc/xinetd.d/ # Remove unneeded service rm -f contrib/xinetd.d/ftp-sensor -%makeinstall DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} +%make_install DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} install -m 644 contrib/xinetd.conf $RPM_BUILD_ROOT/etc install -m 644 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} @@ -176,6 +176,9 @@ fi %{_mandir}/*/* %changelog +* Wed Aug 22 2012 Jan Synáček - 2:2.3.15-3 +- Replace the makeinstall macro + * Sun Jul 22 2012 Fedora Release Engineering - 2:2.3.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From 165251f091dabc6e577da92a788170072779b845 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 22 Aug 2012 10:56:50 +0200 Subject: [PATCH 49/84] Add systemd-rpm macros Resolves: #850370 --- xinetd.spec | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 4e60b37..fbd0d34 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -136,35 +136,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %post -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl enable xinetd.service >/dev/null 2>&1 || : -fi +%systemd_post xinetd.service %preun -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable xinetd.service > /dev/null 2>&1 || : - /bin/systemctl stop xinetd.service > /dev/null 2>&1 || : -fi +%systemd_preun xinetd.service %postun -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : -fi - -%triggerun -- xinetd < 2:2.3.14-37 -# Save the current service runlevel info -# User must manually run systemd-sysv-convert --apply xinetd -# to migrate them to systemd targets -/usr/bin/systemd-sysv-convert --save xinetd >/dev/null 2>&1 ||: -/bin/systemctl --no-reload enable xinetd.service >/dev/null 2>&1 ||: - -# Run these because the SysV package being removed won't do them -/sbin/chkconfig --del xinetd >/dev/null 2>&1 || : -/bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || : +%systemd_postun_with_restart xinetd.service %files %doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf @@ -178,6 +156,8 @@ fi %changelog * Wed Aug 22 2012 Jan Synáček - 2:2.3.15-3 - Replace the makeinstall macro +- Add systemd-rpm macros +- Resolves: #850370 * Sun Jul 22 2012 Fedora Release Engineering - 2:2.3.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From 575aba85b7a22c9e542fe3ec3999b15d021285e7 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 3 Sep 2012 10:33:17 +0200 Subject: [PATCH 50/84] Change config files' permissions Resolves: #853144 --- xinetd.spec | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index fbd0d34..2de21ea 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 3%{?dist} +Release: 4%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -119,12 +119,12 @@ make %install mkdir -p $RPM_BUILD_ROOT%{_unitdir} -mkdir -p $RPM_BUILD_ROOT/etc/xinetd.d/ +mkdir -m 700 -p $RPM_BUILD_ROOT/etc/xinetd.d/ # Remove unneeded service rm -f contrib/xinetd.d/ftp-sensor %make_install DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} -install -m 644 contrib/xinetd.conf $RPM_BUILD_ROOT/etc -install -m 644 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d +install -m 600 contrib/xinetd.conf $RPM_BUILD_ROOT/etc +install -m 600 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox* @@ -133,7 +133,7 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/xconv.pl* rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd +install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %post %systemd_post xinetd.service @@ -154,6 +154,10 @@ install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Mon Sep 03 2012 Jan Synáček - 2:2.3.15-4 +- Change config files' permissions +- Resolves: #853144 + * Wed Aug 22 2012 Jan Synáček - 2:2.3.15-3 - Replace the makeinstall macro - Add systemd-rpm macros From 2386b7c7223fb4db5bc65ed098556087d63d5651 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 14 Feb 2013 21:45:39 -0600 Subject: [PATCH 51/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 2de21ea..fc07b42 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 4%{?dist} +Release: 5%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -154,6 +154,9 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Fri Feb 15 2013 Fedora Release Engineering - 2:2.3.15-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Mon Sep 03 2012 Jan Synáček - 2:2.3.15-4 - Change config files' permissions - Resolves: #853144 From 492bfbdc8649778cd39e823e662fd5fb3111aa9a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 26 Jun 2013 09:50:55 +0200 Subject: [PATCH 52/84] Use full path to server when checking selinux context Resolves: #977873 --- xinetd-2.3.15-context-exepath.patch | 11 +++++++++++ xinetd.spec | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.15-context-exepath.patch diff --git a/xinetd-2.3.15-context-exepath.patch b/xinetd-2.3.15-context-exepath.patch new file mode 100644 index 0000000..1ecc432 --- /dev/null +++ b/xinetd-2.3.15-context-exepath.patch @@ -0,0 +1,11 @@ +--- xinetd-2.3.15/xinetd/child.c 2013-06-25 14:12:24.599767760 +0200 ++++ xinetd-2.3.15/xinetd/child.c.new 2013-06-25 14:14:57.463905500 +0200 +@@ -532,7 +532,7 @@ static int set_context_from_socket( cons + if (getpeercon(fd, &peer_context) < 0) + goto fail; + +- exepath = SC_SERVER_ARGV( scp )[0]; ++ exepath = SC_SERVER( scp ); + if (getfilecon(exepath, &exec_context) < 0) + goto fail; + diff --git a/xinetd.spec b/xinetd.spec index fc07b42..8b8717c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 5%{?dist} +Release: 6%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -53,6 +53,8 @@ Patch25: xinetd-2.3.14-instances.patch # Fix #809272 - Service disabled due to bind failure Patch26: xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch Patch27: xinetd-2.3.15-bad-port-check.patch +# Fix #977873 - Use full path to server when checking selinux context +Patch28: xinetd-2.3.15-context-exepath.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -107,6 +109,7 @@ located in the /etc/xinetd.d directory. %patch25 -p1 -b .instances %patch26 -p1 -b .retry-svc-activate %patch27 -p1 -b .bad-port-check +%patch28 -p1 -b .context-exepath aclocal autoconf @@ -154,6 +157,10 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Wed Jun 26 2013 Jan Synáček - 2:2.3.15-6 +- Use full path to server when checking selinux context +- Resolves: #977873 + * Fri Feb 15 2013 Fedora Release Engineering - 2:2.3.15-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild From 9e3440354ed46a538175bb5fbf183e7186e946a2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 4 Aug 2013 03:19:52 -0500 Subject: [PATCH 53/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 8b8717c..c63dcc1 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 6%{?dist} +Release: 7%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -157,6 +157,9 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Sun Aug 04 2013 Fedora Release Engineering - 2:2.3.15-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Wed Jun 26 2013 Jan Synáček - 2:2.3.15-6 - Use full path to server when checking selinux context - Resolves: #977873 From b7bfdb9d73556a8cf3919442a1a3d9ad8dcfffed Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Thu, 3 Oct 2013 08:45:27 +0200 Subject: [PATCH 54/84] Honor user and group directives Resolves: CVE-2013-4342 --- xinetd-2.3.15-creds.patch | 15 +++++++++++++++ xinetd.spec | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.15-creds.patch diff --git a/xinetd-2.3.15-creds.patch b/xinetd-2.3.15-creds.patch new file mode 100644 index 0000000..a9f1db9 --- /dev/null +++ b/xinetd-2.3.15-creds.patch @@ -0,0 +1,15 @@ +Patch by Thomas Swan + +diff --git a/xinetd/builtins.c b/xinetd/builtins.c +index e61502f..a414cf3 100644 +--- a/xinetd/builtins.c ++++ b/xinetd/builtins.c +@@ -695,7 +695,7 @@ static void tcpmux_handler( const struct server *serp ) + if( SC_IS_INTERNAL( scp ) ) { + SC_INTERNAL(scp, nserp); + } else { +- exec_server(nserp); ++ child_process(nserp); + } + } + diff --git a/xinetd.spec b/xinetd.spec index c63dcc1..991ac88 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 7%{?dist} +Release: 8%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -55,6 +55,7 @@ Patch26: xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch Patch27: xinetd-2.3.15-bad-port-check.patch # Fix #977873 - Use full path to server when checking selinux context Patch28: xinetd-2.3.15-context-exepath.patch +Patch29: xinetd-2.3.15-creds.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -110,6 +111,7 @@ located in the /etc/xinetd.d directory. %patch26 -p1 -b .retry-svc-activate %patch27 -p1 -b .bad-port-check %patch28 -p1 -b .context-exepath +%patch29 -p1 -b .creds aclocal autoconf @@ -157,6 +159,10 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Thu Oct 3 2013 Jan Synáček - 2:2.3.15-8 +- Honor user and group directives +- Resolves: CVE-2013-4342 + * Sun Aug 04 2013 Fedora Release Engineering - 2:2.3.15-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 59859d45af8b9ff6c75fec5d9e445146c30228c6 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 4 Oct 2013 08:27:31 +0200 Subject: [PATCH 55/84] xinetd should not depend on NetworkManager-wait-online From F20 onward, network.target automatically depends on NetworkManager-wait-online if NetworkManager is enabled. Resolves: #1002294 --- xinetd.service | 2 +- xinetd.spec | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xinetd.service b/xinetd.service index 0322631..20efb2c 100644 --- a/xinetd.service +++ b/xinetd.service @@ -1,6 +1,6 @@ [Unit] Description=Xinetd A Powerful Replacement For Inetd -After=syslog.target network.target NetworkManager-wait-online.service +After=syslog.target network.target [Service] Type=forking diff --git a/xinetd.spec b/xinetd.spec index 991ac88..6c91b50 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 8%{?dist} +Release: 9%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,10 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Fri Oct 4 2013 Jan Synáček - 2:2.3.15-9 +- xinetd should not depend on NetworkManager-wait-online +- Resolves: #1002294 + * Thu Oct 3 2013 Jan Synáček - 2:2.3.15-8 - Honor user and group directives - Resolves: CVE-2013-4342 From d582efc71795ec2c2958c035f44da79fdae909b7 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 3 Dec 2013 10:51:46 +0100 Subject: [PATCH 56/84] xinetd segfaults when connecting to tcpmux service Resolves: #1033528 --- ...15-tcpmux-nameinargs-disable-service.patch | 37 +++++++++++++++++++ xinetd.spec | 9 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch diff --git a/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch b/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch new file mode 100644 index 0000000..351cad0 --- /dev/null +++ b/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch @@ -0,0 +1,37 @@ +Xinetd parses and applies its configuration line by line. If a user wants to +specify NAMEINARGS as a flag, it has to be *before* specifying 'server_args'. + +Author: Jan Synacek +Resolves: #1033528 + +--- a/xinetd/parse.c 2013-11-21 10:51:25.025436376 +0100 ++++ b/xinetd/parse.c 2013-11-21 14:45:44.374121057 +0100 +@@ -631,6 +631,16 @@ static status_e identify_attribute( entr + return OK; + } + ++ /* If flags contain NAMEINARGS and server_args is already set, disable the service. ++ Server args are already set incorrectly. */ ++ if ( strcmp( ap->a_name, "flags" ) == 0 && ++ SC_SERVER_ARGV( scp ) ) ++ { ++ parsemsg( LOG_ERR, func, ++ "NAMEINARGS flag is set after server_args - DISABLING SERVICE" ) ; ++ SC_DISABLE( scp ); ++ } ++ + if ( (*ap->a_parser)( attr_values, scp, op ) == OK ) + { /* This is the normal path. */ + SC_SPECIFY( scp, ap->a_id ) ; +--- a/xinetd/xinetd.conf.man 2013-12-03 10:06:35.717977075 +0100 ++++ b/xinetd/xinetd.conf.man 2013-12-03 10:41:14.779089430 +0100 +@@ -106,7 +106,8 @@ + This will cause the first argument in "server_args" to be argv[0] when + executing the server, as specified in "server". This allows you to use + tcpd by putting tcpd in "server" and the name of the server in "server_args" +-like in normal inetd. ++like in normal inetd. This flag has to be specified before "server_args", ++otherwise is not taken into account. + .TP + .B NODELAY + If the service is a tcp service and the NODELAY flag is set, then the diff --git a/xinetd.spec b/xinetd.spec index 6c91b50..114f071 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 9%{?dist} +Release: 10%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -56,6 +56,8 @@ Patch27: xinetd-2.3.15-bad-port-check.patch # Fix #977873 - Use full path to server when checking selinux context Patch28: xinetd-2.3.15-context-exepath.patch Patch29: xinetd-2.3.15-creds.patch +# Fix #1033528 - xinetd segfaults when connecting to tcpmux service +Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch BuildRequires: autoconf, automake BuildRequires: libselinux-devel >= 1.30 @@ -112,6 +114,7 @@ located in the /etc/xinetd.d directory. %patch27 -p1 -b .bad-port-check %patch28 -p1 -b .context-exepath %patch29 -p1 -b .creds +%patch30 -p1 aclocal autoconf @@ -159,6 +162,10 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Tue Dec 3 2013 Jan Synáček - 2:2.3.15-10 +- xinetd segfaults when connecting to tcpmux service +- Resolves: #1033528 + * Fri Oct 4 2013 Jan Synáček - 2:2.3.15-9 - xinetd should not depend on NetworkManager-wait-online - Resolves: #1002294 From 07951ec3fca0568825b7c7fa2319be9e64bfee7a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 13 Dec 2013 09:56:16 +0100 Subject: [PATCH 57/84] fixup of the previous patch Don't show bogus messages about NAMEINARGS if the flag isn't there. Related: #1033528 Resolves: #1042652 --- ...15-tcpmux-nameinargs-disable-service.patch | 41 ++++++++++++------- xinetd.spec | 7 +++- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch b/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch index 351cad0..a42bd84 100644 --- a/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch +++ b/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch @@ -6,23 +6,36 @@ Resolves: #1033528 --- a/xinetd/parse.c 2013-11-21 10:51:25.025436376 +0100 +++ b/xinetd/parse.c 2013-11-21 14:45:44.374121057 +0100 -@@ -631,6 +631,16 @@ static status_e identify_attribute( entr - return OK; - } +@@ -633,7 +633,28 @@ static status_e identify_attribute( entr -+ /* If flags contain NAMEINARGS and server_args is already set, disable the service. -+ Server args are already set incorrectly. */ -+ if ( strcmp( ap->a_name, "flags" ) == 0 && -+ SC_SERVER_ARGV( scp ) ) -+ { -+ parsemsg( LOG_ERR, func, -+ "NAMEINARGS flag is set after server_args - DISABLING SERVICE" ) ; -+ SC_DISABLE( scp ); -+ } -+ if ( (*ap->a_parser)( attr_values, scp, op ) == OK ) { /* This is the normal path. */ - SC_SPECIFY( scp, ap->a_id ) ; +- SC_SPECIFY( scp, ap->a_id ) ; ++ /* If flags contain NAMEINARGS and server_args is already set, disable the service. ++ Server args are already set incorrectly. */ ++ if ( strcmp( ap->a_name, "flags" ) == 0 && ++ SC_SERVER_ARGV( scp ) ) ++ { ++ int i = 0, n = pset_count( attr_values ) ; ++ for ( ; i < n ; i++ ) { ++ char *v = (char *)pset_pointer( attr_values, i ) ; ++ if ( strcmp( v, "NAMEINARGS" ) == 0 ) ++ break ; ++ } ++ ++ if ( i != n ) { ++ parsemsg( LOG_ERR, func, ++ "NAMEINARGS flag is set after server_args - DISABLING SERVICE" ) ; ++ SC_DISABLE( scp ) ; ++ } ++ } ++ else ++ { ++ SC_SPECIFY( scp, ap->a_id ) ; ++ } + } + else if ( entry_type == SERVICE_ENTRY ) + { --- a/xinetd/xinetd.conf.man 2013-12-03 10:06:35.717977075 +0100 +++ b/xinetd/xinetd.conf.man 2013-12-03 10:41:14.779089430 +0100 @@ -106,7 +106,8 @@ diff --git a/xinetd.spec b/xinetd.spec index 114f071..fe6c3b7 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 10%{?dist} +Release: 11%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -162,6 +162,11 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Fri Dec 13 2013 Jan Synáček - 2:2.3.15-11 +- fixup of the previous patch +- Resolves: #1042652 +- Related: #1033528 + * Tue Dec 3 2013 Jan Synáček - 2:2.3.15-10 - xinetd segfaults when connecting to tcpmux service - Resolves: #1033528 From fa27fb3ef012f20a2475aefe33447f211df81358 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 14 Jan 2014 09:47:09 +0100 Subject: [PATCH 58/84] fix bad URL --- xinetd.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index fe6c3b7..301df54 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,12 +1,14 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 11%{?dist} +Release: 12%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 -URL: http://www.xinetd.org -Source: http://www.xinetd.org/xinetd-%{version}.tar.gz +URL: https://github.com/xinetd-org/xinetd +# source can be downloaded at +# https://github.com/xinetd-org/xinetd/archive/xinetd-2-3-15.tar.gz +Source: xinetd-%{version}.tar.gz Source1: xinetd.service Source3: xinetd.sysconf Patch0: xinetd-2.3.15-pie.patch @@ -162,6 +164,9 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %{_mandir}/*/* %changelog +* Tue Jan 14 2014 Jan Synáček - 2:2.3.15-12 +- fix bad URL + * Fri Dec 13 2013 Jan Synáček - 2:2.3.15-11 - fixup of the previous patch - Resolves: #1042652 From 333ba8c787c51db5ff49cdf27173cb2258813a21 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 24 Feb 2014 15:06:51 +0100 Subject: [PATCH 59/84] drop sysconfig-related stuff --- xinetd.init | 156 ------------------------------------------------- xinetd.service | 3 +- xinetd.spec | 12 ++-- 3 files changed, 6 insertions(+), 165 deletions(-) delete mode 100644 xinetd.init diff --git a/xinetd.init b/xinetd.init deleted file mode 100644 index 93a62ba..0000000 --- a/xinetd.init +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/bash -# -# xinetd This starts and stops xinetd. -# -# chkconfig: 345 56 50 -# description: xinetd is a powerful replacement for inetd. \ -# xinetd has access control mechanisms, extensive \ -# logging capabilities, the ability to make services \ -# available based on time, and can place \ -# limits on the number of servers that can be started, \ -# among other things. -# -# processname: /usr/sbin/xinetd -# config: /etc/sysconfig/network -# config: /etc/xinetd.conf -# pidfile: /var/run/xinetd.pid - - -### BEGIN INIT INFO -# Provides: -# Required-Start: $network -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: start and stop xinetd -# Description: xinetd is a powerful replacement for inetd. \ -# xinetd has access control mechanisms, extensive \ -# logging capabilities, the ability to make services \ -# available based on time, and can place \ -# limits on the number of servers that can be started, \ -# among other things. -### END INIT INFO - -PATH=/sbin:/bin:/usr/bin:/usr/sbin - -# Source function library. -. /etc/init.d/functions - -# Get config. -test -f /etc/sysconfig/network && . /etc/sysconfig/network - -# More config - -test -f /etc/sysconfig/xinetd && . /etc/sysconfig/xinetd - -RETVAL=0 - -prog="xinetd" - -start(){ - [ -f /usr/sbin/xinetd ] || exit 5 - [ -f /etc/xinetd.conf ] || exit 6 - # this is suitable way considering SELinux is guarding write - # access to PID file - [ $EUID -eq 0 ] || exit 4 - - echo -n $"Starting $prog: " - -# Localization for xinetd is controlled in /etc/synconfig/xinetd - if [ -z "$XINETD_LANG" -o "$XINETD_LANG" = "none" -o "$XINETD_LANG" = "NONE" ]; then - unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE - else - LANG="$XINETD_LANG" - LC_TIME="$XINETD_LANG" - LC_ALL="$XINETD_LANG" - LC_MESSAGES="$XINETD_LANG" - LC_NUMERIC="$XINETD_LANG" - LC_MONETARY="$XINETD_LANG" - LC_COLLATE="$XINETD_LANG" - export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE - fi - unset HOME MAIL USER USERNAME - daemon $prog -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xinetd - return $RETVAL -} - -stop(){ - [ -f /usr/sbin/xinetd ] || exit 5 - [ -f /etc/xinetd.conf ] || exit 6 - # this is suitable way considering SELinux is guarding write - # access to PID file - [ $EUID -eq 0 ] || exit 4 - - echo -n $"Stopping $prog: " - killproc -p /var/run/xinetd.pid $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/xinetd - return $RETVAL - -} - -reload(){ - [ -f /usr/sbin/xinetd ] || exit 5 - [ -f /etc/xinetd.conf ] || exit 6 - - echo -n $"Reloading configuration: " - killproc $prog -HUP - RETVAL=$? - echo - return $RETVAL -} - -restart(){ - stop - start -} - -condrestart(){ - if [ -e /var/lock/subsys/xinetd ] ; then - restart - RETVAL=$? - return $RETVAL - fi - RETVAL=0 - return $RETVAL -} - - -# See how we were called. -case "$1" in - start) - start - RETVAL=$? - ;; - stop) - stop - RETVAL=$? - ;; - status) - status $prog - RETVAL=$? - ;; - restart) - restart - RETVAL=$? - ;; - reload|force-reload) - reload - RETVAL=$? - ;; - condrestart|try-restart) - condrestart - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - RETVAL=2 -esac - -exit $RETVAL diff --git a/xinetd.service b/xinetd.service index 20efb2c..8ab0535 100644 --- a/xinetd.service +++ b/xinetd.service @@ -5,8 +5,7 @@ After=syslog.target network.target [Service] Type=forking PIDFile=/var/run/xinetd.pid -EnvironmentFile=-/etc/sysconfig/xinetd -ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" +ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid ExecReload=/usr/bin/kill -HUP $MAINPID [Install] diff --git a/xinetd.spec b/xinetd.spec index 301df54..cd66b40 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 12%{?dist} +Release: 13%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -10,7 +10,6 @@ URL: https://github.com/xinetd-org/xinetd # https://github.com/xinetd-org/xinetd/archive/xinetd-2-3-15.tar.gz Source: xinetd-%{version}.tar.gz Source1: xinetd.service -Source3: xinetd.sysconf Patch0: xinetd-2.3.15-pie.patch Patch4: xinetd-2.3.14-bind-ipv6.patch Patch6: xinetd-2.3.14-man-section.patch @@ -69,7 +68,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %{!?tcp_wrappers:BuildRequires: tcp_wrappers-devel} -Requires: filesystem >= 2.0.1, initscripts, setup, fileutils +Requires: filesystem >= 2.0.1, setup, fileutils Provides: inetd @@ -142,9 +141,6 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/itox rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/xconv.pl* rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd - %post %systemd_post xinetd.service @@ -157,13 +153,15 @@ install -m 600 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd %files %doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf %config(noreplace) /etc/xinetd.conf -%config(noreplace) /etc/sysconfig/xinetd %{_unitdir}/xinetd.service %config(noreplace) /etc/xinetd.d/* /usr/sbin/xinetd %{_mandir}/*/* %changelog +* Mon Feb 24 2014 Jan Synáček - 2:2.3.15-13 +- drop sysconfig-related stuff + * Tue Jan 14 2014 Jan Synáček - 2:2.3.15-12 - fix bad URL From ad4bb86a1dc0b6afc6f03c6651c7ae768a7dcebb Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 24 Feb 2014 15:08:57 +0100 Subject: [PATCH 60/84] add documentation reference to the service file --- xinetd.service | 3 +++ xinetd.spec | 1 + 2 files changed, 4 insertions(+) diff --git a/xinetd.service b/xinetd.service index 8ab0535..abf097d 100644 --- a/xinetd.service +++ b/xinetd.service @@ -1,6 +1,9 @@ [Unit] Description=Xinetd A Powerful Replacement For Inetd After=syslog.target network.target +Documentation=man:xinetd +Documentation=man:xinetd.conf +Documentation=man:xinetd.log [Service] Type=forking diff --git a/xinetd.spec b/xinetd.spec index cd66b40..ce83e49 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -161,6 +161,7 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %changelog * Mon Feb 24 2014 Jan Synáček - 2:2.3.15-13 - drop sysconfig-related stuff +- add documentation reference to the service file * Tue Jan 14 2014 Jan Synáček - 2:2.3.15-12 - fix bad URL From af58233d5859e03016f52eb05377312b77a85e40 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 8 Jun 2014 00:56:52 -0500 Subject: [PATCH 61/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index ce83e49..68345cb 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 13%{?dist} +Release: 14%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sun Jun 08 2014 Fedora Release Engineering - 2:2.3.15-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Mon Feb 24 2014 Jan Synáček - 2:2.3.15-13 - drop sysconfig-related stuff - add documentation reference to the service file From 6cd4261cfc519d50e5412a82e7f6a0b04e1e2c5f Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 18 Aug 2014 10:06:34 +0000 Subject: [PATCH 62/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 68345cb..027ec0f 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 14%{?dist} +Release: 15%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Mon Aug 18 2014 Fedora Release Engineering - 2:2.3.15-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sun Jun 08 2014 Fedora Release Engineering - 2:2.3.15-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From d039cd11263c662bf56cc55ec7d8db20061ab2f1 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 19 Jun 2015 04:04:27 +0000 Subject: [PATCH 63/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 027ec0f..e9230e9 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 15%{?dist} +Release: 16%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Fri Jun 19 2015 Fedora Release Engineering - 2:2.3.15-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Mon Aug 18 2014 Fedora Release Engineering - 2:2.3.15-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From 1efe6840e8701e892fa129fce670b798c549604d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 5 Feb 2016 03:32:35 +0000 Subject: [PATCH 64/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index e9230e9..0e81cb3 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 16%{?dist} +Release: 17%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Fri Feb 05 2016 Fedora Release Engineering - 2:2.3.15-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Fri Jun 19 2015 Fedora Release Engineering - 2:2.3.15-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From cbd04012d965434f1acefd0a33f22ff49e6c1df8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 17:54:05 +0000 Subject: [PATCH 65/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 0e81cb3..e497cef 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 17%{?dist} +Release: 18%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 2:2.3.15-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Fri Feb 05 2016 Fedora Release Engineering - 2:2.3.15-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From c53f29e0f2d917350bd3ec101e0444bd027bc477 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 22:09:58 +0000 Subject: [PATCH 66/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index e497cef..781ae4a 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 18%{?dist} +Release: 19%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 2:2.3.15-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Sat Feb 11 2017 Fedora Release Engineering - 2:2.3.15-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 6f26ec90577e0d6097a4cc30dc150c8d9923ffd3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 10:44:46 +0000 Subject: [PATCH 67/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 781ae4a..0a62d45 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 19%{?dist} +Release: 20%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 2:2.3.15-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 2:2.3.15-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 58c8325db1a9c7510e68b9e5f4a28fa35c5098fa Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 7 Nov 2017 16:38:24 +0100 Subject: [PATCH 68/84] Remove old crufty coreutils requires Signed-off-by: Igor Gnatenko --- xinetd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 0a62d45..ed9c94c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 20%{?dist} +Release: 21%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -68,7 +68,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %{!?tcp_wrappers:BuildRequires: tcp_wrappers-devel} -Requires: filesystem >= 2.0.1, setup, fileutils +Requires: filesystem >= 2.0.1, setup Provides: inetd @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Tue Nov 07 2017 Igor Gnatenko - 2:2.3.15-21 +- Remove old crufty coreutils requires + * Thu Aug 03 2017 Fedora Release Engineering - 2:2.3.15-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 3e8facaf8696e63d3ed8dc498696ff33207c88db Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 4 Dec 2017 09:47:14 +0100 Subject: [PATCH 69/84] remove build dependency on tcp_wrappers (#1518797) --- xinetd.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index ed9c94c..d748e69 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 21%{?dist} +Release: 22%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -67,7 +67,6 @@ Requires(post): systemd-sysv Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units -%{!?tcp_wrappers:BuildRequires: tcp_wrappers-devel} Requires: filesystem >= 2.0.1, setup Provides: inetd @@ -123,7 +122,7 @@ autoconf %build # -pie -PIE flags added by separate patches export LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" -%configure --with-loadavg --with-inet6 %{!?tcp_wrappers:--with-libwrap} --with-labeled-networking +%configure --with-loadavg --with-inet6 --with-labeled-networking make %install @@ -159,6 +158,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Mon Dec 4 2017 Jan Synáček - 2:2.3.15-22 +- remove build dependency on tcp_wrappers (#1518797) + * Tue Nov 07 2017 Igor Gnatenko - 2:2.3.15-21 - Remove old crufty coreutils requires From c96f805990b3820a9ebae9fb05222a21f05f15f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 20 Jan 2018 23:08:43 +0100 Subject: [PATCH 70/84] Rebuilt for switch to libxcrypt --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index d748e69..c33f0f9 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 22%{?dist} +Release: 23%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -158,6 +158,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sat Jan 20 2018 Björn Esser - 2:2.3.15-23 +- Rebuilt for switch to libxcrypt + * Mon Dec 4 2017 Jan Synáček - 2:2.3.15-22 - remove build dependency on tcp_wrappers (#1518797) From 56be75c641ea65fdd2073161a1a7a02a458f398a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 21:42:34 +0000 Subject: [PATCH 71/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index c33f0f9..3cc1174 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 23%{?dist} +Release: 24%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -158,6 +158,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 2:2.3.15-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Sat Jan 20 2018 Björn Esser - 2:2.3.15-23 - Rebuilt for switch to libxcrypt From b1b78cba9f1a60af0c498769d0521c27ea430a6a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Thu, 15 Mar 2018 13:40:56 +0100 Subject: [PATCH 72/84] fix compilation, missing rpc headers (#1556550) https://fedoraproject.org/wiki/Changes/SunRPCRemoval --- xinetd.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 3cc1174..6489063 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 24%{?dist} +Release: 25%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -60,7 +60,7 @@ Patch29: xinetd-2.3.15-creds.patch # Fix #1033528 - xinetd segfaults when connecting to tcpmux service Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch -BuildRequires: autoconf, automake +BuildRequires: autoconf, automake, libtirpc-devel BuildRequires: libselinux-devel >= 1.30 BuildRequires: systemd-units Requires(post): systemd-sysv @@ -121,9 +121,8 @@ autoconf %build # -pie -PIE flags added by separate patches -export LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" %configure --with-loadavg --with-inet6 --with-labeled-networking -make +make CFLAGS="$CFLAGS $(pkg-config --cflags libtirpc)" LDFLAGS="$LDFLAGS $(pkg-config --libs libtirpc) -Wl,-z,relro,-z,now" %install mkdir -p $RPM_BUILD_ROOT%{_unitdir} @@ -158,6 +157,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Thu Mar 15 2018 Jan Synáček - 2:2.3.15-25 +- fix compilation, missing rpc headers (#1556550) + * Fri Feb 09 2018 Fedora Release Engineering - 2:2.3.15-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 2791b45cb06243245132a7401a7400889b58097c Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 5 Jun 2018 10:08:51 +0200 Subject: [PATCH 73/84] fix xinetd infinite busy loop when datagram service has wait=yes (#1567239) Resolves: #1567239 --- xinetd-2.3.15-udp-wait.patch | 37 ++++++++++++++++++++++++++++++++++++ xinetd.spec | 7 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.15-udp-wait.patch diff --git a/xinetd-2.3.15-udp-wait.patch b/xinetd-2.3.15-udp-wait.patch new file mode 100644 index 0000000..44a615c --- /dev/null +++ b/xinetd-2.3.15-udp-wait.patch @@ -0,0 +1,37 @@ +Resolves: #1567239 + +--- a/xinetd/confparse.c 2018-05-04 11:00:11.019748833 +0200 ++++ b/xinetd/confparse.c 2018-05-04 11:49:26.519996478 +0200 +@@ -860,6 +860,14 @@ static status_e check_entry( struct serv + } + } + ++ if ( SC_SOCKET_TYPE(scp) == SOCK_DGRAM && !SC_WAITS(scp) ) ++ { ++ msg( LOG_ERR, func, ++ "Service %s has socket_type dgram, but does not wait", ++ SC_NAME(scp) ); ++ return FAILED; ++ } ++ + if ( service_attr_check( scp ) == FAILED ) + return( FAILED ) ; + +--- a/xinetd/main.c 2018-05-04 10:02:11.999315632 +0200 ++++ b/xinetd/main.c 2018-05-04 10:03:44.124500979 +0200 +@@ -296,6 +296,7 @@ static void find_bad_fd(void) + SVC_ID( sp ) ) ; + svc_deactivate( sp ) ; + found = TRUE ; ++ bad_fd_count++ ; + break ; + } + } +@@ -303,6 +304,7 @@ static void find_bad_fd(void) + { + #ifdef HAVE_POLL + ps.rws.pfd_array[fd].events = 0; ++ ps.rws.pfd_array[fd].fd = -1; + #else + FD_CLR( fd, &ps.rws.socket_mask ) ; + #endif diff --git a/xinetd.spec b/xinetd.spec index 6489063..9d2924a 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 25%{?dist} +Release: 26%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -59,6 +59,7 @@ Patch28: xinetd-2.3.15-context-exepath.patch Patch29: xinetd-2.3.15-creds.patch # Fix #1033528 - xinetd segfaults when connecting to tcpmux service Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch +Patch31: xinetd-2.3.15-udp-wait.patch BuildRequires: autoconf, automake, libtirpc-devel BuildRequires: libselinux-devel >= 1.30 @@ -115,6 +116,7 @@ located in the /etc/xinetd.d directory. %patch28 -p1 -b .context-exepath %patch29 -p1 -b .creds %patch30 -p1 +%patch31 -p1 aclocal autoconf @@ -157,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Tue Jun 5 2018 Jan Synáček - 2:2.3.15-26 +- fix xinetd infinite busy loop when datagram service has wait=yes (#1567239) + * Thu Mar 15 2018 Jan Synáček - 2:2.3.15-25 - fix compilation, missing rpc headers (#1556550) From 2d054054d622448ebfcc1a34a908ed07c8215e45 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 9 Jul 2018 19:06:54 +0200 Subject: [PATCH 74/84] add BuildRequires: gcc Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot --- xinetd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xinetd.spec b/xinetd.spec index 9d2924a..ed80e52 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -61,6 +61,7 @@ Patch29: xinetd-2.3.15-creds.patch Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch Patch31: xinetd-2.3.15-udp-wait.patch +BuildRequires: gcc BuildRequires: autoconf, automake, libtirpc-devel BuildRequires: libselinux-devel >= 1.30 BuildRequires: systemd-units From 1ce2df7c19ecc90cc31ceb79763b7d1401a02924 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:20:35 +0000 Subject: [PATCH 75/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index ed80e52..348f343 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 26%{?dist} +Release: 27%{?dist} License: xinetd Group: System Environment/Daemons Epoch: 2 @@ -160,6 +160,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 2:2.3.15-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Jun 5 2018 Jan Synáček - 2:2.3.15-26 - fix xinetd infinite busy loop when datagram service has wait=yes (#1567239) From 57003fcd3308cbd30de89286d81491d54771d6a6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:31 +0100 Subject: [PATCH 76/84] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- xinetd.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 348f343..bf92a4c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -3,7 +3,6 @@ Name: xinetd Version: 2.3.15 Release: 27%{?dist} License: xinetd -Group: System Environment/Daemons Epoch: 2 URL: https://github.com/xinetd-org/xinetd # source can be downloaded at From e9e47118fdf4ee2abffbc82d820fd0e0976bdfe4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 12:28:32 +0000 Subject: [PATCH 77/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index bf92a4c..061b22d 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 27%{?dist} +Release: 28%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -159,6 +159,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 2:2.3.15-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Jul 14 2018 Fedora Release Engineering - 2:2.3.15-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 1183e1fae147c435b239ab29b0a2749d3013e236 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 21 Mar 2019 00:24:16 +0000 Subject: [PATCH 78/84] Own the xinetd.d config directory --- xinetd.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xinetd.spec b/xinetd.spec index 061b22d..56cb6fe 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 28%{?dist} +Release: 29%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -60,7 +60,7 @@ Patch29: xinetd-2.3.15-creds.patch Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch Patch31: xinetd-2.3.15-udp-wait.patch -BuildRequires: gcc +BuildRequires: gcc BuildRequires: autoconf, automake, libtirpc-devel BuildRequires: libselinux-devel >= 1.30 BuildRequires: systemd-units @@ -154,11 +154,15 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf %config(noreplace) /etc/xinetd.conf %{_unitdir}/xinetd.service +%dir /etc/xinetd.d/ %config(noreplace) /etc/xinetd.d/* /usr/sbin/xinetd %{_mandir}/*/* %changelog +* Wed Mar 20 2019 Peter Robinson 2:2.3.15-29 +- Own the xinetd.d config directory + * Sun Feb 03 2019 Fedora Release Engineering - 2:2.3.15-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 4e92b4d4d35fa18c3b0bbc53bd9b0a0737f595f2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 04:16:13 +0000 Subject: [PATCH 79/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 56cb6fe..c86e46d 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 29%{?dist} +Release: 30%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -160,6 +160,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 2:2.3.15-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Wed Mar 20 2019 Peter Robinson 2:2.3.15-29 - Own the xinetd.d config directory From 61bb1ddb161c5ecd1fa654301de5d0481ba8f4e2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 04:32:00 +0000 Subject: [PATCH 80/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index c86e46d..f8e8492 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 30%{?dist} +Release: 31%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -160,6 +160,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 2:2.3.15-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Sat Jul 27 2019 Fedora Release Engineering - 2:2.3.15-30 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From a192cc0244da275615edd18118afcc249dd4e53d Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 7 Apr 2020 11:56:52 +0200 Subject: [PATCH 81/84] Remove deprecation warning about flask.h usage flask.h has been deprecated for a long time and will be dropped completely from the next SELinux userspace release. --- xinetd-2.3.15-remove-deprecated-flask.h.patch | 20 +++++++++++++++++++ xinetd.spec | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 xinetd-2.3.15-remove-deprecated-flask.h.patch diff --git a/xinetd-2.3.15-remove-deprecated-flask.h.patch b/xinetd-2.3.15-remove-deprecated-flask.h.patch new file mode 100644 index 0000000..1cb4e54 --- /dev/null +++ b/xinetd-2.3.15-remove-deprecated-flask.h.patch @@ -0,0 +1,20 @@ +diff -up xinetd-2.3.15/xinetd/child.c.remove-flaskh xinetd-2.3.15/xinetd/child.c +--- xinetd-2.3.15/xinetd/child.c.remove-flaskh 2020-04-07 12:28:52.538123162 +0200 ++++ xinetd-2.3.15/xinetd/child.c 2020-04-07 12:28:58.980980069 +0200 +@@ -33,7 +33,6 @@ + #endif + #ifdef LABELED_NET + #include +-#include + #include + #endif + +@@ -551,7 +550,7 @@ static int set_context_from_socket( cons + if (!(new_context = context_str(bcon))) + goto fail; + +- if (security_compute_create(new_context, exec_context, SECCLASS_PROCESS, ++ if (security_compute_create(new_context, exec_context, string_to_security_class("process"), + &new_exec_context) < 0) + goto fail; + diff --git a/xinetd.spec b/xinetd.spec index f8e8492..2ff9b37 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 31%{?dist} +Release: 32%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -59,6 +59,7 @@ Patch29: xinetd-2.3.15-creds.patch # Fix #1033528 - xinetd segfaults when connecting to tcpmux service Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch Patch31: xinetd-2.3.15-udp-wait.patch +Patch32: xinetd-2.3.15-remove-deprecated-flask.h.patch BuildRequires: gcc BuildRequires: autoconf, automake, libtirpc-devel @@ -117,6 +118,7 @@ located in the /etc/xinetd.d directory. %patch29 -p1 -b .creds %patch30 -p1 %patch31 -p1 +%patch32 -p1 -b .drop-flaskh aclocal autoconf @@ -160,6 +162,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Tue Apr 7 2020 Petr Lautrbach - 2:2.3.15-32 +- Remove deprecation warning about flask.h usage + * Fri Jan 31 2020 Fedora Release Engineering - 2:2.3.15-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From a87333fa2ee26f906677b95a09e15856cf3f4f5e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 14:47:08 +0000 Subject: [PATCH 82/84] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 2ff9b37..69c0c8c 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 32%{?dist} +Release: 33%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -162,6 +162,9 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 2:2.3.15-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Apr 7 2020 Petr Lautrbach - 2:2.3.15-32 - Remove deprecation warning about flask.h usage From 19d001a3d22dde8d57d6c7d2ed9dcc86498e76f8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 09:45:03 +0000 Subject: [PATCH 83/84] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xinetd.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xinetd.spec b/xinetd.spec index 69c0c8c..9f0da5d 100644 --- a/xinetd.spec +++ b/xinetd.spec @@ -1,7 +1,7 @@ Summary: A secure replacement for inetd Name: xinetd Version: 2.3.15 -Release: 33%{?dist} +Release: 34%{?dist} License: xinetd Epoch: 2 URL: https://github.com/xinetd-org/xinetd @@ -162,6 +162,10 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl %{_mandir}/*/* %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 2:2.3.15-34 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Jul 29 2020 Fedora Release Engineering - 2:2.3.15-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 3fdca86988d0d136a35f04a898258a1348c5cee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 10 Dec 2020 18:00:46 +0100 Subject: [PATCH 84/84] Orphaned for 6+ weeks --- .gitignore | 2 - dead.package | 1 + sources | 1 - xinetd-2.3.14-autoconf.patch | 251 ---- xinetd-2.3.14-bind-ipv6.patch | 29 - xinetd-2.3.14-clean-pfd.patch | 10 - xinetd-2.3.14-file-limit.patch | 126 -- xinetd-2.3.14-fix-type-punned-ptr.patch | 22 - xinetd-2.3.14-ident-bind.patch | 42 - xinetd-2.3.14-instances.patch | 22 - xinetd-2.3.14-ipv6confusion.patch | 17 - xinetd-2.3.14-leaking-fds-2a.patch | 41 - xinetd-2.3.14-leaking-fds.patch | 52 - xinetd-2.3.14-man-section.patch | 16 - xinetd-2.3.14-many-services.patch | 27 - xinetd-2.3.14-poll.patch | 1202 ----------------- xinetd-2.3.14-readable-debuginfo.patch | 77 -- xinetd-2.3.14-realloc-remove.patch | 134 -- ...14-retry-svc-activate-in-cps-restart.patch | 54 - xinetd-2.3.14-rpc-specific-port.patch | 30 - xinetd-2.3.14-signal-log-hang.patch | 27 - xinetd-2.3.14-tcpmux.patch | 16 - xinetd-2.3.14-udp-reconfig.patch | 12 - xinetd-2.3.15-PIE.patch | 22 - xinetd-2.3.15-bad-port-check.patch | 106 -- xinetd-2.3.15-context-exepath.patch | 11 - xinetd-2.3.15-creds.patch | 15 - xinetd-2.3.15-pie.patch | 22 - xinetd-2.3.15-remove-deprecated-flask.h.patch | 20 - ...15-tcpmux-nameinargs-disable-service.patch | 50 - xinetd-2.3.15-udp-wait.patch | 37 - xinetd.service | 16 - xinetd.spec | 485 ------- xinetd.sysconf | 10 - 34 files changed, 1 insertion(+), 3004 deletions(-) delete mode 100644 .gitignore create mode 100644 dead.package delete mode 100644 sources delete mode 100644 xinetd-2.3.14-autoconf.patch delete mode 100644 xinetd-2.3.14-bind-ipv6.patch delete mode 100644 xinetd-2.3.14-clean-pfd.patch delete mode 100644 xinetd-2.3.14-file-limit.patch delete mode 100644 xinetd-2.3.14-fix-type-punned-ptr.patch delete mode 100644 xinetd-2.3.14-ident-bind.patch delete mode 100644 xinetd-2.3.14-instances.patch delete mode 100644 xinetd-2.3.14-ipv6confusion.patch delete mode 100644 xinetd-2.3.14-leaking-fds-2a.patch delete mode 100644 xinetd-2.3.14-leaking-fds.patch delete mode 100644 xinetd-2.3.14-man-section.patch delete mode 100644 xinetd-2.3.14-many-services.patch delete mode 100644 xinetd-2.3.14-poll.patch delete mode 100644 xinetd-2.3.14-readable-debuginfo.patch delete mode 100644 xinetd-2.3.14-realloc-remove.patch delete mode 100644 xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch delete mode 100644 xinetd-2.3.14-rpc-specific-port.patch delete mode 100644 xinetd-2.3.14-signal-log-hang.patch delete mode 100644 xinetd-2.3.14-tcpmux.patch delete mode 100644 xinetd-2.3.14-udp-reconfig.patch delete mode 100644 xinetd-2.3.15-PIE.patch delete mode 100644 xinetd-2.3.15-bad-port-check.patch delete mode 100644 xinetd-2.3.15-context-exepath.patch delete mode 100644 xinetd-2.3.15-creds.patch delete mode 100644 xinetd-2.3.15-pie.patch delete mode 100644 xinetd-2.3.15-remove-deprecated-flask.h.patch delete mode 100644 xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch delete mode 100644 xinetd-2.3.15-udp-wait.patch delete mode 100644 xinetd.service delete mode 100644 xinetd.spec delete mode 100644 xinetd.sysconf diff --git a/.gitignore b/.gitignore deleted file mode 100644 index bb93fed..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -xinetd-2.3.14.tar.gz -/xinetd-2.3.15.tar.gz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..5204a84 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Orphaned for 6+ weeks diff --git a/sources b/sources deleted file mode 100644 index d77687c..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -77358478fd58efa6366accae99b8b04c xinetd-2.3.15.tar.gz diff --git a/xinetd-2.3.14-autoconf.patch b/xinetd-2.3.14-autoconf.patch deleted file mode 100644 index 7ce2276..0000000 --- a/xinetd-2.3.14-autoconf.patch +++ /dev/null @@ -1,251 +0,0 @@ ---- xinetd-2.3.14/configure.in 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-mod/configure.in 2009-07-29 10:05:44.000000000 +0200 -@@ -20,34 +20,34 @@ AC_CHECK_FUNCS(ecvt, , - AC_CHECK_FUNCS(gcvt, , - AC_CHECK_LIB(m, gcvt)) - --AC_CHECK_FUNC(strerror, [AC_DEFINE(HAVE_STRERROR)]) --AC_CHECK_FUNC(strcasecmp, [AC_DEFINE(HAVE_STRCASECMP)]) -+AC_CHECK_FUNC(strerror, [AC_DEFINE(HAVE_STRERROR, 1, "")]) -+AC_CHECK_FUNC(strcasecmp, [AC_DEFINE(HAVE_STRCASECMP, 1, "")]) - AC_CHECK_FUNC(socket, , - AC_CHECK_LIB(socket, socket, , - AC_CHECK_LIB(nsl, socket))) - AC_CHECK_FUNC(inet_aton, , - AC_CHECK_LIB(nsl, inet_aton, , - AC_CHECK_LIB(socket, inet_aton, , -- AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)])))) --AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV)]) --AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL)]) --AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST)]) --AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR)]) --AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO)]) --AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO)]) -+ AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON, 1, "")])))) -+AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV, 1, "")]) -+AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL, 1, "")]) -+AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST, 1, "")]) -+AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR, 1, "")]) -+AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO, 1, "")]) -+AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO, 1, "")]) - - AC_CHECK_HEADERS(sys/types.h sys/termios.h termios.h sys/ioctl.h sys/select.h rpc/rpc.h rpc/rpcent.h sys/file.h ftw.h machine/reg.h netdb.h) --AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H)]) --AC_CHECK_HEADER(arpa/inet.h, [AC_DEFINE(HAVE_ARPA_INET_H)]) --AC_CHECK_HEADER(grp.h, [AC_DEFINE(HAVE_GRP_H)]) --AC_CHECK_HEADER(rpc/pmap_clnt.h, [AC_DEFINE(HAVE_RPC_PMAP_CLNT_H)]) --AC_CHECK_HEADER(sys/socket.h, [AC_DEFINE(HAVE_SYS_SOCKET_H)]) --AC_CHECK_HEADER(sys/signal.h, [AC_DEFINE(HAVE_SYS_SIGNAL_H)]) --AC_CHECK_HEADER(crypt.h, [AC_DEFINE(HAVE_CRYPT_H)]) --AC_CHECK_HEADER(stdint.h, [AC_DEFINE(HAVE_STDINT_H)]) --AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H)]) --AC_CHECK_HEADER(sys/filio.h, [AC_DEFINE(HAVE_SYS_FILIO_H)]) --AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [AC_DEFINE(HAVE_DNSREGISTRATION) AC_DEFINE(HAVE_MDNS)]) -+AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H, 1, "")]) -+AC_CHECK_HEADER(arpa/inet.h, [AC_DEFINE(HAVE_ARPA_INET_H, 1, "")]) -+AC_CHECK_HEADER(grp.h, [AC_DEFINE(HAVE_GRP_H, 1, "")]) -+AC_CHECK_HEADER(rpc/pmap_clnt.h, [AC_DEFINE(HAVE_RPC_PMAP_CLNT_H, 1, "")]) -+AC_CHECK_HEADER(sys/socket.h, [AC_DEFINE(HAVE_SYS_SOCKET_H, 1, "")]) -+AC_CHECK_HEADER(sys/signal.h, [AC_DEFINE(HAVE_SYS_SIGNAL_H, 1, "")]) -+AC_CHECK_HEADER(crypt.h, [AC_DEFINE(HAVE_CRYPT_H, 1, "")]) -+AC_CHECK_HEADER(stdint.h, [AC_DEFINE(HAVE_STDINT_H, 1, "")]) -+AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, "")]) -+AC_CHECK_HEADER(sys/filio.h, [AC_DEFINE(HAVE_SYS_FILIO_H, 1, "")]) -+AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [AC_DEFINE(HAVE_DNSREGISTRATION, 1, "") AC_DEFINE(HAVE_MDNS, 1, "")]) - - AC_ARG_WITH(howl, [ --with-howl=PATH Compile in howl support. - PATH is the prefix where howl is installed, -@@ -56,7 +56,7 @@ AC_ARG_WITH(howl, [ --with-howl=PATH - OLDLDFLAGS=$LDFLAGS; LDFLAGS="-L$withval/lib/ $LDFLAGS"; - OLDCPPFLAGS=$CPPFLAGS; CPPFLAGS="-I$withval/include/howl/ $CPPFLAGS"; - AC_CHECK_HEADER($withval/include/howl/howl.h, -- [AC_DEFINE(HAVE_HOWL) AC_DEFINE(HAVE_MDNS)], -+ [AC_DEFINE(HAVE_HOWL, 1, "") AC_DEFINE(HAVE_MDNS, 1, "")], - [CFLAGS=$OLDCFLAGS; LDFLAGS=$OLDLDFLAGS; CPPFLAGS=$OLDCPPFLAGS;]) - AC_CHECK_LIB(howl, sw_discovery_publish, [LIBS="-lhowl $LIBS"], [ - OLDLIBS=$LIBS; LIBS="-lpthread $LIBS"; -@@ -88,7 +88,7 @@ AC_CACHE_CHECK([for struct addrinfo], ac - ) - ]) - if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then -- AC_DEFINE(HAVE_STRUCT_ADDRINFO) -+ AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, "") - fi - - AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ -@@ -103,7 +103,7 @@ AC_CACHE_CHECK([for struct in6_addr], ac - ) - ]) - if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then -- AC_DEFINE(HAVE_STRUCT_IN6_ADDR) -+ AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, "") - fi - - AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ -@@ -118,7 +118,7 @@ AC_CACHE_CHECK([for struct sockaddr_in6] - ) - ]) - if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then -- AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) -+ AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, "") - fi - - AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ -@@ -133,15 +133,15 @@ AC_CACHE_CHECK([for struct sockaddr_stor - ) - ]) - if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then -- AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) -+ AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, "") - fi - - - case "$target_os" in - - solaris*) -- AC_DEFINE(N0_SIGLIST) -- AC_DEFINE(solaris) -+ AC_DEFINE(N0_SIGLIST, 1, "") -+ AC_DEFINE(solaris, 1, "") - - AC_MSG_CHECKING(whether to compile in loadavg) - AC_ARG_WITH(loadavg, -@@ -153,12 +153,12 @@ solaris*) - yes) - AC_MSG_RESULT(yes) - AC_CHECK_LIB(kstat, main) -- AC_CHECK_HEADER(kstat.h, [AC_DEFINE(HAVE_KSTAT_H)]) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_CHECK_HEADER(kstat.h, [AC_DEFINE(HAVE_KSTAT_H, 1, "")]) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - esac ], AC_MSG_RESULT(no) ) - ;; -@@ -172,11 +172,11 @@ osf*) - ;; - yes) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - esac ], AC_MSG_RESULT(no)) - ;; -@@ -191,18 +191,18 @@ linux*|freebsd*) - ;; - yes) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - esac ], AC_MSG_RESULT(no)) - ;; - darwin* | "Mac OS"*) - ac_cv_prog_RANLIB="ranlib" - # AC_CHECK_FUNCS doesn't look in the proper header file... -- AC_DEFINE(HAVE_ISATTY) -+ AC_DEFINE(HAVE_ISATTY, 1, "") - CFLAGS="$CFLAGS -no-cpp-precomp" - AC_MSG_CHECKING(whether to compile in loadavg) - AC_ARG_WITH(loadavg,, -@@ -212,11 +212,11 @@ darwin* | "Mac OS"*) - ;; - yes) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - esac ], AC_MSG_RESULT(no)) - ;; -@@ -229,13 +229,13 @@ darwin* | "Mac OS"*) - ;; - yes) - AC_MSG_RESULT(yes) -- AC_DEFINE(bsdi) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(bsdi, 1, "") -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(bsdi) -- AC_DEFINE(HAVE_LOADAVG) -+ AC_DEFINE(bsdi, 1, "") -+ AC_DEFINE(HAVE_LOADAVG, 1, "") - ;; - esac ], AC_MSG_RESULT(no)) - ;; -@@ -245,7 +245,7 @@ esac - AC_CHECK_LIB(c, crypt, [:], [ - AC_CHECK_LIB(crypt, crypt, [ - LIBS="-lcrypt $LIBS" -- AC_DEFINE(HAVE_LIBCRYPT) ], []) ]) -+ AC_DEFINE(HAVE_LIBCRYPT, 1, "") ], []) ]) - - AC_CHECK_LIB(m, log10, [ LIBS="-lm $LIBS" ], []) - -@@ -263,16 +263,16 @@ AC_ARG_WITH(libwrap, - yes) - AC_MSG_RESULT(yes) - AC_CHECK_LIB(wrap, request_init, [ -- AC_DEFINE(LIBWRAP) -+ AC_DEFINE(LIBWRAP, 1, "") - WRAPLIBS="-lwrap" -- AC_DEFINE(HAVE_LIBWRAP) ]) -+ AC_DEFINE(HAVE_LIBWRAP, 1, "") ]) - AC_CHECK_LIB(nsl, yp_get_default_domain, [ - WRAPLIBS="$WRAPLIBS -lnsl" ]) - LIBS="$WRAPLIBS $LIBS" - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(LIBWRAP) -+ AC_DEFINE(LIBWRAP, 1, "") - if test -d "$withval"; then - WRAPLIBS="-L$withval -lwrap" - else -@@ -299,13 +299,13 @@ AC_ARG_WITH(labeled-networking, - yes) - AC_MSG_RESULT(yes) - AC_CHECK_LIB(selinux, setexeccon, [ -- AC_DEFINE(LABELED_NET) -+ AC_DEFINE(LABELED_NET, 1, "") - LABELLIBS="-lselinux" ]) - LIBS="$LABELLIBS $LIBS" - ;; - *) - AC_MSG_RESULT(yes) -- AC_DEFINE(LABELED_NET) -+ AC_DEFINE(LABELED_NET, 1, "") - if test -d "$withval"; then - LABELLIBS="-L$withval -lselinux" - else ---- xinetd-2.3.14/aclocal.m4 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14-mod/aclocal.m4 2009-07-29 10:10:03.000000000 +0200 -@@ -22,6 +22,6 @@ AC_CACHE_VAL(xinetd_cv_type_$1, - #endif], xinetd_cv_type_$1=yes, xinetd_cv_type_$1=no)])dnl - AC_MSG_RESULT($xinetd_cv_type_$1) - if test $xinetd_cv_type_$1 = no; then -- AC_DEFINE($1, $2) -+ AC_DEFINE($1, $2, "") - fi - ]) diff --git a/xinetd-2.3.14-bind-ipv6.patch b/xinetd-2.3.14-bind-ipv6.patch deleted file mode 100644 index 4bce76f..0000000 --- a/xinetd-2.3.14-bind-ipv6.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- xinetd-2.3.14/xinetd/service.c.old 2007-05-16 15:33:41.000000000 +0200 -+++ xinetd-2.3.14/xinetd/service.c 2007-05-16 15:29:53.000000000 +0200 -@@ -335,6 +335,15 @@ - - if ( SVC_FD(sp) == -1 ) - { -+ if (SC_BIND_ADDR(scp) == NULL && SC_IPV6( scp )) -+ { -+ /* there was no bind address configured and IPv6 fails. Try IPv4 */ -+ msg( LOG_NOTICE, func, "IPv6 socket creation failed for service %s, trying IPv4", SC_ID( scp ) ) ; -+ M_CLEAR(SC_XFLAGS(scp), SF_IPV6); -+ M_SET(SC_XFLAGS(scp), SF_IPV4); -+ return svc_activate(sp); -+ } -+ - msg( LOG_ERR, func, - "socket creation failed (%m). service = %s", SC_ID( scp ) ) ; - return( FAILED ) ; ---- xinetd-2.3.14/xinetd/confparse.c.old 2007-05-16 15:33:26.000000000 +0200 -+++ xinetd-2.3.14/xinetd/confparse.c 2007-05-16 15:15:22.000000000 +0200 -@@ -245,7 +245,7 @@ - M_SET(SC_XFLAGS(scp), SF_IPV6); - } - else -- M_SET(SC_XFLAGS(scp), SF_IPV4); -+ M_SET(SC_XFLAGS(scp), SF_IPV6); /*try bind IPv6 by default*/ - } - - if (SC_ORIG_BIND_ADDR(scp)) diff --git a/xinetd-2.3.14-clean-pfd.patch b/xinetd-2.3.14-clean-pfd.patch deleted file mode 100644 index 2509848..0000000 --- a/xinetd-2.3.14-clean-pfd.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- 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-2.3.14-file-limit.patch b/xinetd-2.3.14-file-limit.patch deleted file mode 100644 index b5a8e3a..0000000 --- a/xinetd-2.3.14-file-limit.patch +++ /dev/null @@ -1,126 +0,0 @@ -diff -Nurp xinetd-2.3.14-orig/xinetd/attr.h xinetd-2.3.14-files/xinetd/attr.h ---- xinetd-2.3.14-orig/xinetd/attr.h 2005-10-05 19:15:33.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/attr.h 2009-10-20 13:08:45.000000000 +0200 -@@ -61,12 +61,13 @@ - #define A_DISABLED 43 - #define A_MDNS 44 - #define A_LIBWRAP 45 -+#define A_RLIMIT_FILES 46 - - /* - * SERVICE_ATTRIBUTES is the number of service attributes and also - * the number from which defaults-only attributes start. - */ --#define SERVICE_ATTRIBUTES ( A_MDNS + 1 ) -+#define SERVICE_ATTRIBUTES ( A_MDNS + 2 ) - - /* - * Mask of attributes that must be specified. -diff -Nurp xinetd-2.3.14-orig/xinetd/child.c xinetd-2.3.14-files/xinetd/child.c ---- xinetd-2.3.14-orig/xinetd/child.c 2009-10-20 13:07:34.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/child.c 2009-10-20 13:10:16.000000000 +0200 -@@ -109,6 +109,10 @@ void exec_server( const struct server *s - - - #ifdef RLIMIT_NOFILE -+ if ( SC_RLIM_FILES( scp )) -+ { -+ ps.ros.max_descriptors = SC_RLIM_FILES( scp ); -+ } - rl.rlim_max = rl.rlim_cur = ps.ros.max_descriptors ; - (void) setrlimit( RLIMIT_NOFILE, &rl ) ; - #endif -diff -Nurp xinetd-2.3.14-orig/xinetd/parse.c xinetd-2.3.14-files/xinetd/parse.c ---- xinetd-2.3.14-orig/xinetd/parse.c 2005-10-05 19:15:33.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/parse.c 2009-10-20 13:08:45.000000000 +0200 -@@ -92,6 +92,9 @@ static const struct attribute service_at - #ifdef RLIMIT_DATA - { "rlimit_data", A_RLIMIT_DATA, 1, rlim_data_parser }, - #endif -+#ifdef RLIMIT_NOFILE -+ { "rlimit_files", A_RLIMIT_FILES, 1, rlim_files_parser }, -+#endif - #ifdef RLIMIT_RSS - { "rlimit_rss", A_RLIMIT_RSS, 1, rlim_rss_parser }, - #endif -diff -Nurp xinetd-2.3.14-orig/xinetd/parsers.c xinetd-2.3.14-files/xinetd/parsers.c ---- xinetd-2.3.14-orig/xinetd/parsers.c 2005-10-05 23:45:41.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/parsers.c 2009-10-20 13:08:45.000000000 +0200 -@@ -1415,6 +1415,29 @@ status_e rlim_data_parser( pset_h values - } - #endif - -+#ifdef RLIMIT_NOFILE -+status_e rlim_files_parser( pset_h values, -+ struct service_config *scp, -+ enum assign_op op ) -+{ -+ char *mem = (char *) pset_pointer( values, 0 ) ; -+ const char *func = "rlim_files_parser" ; -+ -+ if ( EQ( mem, "UNLIMITED" ) ) -+ SC_RLIM_FILES(scp) = (rlim_t)RLIM_INFINITY ; -+ else -+ { -+ if ( get_limit ( mem, &SC_RLIM_FILES(scp)) ) -+ { -+ parsemsg( LOG_ERR, func, -+ "Max files limit is invalid: %s", mem ) ; -+ return( FAILED ) ; -+ } -+ } -+ return( OK ) ; -+} -+#endif -+ - #ifdef RLIMIT_RSS - status_e rlim_rss_parser( pset_h values, - struct service_config *scp, -diff -Nurp xinetd-2.3.14-orig/xinetd/parsers.h xinetd-2.3.14-files/xinetd/parsers.h ---- xinetd-2.3.14-orig/xinetd/parsers.h 2005-10-05 19:15:33.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/parsers.h 2009-10-20 13:08:45.000000000 +0200 -@@ -57,6 +57,9 @@ status_e rlim_cpu_parser(pset_h, struct - #ifdef RLIMIT_DATA - status_e rlim_data_parser(pset_h, struct service_config *, enum assign_op) ; - #endif -+#ifdef RLIMIT_NOFILE -+status_e rlim_files_parser(pset_h, struct service_config *, enum assign_op) ; -+#endif - #ifdef RLIMIT_RSS - status_e rlim_rss_parser(pset_h, struct service_config *, enum assign_op) ; - #endif -diff -Nurp xinetd-2.3.14-orig/xinetd/sconf.h xinetd-2.3.14-files/xinetd/sconf.h ---- xinetd-2.3.14-orig/xinetd/sconf.h 2009-10-20 13:07:34.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/sconf.h 2009-10-20 13:08:45.000000000 +0200 -@@ -143,6 +143,7 @@ struct service_config - rlim_t sc_rlim_as; - rlim_t sc_rlim_cpu; - rlim_t sc_rlim_data; -+ rlim_t sc_rlim_files; - rlim_t sc_rlim_rss; - rlim_t sc_rlim_stack; - mode_t sc_umask; -@@ -191,6 +192,7 @@ struct service_config - #define SC_RLIM_AS( scp ) (scp)->sc_rlim_as - #define SC_RLIM_CPU( scp ) (scp)->sc_rlim_cpu - #define SC_RLIM_DATA( scp ) (scp)->sc_rlim_data -+#define SC_RLIM_FILES( scp ) (scp)->sc_rlim_files - #define SC_RLIM_RSS( scp ) (scp)->sc_rlim_rss - #define SC_RLIM_STACK( scp ) (scp)->sc_rlim_stack - #define SC_TYPE( scp ) (scp)->sc_type -diff -Nurp xinetd-2.3.14-orig/xinetd/xinetd.conf.man xinetd-2.3.14-files/xinetd/xinetd.conf.man ---- xinetd-2.3.14-orig/xinetd/xinetd.conf.man 2009-10-20 13:07:34.000000000 +0200 -+++ xinetd-2.3.14-files/xinetd/xinetd.conf.man 2009-10-20 13:08:45.000000000 +0200 -@@ -569,6 +569,12 @@ is implemented, it is more useful to set - rlimit_rss and rlimit_stack. This resource limit is only implemented on - Linux systems. - .TP -+.B rlimit_files -+Sets the maximum number of open files that the service may use. -+One parameter is required, which is a positive integer representing -+the number of open file descriptors. Practical limit of this number -+is around 1024000. -+.TP - .B rlimit_cpu - Sets the maximum number of CPU seconds that the service may use. - One parameter is required, which is either a positive integer representing diff --git a/xinetd-2.3.14-fix-type-punned-ptr.patch b/xinetd-2.3.14-fix-type-punned-ptr.patch deleted file mode 100644 index 993169f..0000000 --- a/xinetd-2.3.14-fix-type-punned-ptr.patch +++ /dev/null @@ -1,22 +0,0 @@ -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-ident-bind.patch b/xinetd-2.3.14-ident-bind.patch deleted file mode 100644 index 2df97ea..0000000 --- a/xinetd-2.3.14-ident-bind.patch +++ /dev/null @@ -1,42 +0,0 @@ -448069: xinetd: socket bind: Invalid argument (errno = 22) when using USERID on ipv6 - -Use right size of addresses in bind() call. Also use getpeername addresses when -connecting to ident service to prevent address family mismatch between socket(), -bind() and connect() calls. - -Author: Jan Safranek -Reviewed-By: Adam Tkac - -diff -up xinetd-2.3.14/xinetd/ident.c.orig xinetd-2.3.14/xinetd/ident.c ---- xinetd-2.3.14/xinetd/ident.c.orig 2008-05-29 16:30:19.000000000 +0200 -+++ xinetd-2.3.14/xinetd/ident.c 2008-05-29 16:29:57.000000000 +0200 -@@ -97,7 +98,13 @@ idresult_e log_remote_user( const struct - } - - CLEAR( sin_contact ); -- sin_remote = *CONN_XADDRESS( SERVER_CONNECTION( serp ) ) ; -+ -+ sin_len = sizeof( sin_remote ); -+ if ( getpeername( SERVER_FD( serp ), &sin_remote.sa, &sin_len ) == -1 ) -+ { -+ msg( LOG_ERR, func, "(%d) getpeername: %m", getpid() ) ; -+ return( IDR_ERROR ) ; -+ } - sin_contact = sin_remote; - memcpy( &sin_bind, &sin_local, sizeof(sin_bind) ) ; - local_port = 0; -@@ -121,7 +128,13 @@ idresult_e log_remote_user( const struct - msg( LOG_ERR, func, "socket creation: %m" ) ; - return( IDR_ERROR ) ; - } -- if ( bind(sd, &sin_bind.sa, sizeof(sin_bind.sa)) == -1 ) -+ -+ if ( sin_bind.sa.sa_family == AF_INET ) -+ sin_len = sizeof( sin_bind.sa_in ) ; -+ else -+ sin_len = sizeof( sin_bind.sa_in6 ) ; -+ -+ if ( bind(sd, &sin_bind.sa, sin_len) == -1 ) - { - msg( LOG_ERR, func, "socket bind: %m" ) ; - (void) Sclose( sd ) ; diff --git a/xinetd-2.3.14-instances.patch b/xinetd-2.3.14-instances.patch deleted file mode 100644 index 6def242..0000000 --- a/xinetd-2.3.14-instances.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xinetd-2.3.14/xinetd/access.c 2005-10-05 19:15:33.000000000 +0200 -+++ xinetd-2.3.14-mod/xinetd/access.c 2012-03-05 14:54:30.935416926 +0100 -@@ -73,6 +73,7 @@ static void cps_service_restart(void) - unsigned int i; - time_t nowtime; - const char *func = "cps_service_restart"; -+ int rs; - - nowtime = time(NULL); - for( i=0; i < pset_count( SERVICES(ps) ); i++ ) { -@@ -84,8 +85,11 @@ static void cps_service_restart(void) - if( SVC_STATE(sp) == SVC_DISABLED ) { - scp = SVC_CONF( sp ); - if ( SC_TIME_REENABLE(scp) <= nowtime ) { -+ rs = SVC_RUNNING_SERVERS(sp); - /* re-enable the service */ - if( svc_activate(sp) == OK ) { -+ /* remember running servers after restart */ -+ SVC_RUNNING_SERVERS(sp) = rs; - msg(LOG_ERR, func, - "Activating service %s", SC_NAME(scp)); - } else { diff --git a/xinetd-2.3.14-ipv6confusion.patch b/xinetd-2.3.14-ipv6confusion.patch deleted file mode 100644 index 5f0b431..0000000 --- a/xinetd-2.3.14-ipv6confusion.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- 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-2.3.14-leaking-fds-2a.patch b/xinetd-2.3.14-leaking-fds-2a.patch deleted file mode 100644 index 90901e5..0000000 --- a/xinetd-2.3.14-leaking-fds-2a.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -Naur xinetd-2.3.14-dist/xinetd/service.c xinetd-2.3.14/xinetd/service.c ---- xinetd-2.3.14-dist/xinetd/service.c 2012-04-03 08:59:19.000000000 +0200 -+++ xinetd-2.3.14/xinetd/service.c 2012-04-03 09:02:34.588160317 +0200 -@@ -366,12 +366,24 @@ - - msg( LOG_ERR, func, - "socket creation failed (%m). service = %s", SC_ID( scp ) ) ; -+#ifdef HAVE_POLL -+ SVC_EVENTS( sp ) = 0; -+ SVC_FD( sp ) = 0; -+#else -+ FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif /* HAVE_POLL */ - return( FAILED ) ; - } - - if ( set_fd_modes( sp ) == FAILED ) - { - (void) Sclose( SVC_FD(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 */ - return( FAILED ) ; - } - -@@ -385,6 +397,12 @@ - if ( status == FAILED ) - { - (void) Sclose( SVC_FD(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 */ - return( FAILED ) ; - } - diff --git a/xinetd-2.3.14-leaking-fds.patch b/xinetd-2.3.14-leaking-fds.patch deleted file mode 100644 index bc1b919..0000000 --- a/xinetd-2.3.14-leaking-fds.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -up xinetd-2.3.14-dist/xinetd/service.c xinetd-2.3.14/xinetd/service.c ---- xinetd-2.3.14-dist/xinetd/service.c 2012-01-11 11:50:43.438650900 +0100 -+++ xinetd-2.3.14/xinetd/service.c 2012-01-16 08:18:09.462620084 +0100 -@@ -88,6 +88,7 @@ struct service *svc_new( struct service_ - CLEAR( *sp ) ; - - SVC_CONF(sp) = scp ; -+ sp->svc_pfd_index = -1; - return( sp ) ; - } - -@@ -346,7 +347,16 @@ status_e svc_activate( struct service *s - ps.rws.pfds_last)*sizeof(struct pollfd)); - ps.rws.pfd_array = tmp; - } -- SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; -+ if ( sp->svc_pfd_index >= 0 ) -+ { -+ SVC_POLLFD( sp ) = &ps.rws.pfd_array[sp->svc_pfd_index] ; -+ } -+ else -+ { -+ sp->svc_pfd_index = ps.rws.pfds_last ; -+ SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; -+ } -+ - #endif /* HAVE_POLL */ - - if( SC_IPV4( scp ) ) { -@@ -433,6 +443,11 @@ status_e svc_activate( struct service *s - static void deactivate( const struct service *sp ) - { - (void) Sclose( SVC_FD( sp ) ) ; -+#ifdef HAVE_POLL -+ SVC_FD( sp ) = 0; -+#else -+ FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif - - #ifdef HAVE_MDNS - xinetd_mdns_deregister(SVC_CONF(sp)); -diff -up xinetd-2.3.14-dist/xinetd/service.h xinetd-2.3.14/xinetd/service.h ---- xinetd-2.3.14-dist/xinetd/service.h 2012-01-11 11:50:43.418650925 +0100 -+++ xinetd-2.3.14/xinetd/service.h 2012-01-16 08:02:59.667553008 +0100 -@@ -47,6 +47,7 @@ struct service - { - state_e svc_state ; - int svc_ref_count ; /* # of pters to this struct */ -+ int svc_pfd_index; /* index of pfd in pfd_array */ - struct service_config *svc_conf ; /* service configuration */ - - #ifdef HAVE_POLL diff --git a/xinetd-2.3.14-man-section.patch b/xinetd-2.3.14-man-section.patch deleted file mode 100644 index 03f1914..0000000 --- a/xinetd-2.3.14-man-section.patch +++ /dev/null @@ -1,16 +0,0 @@ -117746: xinetd.log man page in wrong section - -Put xinetd.log to the right man section. - -diff -up xinetd-2.3.13/Makefile.in.orig xinetd-2.3.13/Makefile.in ---- xinetd-2.3.13/Makefile.in.orig 2007-12-06 10:58:32.000000000 +0100 -+++ xinetd-2.3.13/Makefile.in 2008-01-15 13:39:38.000000000 +0100 -@@ -80,7 +80,7 @@ install: build - $(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR) - $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR) - $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5 -- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8 -+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man5/xinetd.log.5 - $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8 - $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8 - $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8 diff --git a/xinetd-2.3.14-many-services.patch b/xinetd-2.3.14-many-services.patch deleted file mode 100644 index 8459b6c..0000000 --- a/xinetd-2.3.14-many-services.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- xinetd-2.3.14-dist/xinetd/defs.h 2012-01-16 12:20:54.739041678 +0100 -+++ xinetd-2.3.14/xinetd/defs.h 2012-01-17 08:06:56.800762230 +0100 -@@ -115,8 +115,9 @@ union xsockaddr { - */ - - #ifdef HAVE_POLL --#define INIT_POLLFDS 1024 --#define MAX_POLLFDS 8192 -+#define INIT_POLLFDS 4096 -+/* FIXME: not used */ -+#define MAX_POLLFDS 16384 - #endif - - /* ---- xinetd-2.3.14-dist/xinetd/service.c 2012-01-16 12:20:54.741041678 +0100 -+++ xinetd-2.3.14/xinetd/service.c 2012-01-17 08:07:28.872746991 +0100 -@@ -343,9 +343,9 @@ status_e svc_activate( struct service *s - out_of_memory( func ); - return( FAILED ); - } -+ ps.rws.pfd_array = tmp; - memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- - ps.rws.pfds_last)*sizeof(struct pollfd)); -- ps.rws.pfd_array = tmp; - } - if ( sp->svc_pfd_index >= 0 ) - { diff --git a/xinetd-2.3.14-poll.patch b/xinetd-2.3.14-poll.patch deleted file mode 100644 index bd87ae5..0000000 --- a/xinetd-2.3.14-poll.patch +++ /dev/null @@ -1,1202 +0,0 @@ -diff -Nurp xinetd-2.3.14-orig/config.h.in xinetd-2.3.14-poll/config.h.in ---- xinetd-2.3.14-orig/config.h.in 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/config.h.in 2009-09-02 11:30:27.000000000 +0200 -@@ -106,6 +106,8 @@ - - #undef HAVE_HOWL - -+#undef HAVE_POLL -+ - /* OS specific */ - #undef solaris - -diff -Nurp xinetd-2.3.14-orig/configure.in xinetd-2.3.14-poll/configure.in ---- xinetd-2.3.14-orig/configure.in 2009-09-02 11:32:54.000000000 +0200 -+++ xinetd-2.3.14-poll/configure.in 2009-09-02 11:30:27.000000000 +0200 -@@ -35,6 +35,7 @@ AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE( - AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR, 1, "")]) - AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO, 1, "")]) - AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO, 1, "")]) -+AC_CHECK_FUNC(poll, [AC_DEFINE(HAVE_POLL, 1, "")]) - - AC_CHECK_HEADERS(sys/types.h sys/termios.h termios.h sys/ioctl.h sys/select.h rpc/rpc.h rpc/rpcent.h sys/file.h ftw.h machine/reg.h netdb.h) - AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H, 1, "")]) -diff -Nurp xinetd-2.3.14-orig/xinetd/conf.c xinetd-2.3.14-poll/xinetd/conf.c ---- xinetd-2.3.14-orig/xinetd/conf.c 2003-12-30 14:44:09.000000000 +0100 -+++ xinetd-2.3.14-poll/xinetd/conf.c 2009-09-02 11:30:27.000000000 +0200 -@@ -209,8 +209,13 @@ unsigned cnf_start_services( struct conf - pset_clear( sconfs ) ; - - if ( debug.on ) -+#ifdef HAVE_POLL -+ msg( LOG_DEBUG, func, "pfds_last = %d, services_started = %d", -+ ps.rws.pfds_last, services_started ) ; -+#else - msg( LOG_DEBUG, func, "mask_max = %d, services_started = %d", - ps.rws.mask_max, services_started ) ; -+#endif - - return( services_started ) ; - } -diff -Nurp xinetd-2.3.14-orig/xinetd/defs.h xinetd-2.3.14-poll/xinetd/defs.h ---- xinetd-2.3.14-orig/xinetd/defs.h 2005-03-29 17:50:34.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/defs.h 2009-09-02 11:30:27.000000000 +0200 -@@ -111,6 +111,15 @@ union xsockaddr { - #define LISTEN_BACKLOG 64 - - /* -+ * constants for limiting ps.rws.fd_list -+ */ -+ -+#ifdef HAVE_POLL -+#define INIT_POLLFDS 1024 -+#define MAX_POLLFDS 8192 -+#endif -+ -+/* - * When explicit values are given for enum's, that is because the structures - * that the enum's are in may be initialized by a memory clear operation. - */ -diff -Nurp xinetd-2.3.14-orig/xinetd/child.c xinetd-2.3.14-poll/xinetd/child.c ---- xinetd-2.3.14-orig/xinetd/child.c 2003-09-06 16:41:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/child.c 2009-09-02 11:30:27.000000000 +0200 -@@ -109,8 +109,7 @@ void exec_server( const struct server *s - - - #ifdef RLIMIT_NOFILE -- rl.rlim_max = ps.ros.orig_max_descriptors ; -- rl.rlim_cur = ps.ros.max_descriptors ; -+ rl.rlim_max = rl.rlim_cur = ps.ros.max_descriptors ; - (void) setrlimit( RLIMIT_NOFILE, &rl ) ; - #endif - #ifdef RLIMIT_AS -diff -Nurp xinetd-2.3.14-orig/xinetd/init.c xinetd-2.3.14-poll/xinetd/init.c ---- xinetd-2.3.14-orig/xinetd/init.c 2003-09-06 16:41:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/init.c 2009-09-02 11:30:27.000000000 +0200 -@@ -17,7 +17,7 @@ - #include - #include - #include -- -+#include - #include "sio.h" - #include "init.h" - #include "defs.h" -@@ -140,7 +140,6 @@ static void set_fd_limit(void) - { - #ifdef RLIMIT_NOFILE - struct rlimit rl ; -- rlim_t maxfd ; - - /* - * Set the soft file descriptor limit to the hard limit. -@@ -151,25 +150,9 @@ static void set_fd_limit(void) - exit( 1 ) ; - } - -- maxfd = rl.rlim_max; - if ( rl.rlim_max == RLIM_INFINITY ) - rl.rlim_max = FD_SETSIZE; - -- /* XXX: a dumb way to prevent fd_set overflow possibilities; the rest -- * of xinetd should be changed to use an OpenBSD inetd-like fd_grow(). */ -- if ( rl.rlim_max > FD_SETSIZE ) -- rl.rlim_max = FD_SETSIZE; -- -- rl.rlim_cur = rl.rlim_max ; -- if ( setrlimit( RLIMIT_NOFILE, &rl ) == -1 ) -- { -- syscall_failed("setrlimit(RLIMIT_NOFILE)"); -- ps.ros.max_descriptors = FD_SETSIZE; -- ps.ros.orig_max_descriptors = FD_SETSIZE; -- return ; -- } -- -- ps.ros.orig_max_descriptors = maxfd ; - ps.ros.max_descriptors = rl.rlim_max ; - #else /* ! RLIMIT_NOFILE */ - ps.ros.max_descriptors = getdtablesize() ; -@@ -292,15 +275,27 @@ static pset_h new_table( unsigned size ) - */ - static void init_rw_state( void ) - { -+ const char *func = "init_rw_state" ; - SERVERS( ps ) = new_table( 0 ) ; - RETRIES( ps ) = new_table( 0 ) ; - SERVICES( ps ) = new_table( 0 ) ; - - ps.rws.descriptors_free = ps.ros.max_descriptors - DESCRIPTORS_RESERVED ; - -+#ifdef HAVE_POLL -+ ps.rws.pfds_allocated = INIT_POLLFDS ; -+ ps.rws.pfd_array = (struct pollfd *) -+ malloc( sizeof( struct pollfd ) * ps.rws.pfds_allocated ) ; -+ if ( ps.rws.pfd_array == NULL ) -+ { -+ out_of_memory(func); -+ exit( 1 ) ; -+ } -+ ps.rws.pfds_last = 0 ; -+#else - FD_ZERO( &ps.rws.socket_mask ) ; - ps.rws.mask_max = 0 ; -- -+#endif /* HAVE_POLL */ - } - - -diff -Nurp xinetd-2.3.14-orig/xinetd/intcommon.c xinetd-2.3.14-poll/xinetd/intcommon.c ---- xinetd-2.3.14-orig/xinetd/intcommon.c 2003-08-06 08:12:10.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/intcommon.c 2009-09-03 16:15:49.000000000 +0200 -@@ -14,6 +14,9 @@ - #include - #include - #include -+#ifdef HAVE_POLL -+#include -+#endif - - #include "intcommon.h" - #include "msg.h" -@@ -36,27 +39,38 @@ void int_fail( const struct intercept_s - /* - * Returns either a positive number or -1 - */ -+#ifdef HAVE_POLL -+int int_poll( int pfds_last, struct pollfd *pfd_array ) -+{ -+ const char *func = "int_poll" ; -+#else - int int_select( int max, fd_set *read_mask ) - { - const char *func = "int_select" ; -+#endif - - for ( ;; ) - { - int n_ready ; - -- n_ready = select( max+1, read_mask, -- FD_SET_NULL, FD_SET_NULL, TIMEVAL_NULL ) ; -+ do { -+#ifdef HAVE_POLL -+ n_ready = poll( pfd_array, pfds_last, -1 ); -+#else -+ n_ready = select( max+1, read_mask, -+ FD_SET_NULL, FD_SET_NULL, TIMEVAL_NULL ) ; -+#endif -+ } while (n_ready == -1 && errno == EINTR); -+ -+ - if ( n_ready > 0 ) - return( n_ready ) ; -- else if ( n_ready == -1 ) { -- if ( errno == EINTR ) -- continue ; -- else -- { -- msg( LOG_ERR, func, "select: %m" ) ; -- return( -1 ) ; -- } -- } -+#ifdef HAVE_POLL -+ msg( LOG_ERR, func, "poll: %m" ) ; -+#else -+ msg( LOG_ERR, func, "select: %m" ) ; -+#endif -+ return( -1 ) ; - } - } - -diff -Nurp xinetd-2.3.14-orig/xinetd/internals.c xinetd-2.3.14-poll/xinetd/internals.c ---- xinetd-2.3.14-orig/xinetd/internals.c 2003-09-06 16:41:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/internals.c 2009-09-03 10:38:29.000000000 +0200 -@@ -53,6 +53,9 @@ void dump_internal_state(void) - const char *dump_file = DUMP_FILE ; - time_t current_time ; - int fd ; -+#ifdef HAVE_POLL -+ int *listed_fds; -+#endif - unsigned u ; - const char *func = "dump_internal_state" ; - -@@ -104,6 +107,41 @@ void dump_internal_state(void) - server_dump( SERP( pset_pointer( RETRIES( ps ), u ) ), dump_fd ) ; - Sputchar( dump_fd, '\n' ) ; - -+#ifdef HAVE_POLL -+ /* -+ * Dump the socket mask -+ */ -+ listed_fds = (int *)calloc(sizeof(int),ps.ros.max_descriptors); -+ if (listed_fds != NULL) -+ { -+ Sprint( dump_fd, "Socket mask:" ) ; -+ for ( fd = 0 ; fd < ps.rws.pfds_last ; fd++ ) -+ { -+ listed_fds[ps.rws.pfd_array[fd].fd] = 1; -+ Sprint( dump_fd, " %d", ps.rws.pfd_array[fd].fd ) ; -+ } -+ Sputchar( dump_fd, '\n' ) ; -+ Sprint( dump_fd, "pfds_last = %d\n", ps.rws.pfds_last ) ; -+ -+ /* -+ * Dump the descriptors that are open and are *not* in the socket list -+ */ -+ Sprint( dump_fd, "Open descriptors (not in socket mask):" ) ; -+ for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) -+ { -+ struct stat st ; -+ -+ if ( !listed_fds[fd] && fstat( fd, &st ) != -1 ) -+ Sprint( dump_fd, " %d", fd ) ; -+ } -+ -+ Sputchar( dump_fd, '\n' ) ; -+ Sputchar( dump_fd, '\n' ) ; -+ free(listed_fds); -+ } -+ else -+ Sprint( dump_fd, "Could not dump open descriptors, not enough memory!\n" ); -+#else /* !HAVE_POLL */ - /* - * Dump the socket mask - */ -@@ -114,6 +152,7 @@ void dump_internal_state(void) - Sputchar( dump_fd, '\n' ) ; - Sprint( dump_fd, "mask_max = %d\n", ps.rws.mask_max ) ; - -+ - /* - * Dump the descriptors that are open and are *not* in the socket mask - */ -@@ -130,6 +169,7 @@ void dump_internal_state(void) - } - Sputchar( dump_fd, '\n' ) ; - Sputchar( dump_fd, '\n' ) ; -+#endif /* !HAVE_POLL */ - - Sprint( dump_fd, "active_services = %d\n", ps.rws.active_services ) ; - Sprint( dump_fd, "available_services = %d\n", ps.rws.available_services ) ; -@@ -162,7 +202,6 @@ enum check_type { PERIODIC, USER_REQUEST - static void consistency_check( enum check_type type ) - { - int fd ; -- fd_set socket_mask_copy ; - unsigned u ; - int errors ; - unsigned total_running_servers = 0 ; -@@ -171,7 +210,19 @@ static void consistency_check( enum chec - bool_int service_count_check_failed = FALSE ; - const char *func = "consistency_check" ; - -+ -+#ifdef HAVE_POLL -+ struct pollfd *pfd_array_copy = calloc(sizeof(struct pollfd), ps.rws.pfds_last); -+ if (pfd_array_copy == NULL) -+ { -+ msg( LOG_ERR, func, "Could not run consistency check! Not enough memory!\n" ) ; -+ return; -+ } -+ memcpy(pfd_array_copy, ps.rws.pfd_array, ps.rws.pfds_last*sizeof(struct pollfd)); -+#else /* !HAVE_POLL */ -+ fd_set socket_mask_copy ; - socket_mask_copy = ps.rws.socket_mask ; -+#endif /* HAVE_POLL */ - - for ( u = 0 ; u < pset_count( SERVICES( ps ) ) ; u++ ) - { -@@ -184,9 +235,22 @@ static void consistency_check( enum chec - - if ( SVC_IS_AVAILABLE( sp ) || SVC_IS_DISABLED ( sp ) ) - { -+ - /* - * In this case, there may be some servers running - */ -+#ifdef HAVE_POLL -+ if ( pfd_array_copy[ SVC_POLLFD_OFF( sp ) ].events ) -+ { -+ if ( SVC_IS_DISABLED( sp ) ) -+ { -+ msg( LOG_ERR, func, -+ "fd of disabled service %s still in socket mask", sid ) ; -+ error_count++ ; -+ } -+ pfd_array_copy[ SVC_POLLFD_OFF( sp ) ].events = 0; -+ } -+#else /* !HAVE_POLL */ - if ( FD_ISSET( SVC_FD( sp ), &socket_mask_copy ) ) - { - if ( SVC_IS_DISABLED( sp ) ) -@@ -197,8 +261,9 @@ static void consistency_check( enum chec - } - FD_CLR( SVC_FD( sp ), &socket_mask_copy ) ; - } -- error_count += thread_check( sp, running_servers, retry_servers ) ; -+#endif /* HAVE_POLL */ - -+ error_count += thread_check( sp, running_servers, retry_servers ) ; - errors = service_count_check( sp, running_servers, retry_servers ) ; - if ( ! errors && ! service_count_check_failed ) - { -@@ -248,6 +313,18 @@ static void consistency_check( enum chec - /* - * Check if there are any descriptors set in socket_mask_copy - */ -+#ifdef HAVE_POLL -+ for ( fd = 0 ; fd < ps.rws.pfds_last ; fd++) -+ if ( pfd_array_copy[fd].events && pfd_array_copy[fd].fd != signals_pending[0] && -+ pfd_array_copy[fd].fd != signals_pending[1] ) -+ { -+ msg( LOG_ERR, func, -+ "descriptor %d set in socket mask but there is no service for it", -+ fd ) ; -+ error_count++ ; -+ } -+ free(pfd_array_copy); -+#else /* !HAVE_POLL */ - for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) - if ( FD_ISSET( fd, &socket_mask_copy ) && ((fd != signals_pending[0]) && fd != signals_pending[1])) - { -@@ -256,6 +333,7 @@ static void consistency_check( enum chec - fd ) ; - error_count++ ; - } -+#endif /* !HAVE_POLL */ - - if ( error_count != 0 ) - msg( LOG_WARNING, func, -@@ -304,7 +382,6 @@ static unsigned service_count_check( str - } - - -- - /* - * If the service is single-threaded: - * if the descriptor is set in the socket mask, there must -@@ -317,7 +394,11 @@ static unsigned thread_check( struct ser - unsigned retry_servers ) - { - unsigned error_count = 0 ; -+#ifdef HAVE_POLL -+ struct pollfd *pfd= SVC_POLLFD( sp ) ; -+#else - int sd = SVC_FD( sp ) ; -+#endif - char *sid = SVC_ID( sp ) ; - const char *func = "thread_check" ; - -@@ -325,13 +406,21 @@ static unsigned thread_check( struct ser - { - bool_int has_servers = ( running_servers + retry_servers != 0 ) ; - -+#ifdef HAVE_POLL -+ if ( has_servers && pfd->events ) -+#else - if ( has_servers && FD_ISSET( sd, &ps.rws.socket_mask ) ) -+#endif - { - msg( LOG_ERR, func, - "Active single-threaded service %s: server running, descriptor set", sid ) ; - error_count++ ; - } -+#ifdef HAVE_POLL -+ if ( !has_servers && !pfd->events ) -+#else - if ( !has_servers && !FD_ISSET( sd, &ps.rws.socket_mask ) ) -+#endif - { - msg( LOG_ERR, func, - "Active single-threaded service %s: no server running, descriptor not set", -@@ -340,7 +429,11 @@ static unsigned thread_check( struct ser - } - } - else -+#ifdef HAVE_POLL -+ if ( ! pfd->events ) -+#else - if ( ! FD_ISSET( sd, &ps.rws.socket_mask ) ) -+#endif - { - msg( LOG_ERR, func, - "Active multi-threaded service %s: descriptor not set", sid ) ; -diff -Nurp xinetd-2.3.14-orig/xinetd/main.c xinetd-2.3.14-poll/xinetd/main.c ---- xinetd-2.3.14-orig/xinetd/main.c 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/main.c 2009-09-03 16:23:11.000000000 +0200 -@@ -25,6 +25,9 @@ - #include "xtimer.h" - #include "sensor.h" - #include "xmdns.h" -+#ifdef HAVE_POLL -+#include "xpoll.h" -+#endif - - #ifdef __GNUC__ - __attribute__ ((noreturn)) -@@ -119,16 +122,24 @@ static void main_loop(void) - { - const char *func = "main_loop" ; - struct timeval tv, *tvptr = NULL; -+#ifdef HAVE_POLL -+ struct pollfd *signal_pfd; - -- FD_SET(signals_pending[0], &ps.rws.socket_mask); -+ ps.rws.pfd_array[ps.rws.pfds_last].fd = signals_pending[0] ; -+ ps.rws.pfd_array[ps.rws.pfds_last].events = POLLIN ; -+ signal_pfd = &ps.rws.pfd_array[ps.rws.pfds_last] ; -+ ps.rws.pfds_last++; -+#else -+ FD_SET(signals_pending[0], &ps.rws.socket_mask) ; - if ( signals_pending[0] > ps.rws.mask_max ) - ps.rws.mask_max = signals_pending[0] ; -- if ( signals_pending[1] > ps.rws.mask_max ) -- ps.rws.mask_max = signals_pending[1] ; -+#endif /* HAVE_POLL */ - - for ( ;; ) - { -+#ifndef HAVE_POLL - fd_set read_mask ; -+#endif - int n_active ; - unsigned u ; - -@@ -144,9 +155,14 @@ static void main_loop(void) - tvptr = NULL; - } - -+#ifdef HAVE_POLL -+ n_active = poll( ps.rws.pfd_array, ps.rws.pfds_last, -+ tvptr == NULL ? -1 : tvptr->tv_sec*1000 ) ; -+#else - read_mask = ps.rws.socket_mask ; - n_active = select( ps.rws.mask_max+1, &read_mask, - FD_SET_NULL, FD_SET_NULL, tvptr ) ; -+#endif - if ( n_active == -1 ) - { - if ( errno == EINTR ) { -@@ -165,11 +181,27 @@ static void main_loop(void) - - xtimer_poll(); - -- if( FD_ISSET(signals_pending[0], &read_mask) ) { -+#ifdef HAVE_POLL -+ if ( POLLFD_REVENTS( signal_pfd ) ) -+ { -+ if ( POLLFD_REVENTS( signal_pfd ) & (POLLERR | POLLHUP | -+ POLLNVAL) ) -+ find_bad_fd(); -+ else -+ { -+ check_pipe(); -+ if ( --n_active == 0 ) -+ continue ; -+ } -+ } -+#else -+ if( FD_ISSET(signals_pending[0], &read_mask) ) -+ { - check_pipe(); - if ( --n_active == 0 ) - continue ; - } -+#endif - - #ifdef HAVE_MDNS - if( xinetd_mdns_poll() == 0 ) -@@ -186,19 +218,33 @@ static void main_loop(void) - if ( ! SVC_IS_ACTIVE( sp ) ) - continue ; - -+#ifdef HAVE_POLL -+ if ( SVC_REVENTS( sp ) ) -+ { -+ if ( SVC_REVENTS( sp ) & (POLLERR | POLLHUP | -+ POLLNVAL) ) -+ find_bad_fd(); -+ else -+ { -+ svc_request( sp ) ; -+ if ( --n_active == 0 ) -+ break ; -+ } -+ } -+#else - if ( FD_ISSET( SVC_FD( sp ), &read_mask ) ) - { - svc_request( sp ) ; - if ( --n_active == 0 ) - break ; - } -+#endif - } - if ( n_active > 0 ) - msg( LOG_ERR, func, "%d descriptors still set", n_active ) ; - } - } - -- - /* - * This function identifies if any of the fd's in the socket mask - * is bad. We use it in case select(2) returns EBADF -@@ -208,13 +254,29 @@ static void main_loop(void) - static void find_bad_fd(void) - { - int fd ; -+#ifdef HAVE_POLL -+ const char *reason; -+#else - struct stat st ; -+#endif - unsigned bad_fd_count = 0 ; - const char *func = "find_bad_fd" ; - -+#ifdef HAVE_POLL -+ for ( fd = 0 ; (unsigned)fd < ps.rws.pfds_last ; fd++ ) -+ if ( ps.rws.pfd_array[fd].revents & ( POLLHUP|POLLNVAL|POLLERR ) ) -+ { -+ if ( ps.rws.pfd_array[fd].revents & POLLHUP ) -+ reason = "hung up"; -+ else if ( ps.rws.pfd_array[fd].revents & POLLNVAL ) -+ reason = "been closed"; -+ else if ( ps.rws.pfd_array[fd].revents & POLLERR ) -+ reason = "reported error condition"; -+#else - for ( fd = 0 ; (unsigned)fd < ps.ros.max_descriptors ; fd++ ) - if ( FD_ISSET( fd, &ps.rws.socket_mask ) && fstat( fd, &st ) == -1 ) - { -+#endif - int found = FALSE ; - unsigned u ; - -@@ -239,7 +301,11 @@ static void find_bad_fd(void) - } - if ( ! found ) - { -+#ifdef HAVE_POLL -+ ps.rws.pfd_array[fd].events = 0; -+#else - FD_CLR( fd, &ps.rws.socket_mask ) ; -+#endif - msg( LOG_ERR, func, - "No active service for file descriptor %d\n", fd ) ; - bad_fd_count++ ; -diff -Nurp xinetd-2.3.14-orig/xinetd/redirect.c xinetd-2.3.14-poll/xinetd/redirect.c ---- xinetd-2.3.14-orig/xinetd/redirect.c 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/redirect.c 2009-09-02 16:00:34.000000000 +0200 -@@ -58,14 +58,19 @@ void redir_handler( struct server *serp - struct service *sp = SERVER_SERVICE( serp ); - struct service_config *scp = SVC_CONF( sp ); - int RedirDescrip = SERVER_FD( serp ); -- int maxfd; - ssize_t num_read, num_wrote=0, ret=0; - unsigned int sin_len = 0; - unsigned long bytes_in = 0, bytes_out = 0; - int no_to_nagle = 1; - int on = 1, v6on; - char buff[NET_BUFFER]; -+#ifdef HAVE_POLL -+ struct pollfd *pfd_array; -+ int pfds_last = 0; -+#else - fd_set rdfd, msfd; -+ int maxfd; -+#endif - struct timeval *timep = NULL; - const char *func = "redir_handler"; - union xsockaddr serveraddr ; -@@ -141,19 +146,43 @@ void redir_handler( struct server *serp - msg(LOG_ERR, func, "setsockopt RedirDescrip failed: %m"); - } - -+#ifdef HAVE_POLL -+#define REDIR_DESCRIP_INDEX 0 -+#define REDIR_SERVER_INDEX 1 -+ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ if (pfd_array == NULL) -+ { -+ msg( LOG_ERR, func, "Cannot allocate memory for file descriptors!\n"); -+ exit( 1 ); -+ } -+ pfd_array[ REDIR_DESCRIP_INDEX ].fd = RedirDescrip; -+ pfd_array[ REDIR_DESCRIP_INDEX ].events = POLLIN; -+ pfd_array[ REDIR_SERVER_INDEX ].fd = RedirServerFd; -+ pfd_array[ REDIR_SERVER_INDEX ].events = POLLIN; -+ pfds_last += 2; -+#else - maxfd = (RedirServerFd > RedirDescrip)?RedirServerFd:RedirDescrip; - FD_ZERO(&msfd); - FD_SET(RedirDescrip, &msfd); - FD_SET(RedirServerFd, &msfd); -+#endif - - while(1) { -+#ifdef HAVE_POLL -+ if ( poll( pfd_array, pfds_last, -1 ) <= 0 ) { -+#else - memcpy(&rdfd, &msfd, sizeof(rdfd)); - if (select(maxfd + 1, &rdfd, (fd_set *)0, (fd_set *)0, timep) <= 0) { -+#endif - /* place for timeout code, currently does not time out */ - break; - } - -+#ifdef HAVE_POLL -+ if ( pfd_array[REDIR_DESCRIP_INDEX].revents ) { -+#else - if (FD_ISSET(RedirDescrip, &rdfd)) { -+#endif - do { - num_read = read(RedirDescrip, - buff, sizeof(buff)); -@@ -179,7 +208,11 @@ void redir_handler( struct server *serp - } - } - -+#ifdef HAVE_POLL -+ if ( pfd_array[REDIR_SERVER_INDEX].revents ) { -+#else - if (FD_ISSET(RedirServerFd, &rdfd)) { -+#endif - do { - num_read = read(RedirServerFd, - buff, sizeof(buff)); -diff -Nurp xinetd-2.3.14-orig/xinetd/server.c xinetd-2.3.14-poll/xinetd/server.c ---- xinetd-2.3.14-orig/xinetd/server.c 2005-03-29 17:50:34.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/server.c 2009-09-02 11:30:27.000000000 +0200 -@@ -298,7 +298,11 @@ void server_end( struct server *serp ) - - /* Added this for when accepting wait=yes services */ - if( SVC_WAITS( sp ) ) -+#ifdef HAVE_POLL -+ SVC_EVENTS( sp ) = POLLIN ; -+#else - FD_SET( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif /* HAVE_POLL */ - - svc_postmortem( sp, serp ) ; - server_release( serp ) ; -diff -Nurp xinetd-2.3.14-orig/xinetd/service.c xinetd-2.3.14-poll/xinetd/service.c ---- xinetd-2.3.14-orig/xinetd/service.c 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/service.c 2009-09-02 17:03:49.000000000 +0200 -@@ -71,8 +71,6 @@ static const struct name_value service_s - { "BAD STATE", 0 } - } ; - -- -- - /* - * Allocate a new struct service and initialize it from scp - */ -@@ -115,6 +113,10 @@ struct service *svc_make_special( struct - - void svc_free( struct service *sp ) - { -+#ifdef HAVE_POLL -+ *SVC_POLLFD( sp ) = ps.rws.pfd_array[--ps.rws.pfds_last] ; -+#endif /* HAVE_POLL */ -+ - sc_free( SVC_CONF(sp) ) ; - CLEAR( *sp ) ; - FREE_SVC( sp ) ; -@@ -325,6 +327,25 @@ status_e svc_activate( struct service *s - return( OK ); - } - -+#ifdef HAVE_POLL -+ if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) -+ { -+ int pos; -+ ps.rws.pfds_allocated += INIT_POLLFDS; -+ struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, -+ ps.rws.pfds_allocated*sizeof(struct pollfd)); -+ if ( tmp == NULL ) -+ { -+ out_of_memory( func ); -+ return( FAILED ); -+ } -+ memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- -+ ps.rws.pfds_last)*sizeof(struct pollfd)); -+ ps.rws.pfd_array = tmp; -+ } -+ SVC_POLLFD( sp ) = &ps.rws.pfd_array[ps.rws.pfds_last++] ; -+#endif /* HAVE_POLL */ -+ - if( SC_IPV4( scp ) ) { - SVC_FD(sp) = socket( AF_INET, - SC_SOCKET_TYPE( scp ), SC_PROTOVAL( scp ) ) ; -@@ -390,9 +411,14 @@ status_e svc_activate( struct service *s - - SVC_STATE(sp) = SVC_ACTIVE ; - -+#ifdef HAVE_POLL -+ SVC_EVENTS( sp ) = POLLIN ; -+#else - FD_SET( SVC_FD(sp), &ps.rws.socket_mask ) ; -+ - if ( SVC_FD(sp) > ps.rws.mask_max ) - ps.rws.mask_max = SVC_FD(sp) ; -+#endif /* HAVE_POLL */ - - ps.rws.active_services++ ; - ps.rws.available_services++ ; -@@ -442,7 +468,11 @@ void svc_deactivate( struct service *sp - - if ( SVC_IS_ACTIVE( sp ) ) - { -+#ifdef HAVE_POLL -+ SVC_EVENTS( sp ) = 0; -+#else - FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif /* HAVE_POLL */ - ps.rws.active_services-- ; - } - -@@ -465,7 +495,15 @@ void svc_suspend( struct service *sp ) - return ; - } - -+#ifdef HAVE_POLL -+ /* -+ * don't reap the pfd from pfd_array, since we must have it allocated for -+ * SVC_FD( sp ) -+ */ -+ SVC_EVENTS( sp ) = 0; -+#else - FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif - ps.rws.active_services-- ; - if ( debug.on ) - msg( LOG_DEBUG, func, "Suspended service %s", SVC_ID( sp ) ) ; -@@ -481,7 +519,12 @@ void svc_resume( struct service *sp ) - { - const char *func = "svc_resume" ; - -+#ifdef HAVE_POLL -+ SVC_EVENTS( sp ) = POLLIN ; -+#else - FD_SET( SVC_FD( sp ), &ps.rws.socket_mask ) ; -+#endif -+ - ps.rws.active_services++ ; - if ( debug.on ) - msg( LOG_DEBUG, func, "Resumed service %s", SVC_ID( sp ) ) ; -diff -Nurp xinetd-2.3.14-orig/xinetd/service.h xinetd-2.3.14-poll/xinetd/service.h ---- xinetd-2.3.14-orig/xinetd/service.h 2005-03-29 17:50:34.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/service.h 2009-09-03 16:24:16.000000000 +0200 -@@ -17,6 +17,9 @@ - #include "pset.h" - #include "xlog.h" - #include "server.h" -+#ifdef HAVE_POLL -+#include "xpoll.h" -+#endif - - /* - * $Id: service.h,v 1.6 2012-05-09 15:40:29 bbraun Exp $ -@@ -45,7 +48,13 @@ struct service - state_e svc_state ; - int svc_ref_count ; /* # of pters to this struct */ - struct service_config *svc_conf ; /* service configuration */ -+ -+#ifdef HAVE_POLL -+ struct pollfd *svc_pfd ; /* pointer to the pollfd */ -+#else - int svc_fd ; /* The Listening FD for the service */ -+#endif /* HAVE_POLL */ -+ - unsigned svc_running_servers ; - unsigned svc_retry_servers ; - unsigned svc_attempts ; /* # of attempts to start server */ -@@ -70,7 +79,17 @@ struct service - * Field access macros - */ - #define SVC_CONF( sp ) ( (sp)->svc_conf ) -+ -+#ifdef HAVE_POLL -+#define SVC_POLLFD( sp ) ( (sp)->svc_pfd ) -+#define SVC_POLLFD_OFF( sp ) ( SVC_POLLFD( sp )-ps.rws.pfd_array ) -+#define SVC_EVENTS( sp ) ( POLLFD_EVENTS( SVC_POLLFD( sp ) ) ) -+#define SVC_REVENTS( sp ) ( POLLFD_REVENTS( SVC_POLLFD( sp ) ) ) -+#define SVC_FD( sp ) ( POLLFD_FD( SVC_POLLFD( sp ) ) ) -+#else - #define SVC_FD( sp ) ( (sp)->svc_fd ) -+#endif /* HAVE_POLL */ -+ - #define SVC_RUNNING_SERVERS( sp ) (sp)->svc_running_servers - #define SVC_RETRIES( sp ) (sp)->svc_retry_servers - #define SVC_LOG( sp ) (sp)->svc_log -diff -Nurp xinetd-2.3.14-orig/xinetd/state.h xinetd-2.3.14-poll/xinetd/state.h ---- xinetd-2.3.14-orig/xinetd/state.h 2005-03-31 01:15:28.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/state.h 2009-09-02 11:30:27.000000000 +0200 -@@ -21,7 +21,10 @@ - #endif - #include "libportable.h" - --#ifdef HAVE_SYS_SELECT_H -+#ifdef HAVE_POLL -+#include -+#endif -+#if HAVE_SYS_SELECT_H - #include - #endif - -@@ -32,7 +35,6 @@ - - struct read_only_state - { -- rlim_t orig_max_descriptors ; /* original soft rlimit */ - rlim_t max_descriptors ; /* original hard rlimit or OPEN_MAX */ - rlim_t process_limit ; /* if 0, there is no limit */ - int cc_interval ; /* # of seconds the cc gets invoked. */ -@@ -58,8 +60,15 @@ struct read_write_state - int available_services ; /* # of available services */ - int active_services ; /* services with descriptors set */ - /* in socket mask */ -+#ifdef HAVE_POLL -+ struct pollfd *pfd_array; /* array passed to poll(2) */ -+ int pfds_last; /* index of last fd in the array */ -+ int pfds_allocated; /* size of the array */ -+#else - fd_set socket_mask ; - int mask_max ; -+#endif /* HAVE_POLL */ -+ - pset_h servers ; /* table of running servers */ - pset_h retries ; /* table of servers to retry */ - pset_h services ; /* table of services */ -diff -Nurp xinetd-2.3.14-orig/xinetd/tcpint.c xinetd-2.3.14-poll/xinetd/tcpint.c ---- xinetd-2.3.14-orig/xinetd/tcpint.c 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/tcpint.c 2009-09-02 16:49:32.000000000 +0200 -@@ -63,7 +63,15 @@ struct intercept_s *si_init( struct serv - return( ip ) ; - } - -+#ifdef HAVE_POLL -+static status_e handle_io( psi_h iter, channel_s *chp, -+ struct pollfd *pfd_handled, -+ struct pollfd *pfd_array, -+ int *pfds_last, -+ stream_status_e (*iofunc)() ); -+#else - static status_e handle_io( psi_h iter, channel_s *chp, fd_set *maskp, stream_status_e (*iofunc)() ); -+#endif - static stream_status_e tcp_local_to_remote( channel_s *chp ); - static stream_status_e tcp_remote_to_local( channel_s *chp ); - static void connection_request( struct intercept_s *ip, channel_s **chpp ); -@@ -82,14 +90,26 @@ void si_exit(void) - static void si_mux(void) - { - struct intercept_s *ip = &stream_intercept_state ; -+#ifdef HAVE_POLL -+ struct pollfd *pfd_array; -+ int pfds_last = 0; -+ int pfds_allocated = INIT_POLLFDS; -+#else - fd_set socket_mask ; - int mask_max ; -+#endif - psi_h iter ; - const char *func = "si_mux" ; - -+#ifdef HAVE_POLL -+ pfd_array = calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ pfd_array[ pfds_last ].fd = INT_REMOTE( ip ) ; -+ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; -+#else - FD_ZERO( &socket_mask ) ; - FD_SET( INT_REMOTE( ip ), &socket_mask ) ; - mask_max = INT_REMOTE( ip ) ; -+#endif - - iter = psi_create( INT_CONNECTIONS( ip ) ) ; - if ( iter == NULL ) -@@ -101,26 +121,43 @@ static void si_mux(void) - for ( ;; ) - { - channel_s *chp ; -+#ifndef HAVE_POLL - fd_set read_mask ; -+#endif - int n_ready ; - -+#ifdef HAVE_POLL -+ n_ready = int_poll( pfds_last, pfd_array ) ; -+#else - read_mask = socket_mask ; - n_ready = int_select( mask_max+1, &read_mask ) ; -+#endif - - if ( n_ready == -1 ) - return ; - -+#ifdef HAVE_POLL -+ if ( pfd_array[0].revents & ( POLLIN | POLLOUT ) ) -+#else - if ( FD_ISSET( INT_REMOTE( ip ), &read_mask ) ) -+#endif - { - connection_request( ip, &chp ) ; - if ( chp != NULL ) - { -+#ifdef HAVE_POLL -+ pfd_array[ pfds_last ].fd = chp->ch_local_socket ; -+ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; -+ pfd_array[ pfds_last ].fd = chp->ch_remote_socket ; -+ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; -+#else - FD_SET( chp->ch_local_socket, &socket_mask ) ; - if ( chp->ch_local_socket > mask_max ) - mask_max = chp->ch_local_socket ; - FD_SET( chp->ch_remote_socket, &socket_mask ) ; - if ( chp->ch_remote_socket > mask_max ) - mask_max = chp->ch_remote_socket ; -+#endif - } - if ( --n_ready == 0 ) - continue ; -@@ -128,27 +165,57 @@ static void si_mux(void) - - for ( chp = CHP( psi_start(iter) ) ; chp ; chp = CHP( psi_next(iter) ) ) - { -+#ifdef HAVE_POLL -+ int i; -+ struct pollfd *local_pfd = NULL, *remote_pfd = NULL; -+ -+ /* TODO: detection with O(n)=1 */ -+ for (i = 0 ; i < pfds_last ; i++ ) -+ if (pfd_array[i].fd == chp->ch_local_socket) -+ local_pfd = &pfd_array[i]; -+ else if (pfd_array[i] .fd== chp->ch_remote_socket) -+ remote_pfd = &pfd_array[i]; -+ -+ if ( local_pfd != NULL && -+ local_pfd->revents & ( POLLIN | POLLOUT) ) -+#else - if ( FD_ISSET( chp->ch_local_socket, &read_mask ) ) -+#endif - { - #ifdef DEBUG_TCPINT - if ( debug.on ) - msg( LOG_DEBUG, func, "Input available on local socket %d", - chp->ch_local_socket ) ; - #endif -+#ifdef HAVE_POLL -+ if ( handle_io( iter, chp, local_pfd, pfd_array, -+ &pfds_last, tcp_local_to_remote ) == FAILED ) -+#else - if ( handle_io( iter, chp, &socket_mask, tcp_local_to_remote ) == FAILED ) -+#endif - return ; - if ( --n_ready == 0 ) - break ; - } - -+#ifdef HAVE_POLL -+ if ( remote_pfd != NULL && -+ remote_pfd->revents & ( POLLIN | POLLOUT) ) -+#else - if ( FD_ISSET( chp->ch_remote_socket, &read_mask ) ) -+#endif - { - #ifdef DEBUG_TCPINT - msg( LOG_DEBUG, func, "Input available on remote socket %d", - chp->ch_remote_socket ) ; - #endif -+#ifdef HAVE_POLL -+ if ( handle_io( iter, chp, remote_pfd, pfd_array, -+ &pfds_last, tcp_local_to_remote ) == FAILED ) -+#else - if ( handle_io( iter, chp, - &socket_mask, tcp_remote_to_local ) == FAILED ) -+#endif - return ; - if ( --n_ready == 0 ) - break ; -@@ -158,10 +225,19 @@ static void si_mux(void) - } - - -+#ifdef HAVE_POLL -+static status_e handle_io( psi_h iter, -+ channel_s *chp, -+ struct pollfd *pfd_handled, -+ struct pollfd *pfd_array, -+ int *pfds_last, -+ stream_status_e (*iofunc)() ) -+#else - static status_e handle_io( psi_h iter, - channel_s *chp, - fd_set *maskp, - stream_status_e (*iofunc)() ) -+#endif - { - const char *func = "handle_io" ; - -@@ -178,8 +254,13 @@ static status_e handle_io( psi_h iter, - xaddrname( &chp->ch_from ), ntohs(xaddrport( &chp->ch_from )), - chp->ch_local_socket, chp->ch_remote_socket ) ; - -+#ifdef HAVE_POLL -+ if ( pfd_handled != NULL) -+ *pfd_handled = pfd_array[ --( *pfds_last ) ]; -+#else - FD_CLR( chp->ch_local_socket, maskp ) ; - FD_CLR( chp->ch_remote_socket, maskp ) ; -+#endif - (void) Sclose( chp->ch_remote_socket ) ; - (void) Sclose( chp->ch_local_socket ) ; - psi_remove( iter ) ; -diff -Nurp xinetd-2.3.14-orig/xinetd/udpint.c xinetd-2.3.14-poll/xinetd/udpint.c ---- xinetd-2.3.14-orig/xinetd/udpint.c 2009-07-27 13:27:59.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/udpint.c 2009-09-02 16:59:33.000000000 +0200 -@@ -15,6 +15,9 @@ - #include - #include - -+#ifdef HAVE_POLL -+#include -+#endif - #ifdef HAVE_SYS_SELECT_H - #include - #endif -@@ -97,34 +100,61 @@ void di_exit(void) - static void di_mux(void) - { - struct intercept_s *ip = &dgram_intercept_state ; -+#ifdef HAVE_POLL -+ struct pollfd *pfd_array; -+ int pfds_last = 0; -+ int pfds_allocated = INIT_POLLFDS; -+#else - fd_set socket_mask ; - int mask_max ; -+#endif - -+#ifdef HAVE_POLL -+ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ pfd_array[ pfds_last ].fd = INT_REMOTE( ip ); -+ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; -+#else - FD_ZERO( &socket_mask ) ; - FD_SET( INT_REMOTE( ip ), &socket_mask ) ; - mask_max = INT_REMOTE( ip ) ; -+#endif - - for ( ;; ) - { - unsigned u ; - channel_s *chp ; -+#ifndef HAVE_POLL - fd_set read_mask ; -+#endif - int n_ready ; - -+#ifdef HAVE_POLL -+ n_ready = int_poll( pfds_last, pfd_array ) ; -+#else - read_mask = socket_mask ; - n_ready = int_select( mask_max+1, &read_mask ) ; -+#endif - - if ( n_ready == -1 ) - return ; - -+#ifdef HAVE_POLL -+ if ( pfd_array[0].revents & ( POLLIN | POLLOUT ) ) -+#else - if ( FD_ISSET( INT_REMOTE( ip ), &read_mask ) ) -+#endif - { - udp_remote_to_local( ip, &chp ) ; - if ( chp != NULL ) - { -+#ifdef HAVE_POLL -+ pfd_array[ pfds_last ].fd = chp->ch_local_socket ; -+ pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT ; -+#else - FD_SET( chp->ch_local_socket, &socket_mask ) ; - if ( chp->ch_local_socket > mask_max ) - mask_max = chp->ch_local_socket ; -+#endif - } - if ( --n_ready == 0 ) - continue ; -@@ -134,7 +164,17 @@ static void di_mux(void) - { - chp = CHP( pset_pointer( INT_CONNECTIONS( ip ), u ) ) ; - -+#ifdef HAVE_POLL -+ int i; -+ /* TODO: detection with O(n)=1 */ -+ for (i = 0 ; i < pfds_last ; i++) -+ if (pfd_array[i].fd == chp->ch_local_socket) -+ break; -+ if (pfd_array[i].fd == chp->ch_local_socket && -+ (pfd_array[i].revents & ( POLLIN | POLLOUT ))) -+#else - if ( FD_ISSET( chp->ch_local_socket, &read_mask ) ) -+#endif - { - if ( udp_local_to_remote( chp ) == FAILED ) - return ; -diff -Nurp xinetd-2.3.14-orig/xinetd/xmdns.c xinetd-2.3.14-poll/xinetd/xmdns.c ---- xinetd-2.3.14-orig/xinetd/xmdns.c 2005-04-08 23:23:07.000000000 +0200 -+++ xinetd-2.3.14-poll/xinetd/xmdns.c 2009-09-02 17:01:54.000000000 +0200 -@@ -109,7 +109,26 @@ int xinetd_mdns_init(void) { - ps.rws.mdns_state = NULL; - return -1; - } -+#ifdef HAVE_POLL -+ if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) -+ { -+ ps.rws.pfds_allocated += INIT_POLLFDS; -+ struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, -+ ps.rws.pfds_allocated*sizeof(struct pollfd)); -+ if ( tmp == NULL ) -+ { -+ out_of_memory( func ); -+ return -1; -+ } -+ memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- -+ ps.rws.pfds_last)*sizeof(struct pollfd)); -+ ps.rws.pfd_array = tmp; -+ } -+ ps.rws.pfd_array[ ps.rws.pfds_last ].fd = sw_discovery_socket(*(sw_discovery *)ps.rws.mdns_state); -+ ps.rws.pfd_array[ ps.rws.pfds_last++ ].events = POLLIN; -+#else - FD_SET( sw_discovery_socket(*(sw_discovery *)ps.rws.mdns_state), &ps.rws.socket_mask ) ; -+#endif - return 0; - #endif - } -diff -Nurp xinetd-2.3.14-orig/xinetd/xpoll.h xinetd-2.3.14-poll/xinetd/xpoll.h ---- xinetd-2.3.14-orig/xinetd/xpoll.h 1970-01-01 01:00:00.000000000 +0100 -+++ xinetd-2.3.14-poll/xinetd/xpoll.h 2009-09-02 11:30:27.000000000 +0200 -@@ -0,0 +1,23 @@ -+/* -+ * (c) Copyright 2009 by Red Hat Inc. -+ * All rights reserved. The file named COPYRIGHT specifies the terms -+ * and conditions for redistribution. -+ */ -+#include "config.h" -+#ifdef HAVE_POLL -+#ifndef _X_POLL_H -+#define _X_POLL_H -+ -+#include -+#include "defs.h" -+ -+ -+/* Field accessor methods for pollfd in defined in poll.h */ -+#define POLLFD_FD( pfd ) ( (pfd)->fd ) -+#define POLLFD_EVENTS( pfd ) ( (pfd)->events ) -+#define POLLFD_REVENTS( pfd ) ( (pfd)->revents ) -+ -+/* TODO: write memory management stuff in xpoll.c if needed */ -+ -+#endif /* _X_POLL_H */ -+#endif /* HAVE_POLL */ diff --git a/xinetd-2.3.14-readable-debuginfo.patch b/xinetd-2.3.14-readable-debuginfo.patch deleted file mode 100644 index 174791b..0000000 --- a/xinetd-2.3.14-readable-debuginfo.patch +++ /dev/null @@ -1,77 +0,0 @@ -Generate debuginfo package with all include files readable. - -The support libraries would install their header files with 640 permissions, -which is not what we want. - -diff -up xinetd-2.3.14/libs/src/misc/Makefile.in.orig xinetd-2.3.14/libs/src/misc/Makefile.in ---- xinetd-2.3.14/libs/src/misc/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/misc/Makefile.in 2008-09-18 10:18:59.000000000 +0200 -@@ -49,7 +49,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a -diff -up xinetd-2.3.14/libs/src/portable/Makefile.in.orig xinetd-2.3.14/libs/src/portable/Makefile.in ---- xinetd-2.3.14/libs/src/portable/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/portable/Makefile.in 2008-09-18 10:19:09.000000000 +0200 -@@ -44,7 +44,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a -diff -up xinetd-2.3.14/libs/src/pset/Makefile.in.orig xinetd-2.3.14/libs/src/pset/Makefile.in ---- xinetd-2.3.14/libs/src/pset/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/pset/Makefile.in 2008-09-18 10:19:17.000000000 +0200 -@@ -41,7 +41,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a -diff -up xinetd-2.3.14/libs/src/sio/Makefile.in.orig xinetd-2.3.14/libs/src/sio/Makefile.in ---- xinetd-2.3.14/libs/src/sio/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/sio/Makefile.in 2008-09-18 10:19:25.000000000 +0200 -@@ -40,7 +40,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a -diff -up xinetd-2.3.14/libs/src/str/Makefile.in.orig xinetd-2.3.14/libs/src/str/Makefile.in ---- xinetd-2.3.14/libs/src/str/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/str/Makefile.in 2008-09-18 10:19:33.000000000 +0200 -@@ -51,7 +51,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a -diff -up xinetd-2.3.14/libs/src/xlog/Makefile.in.orig xinetd-2.3.14/libs/src/xlog/Makefile.in ---- xinetd-2.3.14/libs/src/xlog/Makefile.in.orig 2003-02-19 18:29:27.000000000 +0100 -+++ xinetd-2.3.14/libs/src/xlog/Makefile.in 2008-09-18 10:19:41.000000000 +0200 -@@ -46,7 +46,7 @@ CC_FLAGS = $(DEBUG) - CFLAGS = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) - - INSTALL = @INSTALL@ --FMODE = -m 640 # used by install -+FMODE = -m 644 # used by install - RANLIB = @RANLIB@ - - LIBNAME = lib$(NAME).a diff --git a/xinetd-2.3.14-realloc-remove.patch b/xinetd-2.3.14-realloc-remove.patch deleted file mode 100644 index 6fd1902..0000000 --- a/xinetd-2.3.14-realloc-remove.patch +++ /dev/null @@ -1,134 +0,0 @@ -diff -rup xinetd-2.3.14/xinetd/defs.h xinetd-2.3.14-mod/xinetd/defs.h ---- xinetd-2.3.14/xinetd/defs.h 2012-01-18 14:22:20.811100158 +0100 -+++ xinetd-2.3.14-mod/xinetd/defs.h 2012-01-18 13:32:46.000000000 +0100 -@@ -114,11 +114,7 @@ union xsockaddr { - * constants for limiting ps.rws.fd_list - */ - --#ifdef HAVE_POLL --#define INIT_POLLFDS 4096 --/* FIXME: not used */ --#define MAX_POLLFDS 16384 --#endif -+#define MAX_FDS 4096 - - /* - * When explicit values are given for enum's, that is because the structures -diff -rup xinetd-2.3.14/xinetd/init.c xinetd-2.3.14-mod/xinetd/init.c ---- xinetd-2.3.14/xinetd/init.c 2012-01-18 14:22:20.779100171 +0100 -+++ xinetd-2.3.14-mod/xinetd/init.c 2012-01-18 14:07:34.000000000 +0100 -@@ -151,7 +151,7 @@ static void set_fd_limit(void) - } - - if ( rl.rlim_max == RLIM_INFINITY ) -- rl.rlim_max = FD_SETSIZE; -+ rl.rlim_max = MAX_FDS; - - ps.ros.max_descriptors = rl.rlim_max ; - #else /* ! RLIMIT_NOFILE */ -@@ -283,12 +283,12 @@ static void init_rw_state( void ) - ps.rws.descriptors_free = ps.ros.max_descriptors - DESCRIPTORS_RESERVED ; - - #ifdef HAVE_POLL -- ps.rws.pfds_allocated = INIT_POLLFDS ; -+ ps.rws.pfds_allocated = ps.ros.max_descriptors ; - ps.rws.pfd_array = (struct pollfd *) - malloc( sizeof( struct pollfd ) * ps.rws.pfds_allocated ) ; - if ( ps.rws.pfd_array == NULL ) - { -- out_of_memory(func); -+ out_of_memory(func) ; - exit( 1 ) ; - } - ps.rws.pfds_last = 0 ; -diff -rup xinetd-2.3.14/xinetd/redirect.c xinetd-2.3.14-mod/xinetd/redirect.c ---- xinetd-2.3.14/xinetd/redirect.c 2012-01-18 14:22:20.780100170 +0100 -+++ xinetd-2.3.14-mod/xinetd/redirect.c 2012-01-18 12:22:08.000000000 +0100 -@@ -149,7 +149,7 @@ void redir_handler( struct server *serp - #ifdef HAVE_POLL - #define REDIR_DESCRIP_INDEX 0 - #define REDIR_SERVER_INDEX 1 -- pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),MAX_FDS); - if (pfd_array == NULL) - { - msg( LOG_ERR, func, "Cannot allocate memory for file descriptors!\n"); -diff -rup xinetd-2.3.14/xinetd/service.c xinetd-2.3.14-mod/xinetd/service.c ---- xinetd-2.3.14/xinetd/service.c 2012-01-18 14:22:20.812100157 +0100 -+++ xinetd-2.3.14-mod/xinetd/service.c 2012-01-18 14:07:27.000000000 +0100 -@@ -114,10 +114,6 @@ struct service *svc_make_special( struct - - void svc_free( struct service *sp ) - { --#ifdef HAVE_POLL -- *SVC_POLLFD( sp ) = ps.rws.pfd_array[--ps.rws.pfds_last] ; --#endif /* HAVE_POLL */ -- - sc_free( SVC_CONF(sp) ) ; - CLEAR( *sp ) ; - FREE_SVC( sp ) ; -@@ -332,20 +328,10 @@ status_e svc_activate( struct service *s - } - - #ifdef HAVE_POLL -- if ( ps.rws.pfds_last >= ps.rws.pfds_allocated ) -+ if ( ps.rws.descriptors_free <= 0 ) - { -- int pos; -- ps.rws.pfds_allocated += INIT_POLLFDS; -- struct pollfd *tmp = (struct pollfd *)realloc( ps.rws.pfd_array, -- ps.rws.pfds_allocated*sizeof(struct pollfd)); -- if ( tmp == NULL ) -- { -- out_of_memory( func ); -- return( FAILED ); -- } -- ps.rws.pfd_array = tmp; -- memset(&ps.rws.pfd_array[ps.rws.pfds_last], 0, (ps.rws.pfds_allocated- -- ps.rws.pfds_last)*sizeof(struct pollfd)); -+ msg(LOG_ERR, func, "Maximum number of services reached") ; -+ return( FAILED ) ; - } - if ( sp->svc_pfd_index >= 0 ) - { -diff -rup xinetd-2.3.14/xinetd/tcpint.c xinetd-2.3.14-mod/xinetd/tcpint.c ---- xinetd-2.3.14/xinetd/tcpint.c 2012-01-18 14:22:20.782100169 +0100 -+++ xinetd-2.3.14-mod/xinetd/tcpint.c 2012-01-18 13:30:22.000000000 +0100 -@@ -93,7 +93,7 @@ static void si_mux(void) - #ifdef HAVE_POLL - struct pollfd *pfd_array; - int pfds_last = 0; -- int pfds_allocated = INIT_POLLFDS; -+ int pfds_allocated = MAX_FDS; - #else - fd_set socket_mask ; - int mask_max ; -@@ -102,7 +102,7 @@ static void si_mux(void) - const char *func = "si_mux" ; - - #ifdef HAVE_POLL -- pfd_array = calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ pfd_array = calloc(sizeof(struct pollfd),MAX_FDS); - pfd_array[ pfds_last ].fd = INT_REMOTE( ip ) ; - pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; - #else -diff -rup xinetd-2.3.14/xinetd/udpint.c xinetd-2.3.14-mod/xinetd/udpint.c ---- xinetd-2.3.14/xinetd/udpint.c 2012-01-18 14:22:20.783100169 +0100 -+++ xinetd-2.3.14-mod/xinetd/udpint.c 2012-01-18 12:22:00.000000000 +0100 -@@ -103,14 +103,14 @@ static void di_mux(void) - #ifdef HAVE_POLL - struct pollfd *pfd_array; - int pfds_last = 0; -- int pfds_allocated = INIT_POLLFDS; -+ int pfds_allocated = MAX_FDS; - #else - fd_set socket_mask ; - int mask_max ; - #endif - - #ifdef HAVE_POLL -- pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),INIT_POLLFDS); -+ pfd_array = (struct pollfd *)calloc(sizeof(struct pollfd),MAX_FDS); - pfd_array[ pfds_last ].fd = INT_REMOTE( ip ); - pfd_array[ pfds_last++ ].events = POLLIN | POLLOUT; - #else diff --git a/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch b/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch deleted file mode 100644 index 7ff5c0b..0000000 --- a/xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -Napur xinetd-2.3.14.old/xinetd/access.c xinetd-2.3.14.new/xinetd/access.c ---- xinetd-2.3.14.old/xinetd/access.c 2005-10-05 10:15:33.000000000 -0700 -+++ xinetd-2.3.14.new/xinetd/access.c 2012-02-22 20:12:09.120973124 -0800 -@@ -89,9 +89,20 @@ static void cps_service_restart(void) - msg(LOG_ERR, func, - "Activating service %s", SC_NAME(scp)); - } else { -- msg(LOG_ERR, func, -- "Error activating service %s", -- SC_NAME(scp)) ; -+ /* Try to restart the service */ -+ SVC_ATTEMPTS(sp) += 1; -+ if ( SVC_ATTEMPTS(sp) < MAX_SVC_ATTEMPTS ) { -+ msg(LOG_ERR, func, -+ "Error activating service %s, retrying %d more time(s)...", -+ SC_NAME(scp), -+ MAX_SVC_ATTEMPTS - SVC_ATTEMPTS(sp)); -+ xtimer_add(cps_service_restart, 1); -+ } else { -+ /* Give up */ -+ msg(LOG_ERR, func, -+ "Error activating service %s", -+ SC_NAME(scp)); -+ } - } /* else */ - } - } -diff -Napur xinetd-2.3.14.old/xinetd/service.c xinetd-2.3.14.new/xinetd/service.c ---- xinetd-2.3.14.old/xinetd/service.c 2012-02-22 19:16:56.288912783 -0800 -+++ xinetd-2.3.14.new/xinetd/service.c 2012-02-22 19:25:03.059356909 -0800 -@@ -397,6 +408,7 @@ status_e svc_activate( struct service *s - * Initialize the service data - */ - SVC_RUNNING_SERVERS(sp) = SVC_RETRIES(sp) = 0 ; -+ SVC_ATTEMPTS(sp) = 0; - - if ( SC_MUST_LISTEN( scp ) ) - (void) listen( SVC_FD(sp), LISTEN_BACKLOG ) ; -diff -Napur xinetd-2.3.14.old/xinetd/xconfig.h xinetd-2.3.14.new/xinetd/xconfig.h ---- xinetd-2.3.14.old/xinetd/xconfig.h 2003-02-19 09:29:28.000000000 -0800 -+++ xinetd-2.3.14.new/xinetd/xconfig.h 2012-02-22 19:20:20.360855514 -0800 -@@ -59,6 +59,12 @@ - #define DEFAULT_LOOP_TIME 10 - - /* -+ * The number of times to attempt re-activating a service after being -+ * deactivated due to the above. -+ */ -+#define MAX_SVC_ATTEMPTS 30 -+ -+/* - * Signal-to-action mapping - */ - #ifndef RECONFIG_HARD_SIG diff --git a/xinetd-2.3.14-rpc-specific-port.patch b/xinetd-2.3.14-rpc-specific-port.patch deleted file mode 100644 index 19376fd..0000000 --- a/xinetd-2.3.14-rpc-specific-port.patch +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index 18fd1a1..0000000 --- a/xinetd-2.3.14-signal-log-hang.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- 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-2.3.14-tcpmux.patch b/xinetd-2.3.14-tcpmux.patch deleted file mode 100644 index dd93a67..0000000 --- a/xinetd-2.3.14-tcpmux.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- xinetd-2.3.14/xinetd/service.c.tcpmux 2010-01-21 09:50:05.000000000 +0100 -+++ xinetd-2.3.14/xinetd/service.c 2010-01-21 10:21:14.000000000 +0100 -@@ -952,7 +952,12 @@ void close_all_svc_descriptors(void) - out_of_memory( "close_all_svc_descriptors" ) ; - - for ( osp = SP( psi_start( iter ) ) ; osp ; osp = SP( psi_next( iter ) ) ) -- (void) Sclose( SVC_FD( osp ) ) ; -+ { -+#ifdef HAVE_POLL -+ if ( osp && SVC_POLLFD( osp ) ) -+#endif -+ (void) Sclose( SVC_FD( osp ) ) ; -+ } - - psi_destroy( iter ) ; - } diff --git a/xinetd-2.3.14-udp-reconfig.patch b/xinetd-2.3.14-udp-reconfig.patch deleted file mode 100644 index 07e733e..0000000 --- a/xinetd-2.3.14-udp-reconfig.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- 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-2.3.15-PIE.patch b/xinetd-2.3.15-PIE.patch deleted file mode 100644 index d601949..0000000 --- a/xinetd-2.3.15-PIE.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xinetd-2.3.15/Makefile.in 2012-05-14 09:22:22.661617117 +0200 -+++ xinetd-2.3.15.new/Makefile.in 2012-05-14 09:32:05.260103054 +0200 -@@ -14,7 +14,7 @@ topdir = @top_srcdir@ - - LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ - --CFLAGS += @CFLAGS@ -+CFLAGS += @CFLAGS@ -fPIE - DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wno-unused -g - - ---- xinetd-2.3.15/xinetd/Makefile.in 2005-03-31 01:15:28.000000000 +0200 -+++ xinetd-2.3.15.new/xinetd/Makefile.in 2012-05-14 09:32:24.183659971 +0200 -@@ -119,7 +119,7 @@ itox: itox.c - $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) - - xinetd: $(OBJS) -- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ -+ $(CC) $(CFLAGS) $(DEBUG) -o $@ -PIE $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ - - clean: - rm -f $(OBJS) $(NAME) core itox diff --git a/xinetd-2.3.15-bad-port-check.patch b/xinetd-2.3.15-bad-port-check.patch deleted file mode 100644 index 7849a96..0000000 --- a/xinetd-2.3.15-bad-port-check.patch +++ /dev/null @@ -1,106 +0,0 @@ -Re-introduce bad_port_check(), which upstream dropped between 2.3.13 and 2.3.14 -for it having been "rather antiquated for years", with no justification given -for that claim. - ---- xinetd-2.3.15/xinetd/builtins.c 2012-05-09 17:40:29.000000000 +0200 -+++ xinetd-2.3.15.new/xinetd/builtins.c 2012-05-14 10:25:00.431529805 +0200 -@@ -52,6 +52,7 @@ static void dgram_daytime(const struct s - static void stream_chargen(const struct server *) ; - static void dgram_chargen(const struct server *) ; - static void tcpmux_handler(const struct server *) ; -+static int bad_port_check(const union xsockaddr *, const char *); - - /* - * SG - This is the call sequence to get to a built-in service -@@ -163,6 +164,25 @@ static void stream_echo( const struct se - Sclose(descriptor); - } - -+/* For internal UDP services, make sure we don't respond to our ports -+ * on other servers and to low ports of other services (such as DNS). -+ * This can cause looping. -+ */ -+static int bad_port_check( const union xsockaddr *sa, const char *func ) -+{ -+ uint16_t port = 0; -+ -+ port = ntohs( xaddrport( sa ) ); -+ -+ if ( port < 1024 ) { -+ msg(LOG_WARNING, func, -+ "Possible Denial of Service attack from %s %d", xaddrname(sa), port); -+ return (-1); -+ } -+ -+ return (0); -+} -+ - static void dgram_echo( const struct server *serp ) - { - char buf[ DATAGRAM_SIZE ] ; -@@ -170,6 +190,7 @@ static void dgram_echo( const struct ser - ssize_t cc ; - socklen_t sin_len = 0; - int descriptor = SERVER_FD( serp ) ; -+ const char *func = "dgram_echo" ; - - if( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); -@@ -178,6 +199,7 @@ static void dgram_echo( const struct ser - - cc = recvfrom( descriptor, buf, sizeof( buf ), 0, (struct sockaddr *)( &lsin ), &sin_len ) ; - if ( cc != (ssize_t)-1 ) { -+ if( bad_port_check(&lsin, func) != 0 ) return; - (void) sendto( descriptor, buf, (size_t)cc, 0, SA( &lsin ), sizeof( lsin ) ) ; - } - } -@@ -292,6 +314,7 @@ static void dgram_daytime( const struct - unsigned int buflen = sizeof( time_buf ) ; - int descriptor = SERVER_FD( serp ) ; - ssize_t val; -+ const char *func = "dgram_daytime" ; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); -@@ -303,6 +326,8 @@ static void dgram_daytime( const struct - if ( val == (ssize_t)-1 ) - return ; - -+ if( bad_port_check(&lsin, func) != 0 ) return; -+ - daytime_protocol( time_buf, &buflen ) ; - - (void) sendto( descriptor, time_buf, buflen, 0, SA(&lsin), sizeof( lsin ) ) ; -@@ -359,6 +384,7 @@ static void dgram_time( const struct ser - socklen_t sin_len = 0 ; - int fd = SERVER_FD( serp ) ; - ssize_t val; -+ const char *func = "dgram_time" ; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); -@@ -368,6 +394,7 @@ static void dgram_time( const struct ser - val = recvfrom( fd, buf, sizeof( buf ), 0, (struct sockaddr *)( &lsin ), &sin_len ); - if ( val == (ssize_t)-1 ) - return ; -+ if( bad_port_check(&lsin, func) != 0 ) return; - - time_protocol( time_buf ) ; - (void) sendto( fd, (char *) time_buf, 4, 0, SA( &lsin ), sin_len ) ; -@@ -466,6 +493,7 @@ static void dgram_chargen( const struct - int fd = SERVER_FD( serp ) ; - unsigned int left = sizeof( buf ) ; - ssize_t val; -+ const char *func = "dgram_chargen" ; - - if ( SC_IPV4( SVC_CONF( SERVER_SERVICE( serp ) ) ) ) - sin_len = sizeof( struct sockaddr_in ); -@@ -480,6 +508,8 @@ static void dgram_chargen( const struct - bad_variable = 1 ; /* this will cause a compilation error */ - #endif - -+ if( bad_port_check(&lsin, func) != 0 ) return; -+ - for ( p = buf ; left > 2 ; left -= len, p += len ) - { - len = min( LINE_LENGTH+2, left ) ; diff --git a/xinetd-2.3.15-context-exepath.patch b/xinetd-2.3.15-context-exepath.patch deleted file mode 100644 index 1ecc432..0000000 --- a/xinetd-2.3.15-context-exepath.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xinetd-2.3.15/xinetd/child.c 2013-06-25 14:12:24.599767760 +0200 -+++ xinetd-2.3.15/xinetd/child.c.new 2013-06-25 14:14:57.463905500 +0200 -@@ -532,7 +532,7 @@ static int set_context_from_socket( cons - if (getpeercon(fd, &peer_context) < 0) - goto fail; - -- exepath = SC_SERVER_ARGV( scp )[0]; -+ exepath = SC_SERVER( scp ); - if (getfilecon(exepath, &exec_context) < 0) - goto fail; - diff --git a/xinetd-2.3.15-creds.patch b/xinetd-2.3.15-creds.patch deleted file mode 100644 index a9f1db9..0000000 --- a/xinetd-2.3.15-creds.patch +++ /dev/null @@ -1,15 +0,0 @@ -Patch by Thomas Swan - -diff --git a/xinetd/builtins.c b/xinetd/builtins.c -index e61502f..a414cf3 100644 ---- a/xinetd/builtins.c -+++ b/xinetd/builtins.c -@@ -695,7 +695,7 @@ static void tcpmux_handler( const struct server *serp ) - if( SC_IS_INTERNAL( scp ) ) { - SC_INTERNAL(scp, nserp); - } else { -- exec_server(nserp); -+ child_process(nserp); - } - } - diff --git a/xinetd-2.3.15-pie.patch b/xinetd-2.3.15-pie.patch deleted file mode 100644 index 255a10a..0000000 --- a/xinetd-2.3.15-pie.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xinetd-2.3.15/Makefile.in 2012-05-14 09:22:22.661617117 +0200 -+++ xinetd-2.3.15.new/Makefile.in 2012-05-14 09:32:05.260103054 +0200 -@@ -14,7 +14,7 @@ topdir = @top_srcdir@ - - LIBS = -lsio -lstr -lmisc -lxlog -lportable -lpset @LIBS@ - --CFLAGS += @CFLAGS@ -+CFLAGS += @CFLAGS@ -fpie - DCFLAGS = -Wall -Wredundant-decls -W -Wfloat-equal -Wundef -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wno-unused -g - - ---- xinetd-2.3.15/xinetd/Makefile.in 2005-03-31 01:15:28.000000000 +0200 -+++ xinetd-2.3.15.new/xinetd/Makefile.in 2012-05-14 09:32:24.183659971 +0200 -@@ -119,7 +119,7 @@ itox: itox.c - $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS) - - xinetd: $(OBJS) -- $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ -+ $(CC) $(CFLAGS) $(DEBUG) -o $@ -pie $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@ - - clean: - rm -f $(OBJS) $(NAME) core itox diff --git a/xinetd-2.3.15-remove-deprecated-flask.h.patch b/xinetd-2.3.15-remove-deprecated-flask.h.patch deleted file mode 100644 index 1cb4e54..0000000 --- a/xinetd-2.3.15-remove-deprecated-flask.h.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up xinetd-2.3.15/xinetd/child.c.remove-flaskh xinetd-2.3.15/xinetd/child.c ---- xinetd-2.3.15/xinetd/child.c.remove-flaskh 2020-04-07 12:28:52.538123162 +0200 -+++ xinetd-2.3.15/xinetd/child.c 2020-04-07 12:28:58.980980069 +0200 -@@ -33,7 +33,6 @@ - #endif - #ifdef LABELED_NET - #include --#include - #include - #endif - -@@ -551,7 +550,7 @@ static int set_context_from_socket( cons - if (!(new_context = context_str(bcon))) - goto fail; - -- if (security_compute_create(new_context, exec_context, SECCLASS_PROCESS, -+ if (security_compute_create(new_context, exec_context, string_to_security_class("process"), - &new_exec_context) < 0) - goto fail; - diff --git a/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch b/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch deleted file mode 100644 index a42bd84..0000000 --- a/xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch +++ /dev/null @@ -1,50 +0,0 @@ -Xinetd parses and applies its configuration line by line. If a user wants to -specify NAMEINARGS as a flag, it has to be *before* specifying 'server_args'. - -Author: Jan Synacek -Resolves: #1033528 - ---- a/xinetd/parse.c 2013-11-21 10:51:25.025436376 +0100 -+++ b/xinetd/parse.c 2013-11-21 14:45:44.374121057 +0100 -@@ -633,7 +633,28 @@ static status_e identify_attribute( entr - - if ( (*ap->a_parser)( attr_values, scp, op ) == OK ) - { /* This is the normal path. */ -- SC_SPECIFY( scp, ap->a_id ) ; -+ /* If flags contain NAMEINARGS and server_args is already set, disable the service. -+ Server args are already set incorrectly. */ -+ if ( strcmp( ap->a_name, "flags" ) == 0 && -+ SC_SERVER_ARGV( scp ) ) -+ { -+ int i = 0, n = pset_count( attr_values ) ; -+ for ( ; i < n ; i++ ) { -+ char *v = (char *)pset_pointer( attr_values, i ) ; -+ if ( strcmp( v, "NAMEINARGS" ) == 0 ) -+ break ; -+ } -+ -+ if ( i != n ) { -+ parsemsg( LOG_ERR, func, -+ "NAMEINARGS flag is set after server_args - DISABLING SERVICE" ) ; -+ SC_DISABLE( scp ) ; -+ } -+ } -+ else -+ { -+ SC_SPECIFY( scp, ap->a_id ) ; -+ } - } - else if ( entry_type == SERVICE_ENTRY ) - { ---- a/xinetd/xinetd.conf.man 2013-12-03 10:06:35.717977075 +0100 -+++ b/xinetd/xinetd.conf.man 2013-12-03 10:41:14.779089430 +0100 -@@ -106,7 +106,8 @@ - This will cause the first argument in "server_args" to be argv[0] when - executing the server, as specified in "server". This allows you to use - tcpd by putting tcpd in "server" and the name of the server in "server_args" --like in normal inetd. -+like in normal inetd. This flag has to be specified before "server_args", -+otherwise is not taken into account. - .TP - .B NODELAY - If the service is a tcp service and the NODELAY flag is set, then the diff --git a/xinetd-2.3.15-udp-wait.patch b/xinetd-2.3.15-udp-wait.patch deleted file mode 100644 index 44a615c..0000000 --- a/xinetd-2.3.15-udp-wait.patch +++ /dev/null @@ -1,37 +0,0 @@ -Resolves: #1567239 - ---- a/xinetd/confparse.c 2018-05-04 11:00:11.019748833 +0200 -+++ b/xinetd/confparse.c 2018-05-04 11:49:26.519996478 +0200 -@@ -860,6 +860,14 @@ static status_e check_entry( struct serv - } - } - -+ if ( SC_SOCKET_TYPE(scp) == SOCK_DGRAM && !SC_WAITS(scp) ) -+ { -+ msg( LOG_ERR, func, -+ "Service %s has socket_type dgram, but does not wait", -+ SC_NAME(scp) ); -+ return FAILED; -+ } -+ - if ( service_attr_check( scp ) == FAILED ) - return( FAILED ) ; - ---- a/xinetd/main.c 2018-05-04 10:02:11.999315632 +0200 -+++ b/xinetd/main.c 2018-05-04 10:03:44.124500979 +0200 -@@ -296,6 +296,7 @@ static void find_bad_fd(void) - SVC_ID( sp ) ) ; - svc_deactivate( sp ) ; - found = TRUE ; -+ bad_fd_count++ ; - break ; - } - } -@@ -303,6 +304,7 @@ static void find_bad_fd(void) - { - #ifdef HAVE_POLL - ps.rws.pfd_array[fd].events = 0; -+ ps.rws.pfd_array[fd].fd = -1; - #else - FD_CLR( fd, &ps.rws.socket_mask ) ; - #endif diff --git a/xinetd.service b/xinetd.service deleted file mode 100644 index abf097d..0000000 --- a/xinetd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Xinetd A Powerful Replacement For Inetd -After=syslog.target network.target -Documentation=man:xinetd -Documentation=man:xinetd.conf -Documentation=man:xinetd.log - -[Service] -Type=forking -PIDFile=/var/run/xinetd.pid -ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid -ExecReload=/usr/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target - diff --git a/xinetd.spec b/xinetd.spec deleted file mode 100644 index 9f0da5d..0000000 --- a/xinetd.spec +++ /dev/null @@ -1,485 +0,0 @@ -Summary: A secure replacement for inetd -Name: xinetd -Version: 2.3.15 -Release: 34%{?dist} -License: xinetd -Epoch: 2 -URL: https://github.com/xinetd-org/xinetd -# source can be downloaded at -# https://github.com/xinetd-org/xinetd/archive/xinetd-2-3-15.tar.gz -Source: xinetd-%{version}.tar.gz -Source1: xinetd.service -Patch0: xinetd-2.3.15-pie.patch -Patch4: xinetd-2.3.14-bind-ipv6.patch -Patch6: xinetd-2.3.14-man-section.patch -Patch7: xinetd-2.3.15-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 -# This fixes bug #593904 - online reconfiguration caused log message -# flood when turning off UDP service -Patch16: xinetd-2.3.14-udp-reconfig.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 -# Fix leaking file descriptors and pfd_array wasting -# This fixes #702670 -Patch21: xinetd-2.3.14-leaking-fds.patch -# Fix memory corruption when loading a large number of services -# This fixes #720390 -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-2a.patch -# Fix #770858 - Instances limit in xinetd can be easily bypassed -Patch25: xinetd-2.3.14-instances.patch -# Fix #809272 - Service disabled due to bind failure -Patch26: xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch -Patch27: xinetd-2.3.15-bad-port-check.patch -# Fix #977873 - Use full path to server when checking selinux context -Patch28: xinetd-2.3.15-context-exepath.patch -Patch29: xinetd-2.3.15-creds.patch -# Fix #1033528 - xinetd segfaults when connecting to tcpmux service -Patch30: xinetd-2.3.15-tcpmux-nameinargs-disable-service.patch -Patch31: xinetd-2.3.15-udp-wait.patch -Patch32: xinetd-2.3.15-remove-deprecated-flask.h.patch - -BuildRequires: gcc -BuildRequires: autoconf, automake, libtirpc-devel -BuildRequires: libselinux-devel >= 1.30 -BuildRequires: systemd-units -Requires(post): systemd-sysv -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -Requires: filesystem >= 2.0.1, setup -Provides: inetd - - -%description -Xinetd is a secure replacement for inetd, the Internet services -daemon. Xinetd provides access control for all services based on the -address of the remote host and/or on time of access and can prevent -denial-of-access attacks. Xinetd provides extensive logging, has no -limit on the number of server arguments, and lets you bind specific -services to specific IP addresses on your host machine. Each service -has its own specific configuration file for Xinetd; the files are -located in the /etc/xinetd.d directory. - -%prep -%setup -q - -# SPARC/SPARC64 needs -fPIE/-PIE -# This really should be detected by configure. -%ifarch sparcv9 sparc64 -%patch7 -p1 -b .PIE -%else -%patch0 -p1 -b .pie -%endif -%patch4 -p1 -b .bind -%patch6 -p1 -b .man-section -%patch8 -p1 -b .ident-bind -%patch9 -p1 -b .readable-debuginfo -%patch10 -p1 -b .autoconf -%patch11 -p1 -b .poll -%patch12 -p1 -b .file-limit -%patch13 -p1 -b .tcpmux -%patch14 -p1 -b .clean-pfd -%patch15 -p1 -b .ipv6confusion -%patch16 -p1 -b .udp-reconfig -%patch18 -p1 -b .rpc-specific-port -%patch19 -p1 -b .signal-log-hang -%patch20 -p1 -b .fix-type-punned-ptr -%patch21 -p1 -b .leaking-fds -%patch22 -p1 -b .many-services -%patch23 -p1 -b .realloc-remove -%patch24 -p1 -b .leaking-fds-2a -%patch25 -p1 -b .instances -%patch26 -p1 -b .retry-svc-activate -%patch27 -p1 -b .bad-port-check -%patch28 -p1 -b .context-exepath -%patch29 -p1 -b .creds -%patch30 -p1 -%patch31 -p1 -%patch32 -p1 -b .drop-flaskh - -aclocal -autoconf - -%build -# -pie -PIE flags added by separate patches -%configure --with-loadavg --with-inet6 --with-labeled-networking -make CFLAGS="$CFLAGS $(pkg-config --cflags libtirpc)" LDFLAGS="$LDFLAGS $(pkg-config --libs libtirpc) -Wl,-z,relro,-z,now" - -%install -mkdir -p $RPM_BUILD_ROOT%{_unitdir} -mkdir -m 700 -p $RPM_BUILD_ROOT/etc/xinetd.d/ -# Remove unneeded service -rm -f contrib/xinetd.d/ftp-sensor -%make_install DAEMONDIR=$RPM_BUILD_ROOT/usr/sbin MANDIR=$RPM_BUILD_ROOT/%{_mandir} -install -m 600 contrib/xinetd.conf $RPM_BUILD_ROOT/etc -install -m 600 contrib/xinetd.d/* $RPM_BUILD_ROOT/etc/xinetd.d -install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} - -rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox* -rm -f $RPM_BUILD_ROOT/usr/sbin/itox -rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/xconv.pl* -rm -f $RPM_BUILD_ROOT/usr/sbin/xconv.pl - -%post -%systemd_post xinetd.service - -%preun -%systemd_preun xinetd.service - -%postun -%systemd_postun_with_restart xinetd.service - -%files -%doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf -%config(noreplace) /etc/xinetd.conf -%{_unitdir}/xinetd.service -%dir /etc/xinetd.d/ -%config(noreplace) /etc/xinetd.d/* -/usr/sbin/xinetd -%{_mandir}/*/* - -%changelog -* Sat Aug 01 2020 Fedora Release Engineering - 2:2.3.15-34 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 2:2.3.15-33 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Apr 7 2020 Petr Lautrbach - 2:2.3.15-32 -- Remove deprecation warning about flask.h usage - -* Fri Jan 31 2020 Fedora Release Engineering - 2:2.3.15-31 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Jul 27 2019 Fedora Release Engineering - 2:2.3.15-30 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Mar 20 2019 Peter Robinson 2:2.3.15-29 -- Own the xinetd.d config directory - -* Sun Feb 03 2019 Fedora Release Engineering - 2:2.3.15-28 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sat Jul 14 2018 Fedora Release Engineering - 2:2.3.15-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 5 2018 Jan Synáček - 2:2.3.15-26 -- fix xinetd infinite busy loop when datagram service has wait=yes (#1567239) - -* Thu Mar 15 2018 Jan Synáček - 2:2.3.15-25 -- fix compilation, missing rpc headers (#1556550) - -* Fri Feb 09 2018 Fedora Release Engineering - 2:2.3.15-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Jan 20 2018 Björn Esser - 2:2.3.15-23 -- Rebuilt for switch to libxcrypt - -* Mon Dec 4 2017 Jan Synáček - 2:2.3.15-22 -- remove build dependency on tcp_wrappers (#1518797) - -* Tue Nov 07 2017 Igor Gnatenko - 2:2.3.15-21 -- Remove old crufty coreutils requires - -* Thu Aug 03 2017 Fedora Release Engineering - 2:2.3.15-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 2:2.3.15-19 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 2:2.3.15-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Fri Feb 05 2016 Fedora Release Engineering - 2:2.3.15-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Jun 19 2015 Fedora Release Engineering - 2:2.3.15-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Mon Aug 18 2014 Fedora Release Engineering - 2:2.3.15-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sun Jun 08 2014 Fedora Release Engineering - 2:2.3.15-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Mon Feb 24 2014 Jan Synáček - 2:2.3.15-13 -- drop sysconfig-related stuff -- add documentation reference to the service file - -* Tue Jan 14 2014 Jan Synáček - 2:2.3.15-12 -- fix bad URL - -* Fri Dec 13 2013 Jan Synáček - 2:2.3.15-11 -- fixup of the previous patch -- Resolves: #1042652 -- Related: #1033528 - -* Tue Dec 3 2013 Jan Synáček - 2:2.3.15-10 -- xinetd segfaults when connecting to tcpmux service -- Resolves: #1033528 - -* Fri Oct 4 2013 Jan Synáček - 2:2.3.15-9 -- xinetd should not depend on NetworkManager-wait-online -- Resolves: #1002294 - -* Thu Oct 3 2013 Jan Synáček - 2:2.3.15-8 -- Honor user and group directives -- Resolves: CVE-2013-4342 - -* Sun Aug 04 2013 Fedora Release Engineering - 2:2.3.15-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Wed Jun 26 2013 Jan Synáček - 2:2.3.15-6 -- Use full path to server when checking selinux context -- Resolves: #977873 - -* Fri Feb 15 2013 Fedora Release Engineering - 2:2.3.15-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Mon Sep 03 2012 Jan Synáček - 2:2.3.15-4 -- Change config files' permissions -- Resolves: #853144 - -* Wed Aug 22 2012 Jan Synáček - 2:2.3.15-3 -- Replace the makeinstall macro -- Add systemd-rpm macros -- Resolves: #850370 - -* Sun Jul 22 2012 Fedora Release Engineering - 2:2.3.15-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Mon May 14 2012 Jan Synáček - 2:2.3.15-1 -- Update to 2.3.15 -- Drop patches merged by upstream - (-log-crash, -tcp_rpc, -label, -contextconf, -ssize_t) -- Update -pie, -PIE, -poll patch -- Resolves: #820927 -- Add -bad-port-check patch - -* Fri Apr 13 2012 Jan Synáček - 2:2.3.14-46 -- Fix: service file: avoid problems when name resolution is not ready -- Resolves: #748931 - -* Fri Apr 13 2012 Jan Synáček - 2:2.3.14-45 -- Fix: Service disabled due to bind failure -- Update patch: xinetd-2.3.14-leaking-fds-2.patch -- Resolves: #809272 - -* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-44 -- Fix: Instances limit in xinetd can be easily bypassed -- Resolves: #770858 - -* Mon Mar 05 2012 Jan Synáček - 2:2.3.14-43 -- Fix xinetd.service permissions -- Remove useless INSTALL from package documentation -- Implement reload in xinetd.service - -* Fri Mar 02 2012 Jan Synáček - 2:2.3.14-42 -- Fix leaking descriptor when starting a service fails (#795188) - -* Wed Jan 18 2012 Jan Synáček - 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) -- Add patch -realloc-remove - -* Tue Jan 17 2012 Jan Synáček - 2:2.3.14-40 -- Fix memory corruption when loading a large number of services -- Resolves #720390 - -* Mon Jan 16 2012 Jan Synáček - 2:2.3.14-39 -- Fix leaking file descriptors -- Resolves: #702670 - -* Sat Jan 14 2012 Fedora Release Engineering - 2:2.3.14-38 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Mon Sep 12 2011 Tom Callaway - 2:2.3.14-37 -- covert to systemd - -* Thu Apr 21 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-36 -- 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-35 -- fix crash when application's logfile hit size limit - Related: #244063 - -* Mon Feb 14 2011 Vojtech Vitek (V-Teq) - 2:2.3.14-34 -- Add -Wl,-z,relro,-z,now to LDFLAGS - -* Mon Feb 07 2011 Fedora Release Engineering - 2:2.3.14-33 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* 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 - -* 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) - -* Tue Oct 20 2009 Jan Zeleny - 2:2.3.14-27 -- last update of init script modified to work with SELinux correctly -- added support for new configuration option - file limit for service - -* Mon Oct 12 2009 Jan Zeleny - 2:2.3.14-26 -- updated init script (LSB compliance - #528154) - -* Thu Sep 17 2009 Jan Zeleny - 2:2.3.14-25 -- correction of last patch replacing select() with poll() - -* Mon Sep 14 2009 Jan Zeleny - 2:2.3.14-24 -- select() function and it's supporting macros replaced by poll() and it's supporting macros -- added patch of configure.in for clean compilation - -* Mon Jul 27 2009 Fedora Release Engineering - 2:2.3.14-23 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Thu Feb 26 2009 Fedora Release Engineering - 2:2.3.14-22 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Sep 18 2008 Jan Safranek - 2:2.3.14-21 -- fix glitches found during package review (#226560) -- make all files in .debuginfo package readable by everyone - -* Wed Jul 16 2008 Jan Safranek - 2:2.3.14-20 -- fix wrong bind() call (#448069) - -* Thu May 29 2008 Tom "spot" Callaway - 2:2.3.14-19 -- fix sparc fPIE issues - -* Thu Jan 31 2008 Jan Safranek - 2:2.3.14-18 -- fixed LABEL flag (#430929) - -* Wed Jan 30 2008 Jan Safranek - 2:2.3.14-17 -- fixing init scripts (#430816) - -* Mon Jan 28 2008 Jan Safranek - 2:2.3.14-16 -- xinetd.log man page is in the right section now (#428812) - -* Thu Sep 6 2007 Jan Safranek - 2:2.3.14-15 -- initscript made LSB compliant (#247099) - -* Thu Sep 6 2007 Jan Safranek - 2:2.3.14-14 -- removed inetdconvert script, nobody is using inetd - -* Wed Aug 22 2007 Jan Safranek - 2:2.3.14-13 -- updated license field - -* Wed May 16 2007 Jan Safranek - 2:2.3.14-12 -- bind IPv6 socket by default and switch to IPv4 on error - (bz#195265) -- service xinetd status returns actual status (bz#232887) -- use ssize_t instead of int (bz#211776) - -* Mon Dec 4 2006 Thomas Woerner - 2:2.3.14-11 -- tcp_wrappers has a new devel and libs sub package, therefore changing build - requirement for tcp_wrappers to tcp_wrappers-devel - -* Fri Dec 01 2006 James Antill - 2:2.3.14-9 -- Fix getpeercon() for LABELED networking MLS environments -- Resolves: rhbz#209379 - -* Sun Oct 01 2006 Jesse Keating - 2:2.3.14-8 -- rebuilt for unwind info generation, broken in gcc-4.1.1-21 - -* Wed Sep 20 2006 Steve Grubb 2:2.3.14-7 -- Revised labeled networking patch to not allow redirection - -* Tue Aug 29 2006 Steve Grubb 2:2.3.14-6 -- Revised labeled networking patch again - -* Thu Aug 24 2006 Steve Grubb 2:2.3.14-5 -- Revised labeled networking patch - -* Wed Aug 23 2006 Steve Grubb 2:2.3.14-4 -- Added labeled networking patch - -* Wed Jul 12 2006 Jesse Keating - 2:2.3.14-3.1 -- rebuild - -* Fri Jun 16 2006 Steve Grubb 2:2.3.14-3 -- Rework spec file & use xinetd's sevice config files - -* Fri Mar 24 2006 Jay Fenlason 2:2.3.14-2 -- Upgrade to new upstream version. This obsoletes the -libwrap, - -rpc, -banner, -bug140084 and -gcc4 patches. - -* Fri Feb 10 2006 Jesse Keating - 2:2.3.13-6.2.1 -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Jesse Keating - 2:2.3.13-6.2 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Thu Feb 17 2005 Jay Fenlason 2:2.3.13-6 -- include new patch to allow gcc4 to compile xinetd. - -* Sat Jan 8 2005 Jay Fenlason 2:2.3.13-4 -- Added patch committed to upstream CVS to fix bz#140084 - (error logging accidentally using one of [012] as the syslog - descriptor) - -* Fri Jun 18 2004 Jay Fenlason 2:2.3.13-3 -- Add patch to fix #126242: banner's don't work - -* Thu Jun 17 2004 Jay Fenlason -- Remove the configuration for the no-longer-present "services" service. - Closes #126169 - -* Tue Jun 15 2004 Elliot Lee -- rebuilt - -* Fri May 14 2004 Jay Fenlason -- Add patch to allow multiple rpc services to cooexist as long as they're - different program numbers or different versions. - -* Fri Feb 13 2004 Elliot Lee -- rebuilt - -* Thu Jan 29 2004 Jay Fenlason 2.3.13-1 -- Upgrade to new upstream version, which obsoletes most patches. -- Add new tcp_rpc patch, to turn on the nolibwrap flag on tcp rpc services, - since libwrap cannot be used on them. - -* Sun Dec 28 2003 Florian La Roche -- use new technology to filter python dep for inetdconvert instead - of changing the -x bit on file permissions - diff --git a/xinetd.sysconf b/xinetd.sysconf deleted file mode 100644 index 9edfe8c..0000000 --- a/xinetd.sysconf +++ /dev/null @@ -1,10 +0,0 @@ -# Add extra options here -EXTRAOPTIONS="" -# -# This is the locale information that xinetd uses. It is passed to every -# server that xinetd starts. It is set to en_US to maintain compatability -# with previous Red Hat Linux releases. -# -# To remove all locale information from xinetd's environment, set -# XINETD_LANG to the empty string or the string "none". -XINETD_LANG="en_US"