Compare commits
12 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b073092c74 | ||
|
|
1ec40ce821 | ||
|
|
ca3c36aae3 | ||
|
|
e6597959ff | ||
|
|
70c932c6ef | ||
|
|
ec51496690 | ||
|
|
bee174d3d1 | ||
|
|
878d7aad58 | ||
|
|
ad9b4a7dc1 | ||
|
|
07d977eb18 | ||
|
|
732b66c355 | ||
|
|
079f18ff1e |
9 changed files with 491 additions and 21 deletions
22
xinetd-2.3.14-instances.patch
Normal file
22
xinetd-2.3.14-instances.patch
Normal file
|
|
@ -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 {
|
||||
41
xinetd-2.3.14-leaking-fds-2a.patch
Normal file
41
xinetd-2.3.14-leaking-fds-2a.patch
Normal file
|
|
@ -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 ) ;
|
||||
}
|
||||
|
||||
52
xinetd-2.3.14-leaking-fds.patch
Normal file
52
xinetd-2.3.14-leaking-fds.patch
Normal file
|
|
@ -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
|
||||
27
xinetd-2.3.14-many-services.patch
Normal file
27
xinetd-2.3.14-many-services.patch
Normal file
|
|
@ -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 )
|
||||
{
|
||||
134
xinetd-2.3.14-realloc-remove.patch
Normal file
134
xinetd-2.3.14-realloc-remove.patch
Normal file
|
|
@ -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
|
||||
54
xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch
Normal file
54
xinetd-2.3.14-retry-svc-activate-in-cps-restart.patch
Normal file
|
|
@ -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
|
||||
49
xinetd-2.3.14-tcpmux-nonmux-security.patch
Normal file
49
xinetd-2.3.14-tcpmux-nonmux-security.patch
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
--- xinetd-2.3.14/xinetd/builtins.c.old 2012-02-15 16:29:48.263844700 -0600
|
||||
+++ xinetd-2.3.14/xinetd/builtins.c 2012-02-15 16:37:52.209594438 -0600
|
||||
@@ -560,17 +560,16 @@
|
||||
/* Found the pointer. Validate its type.
|
||||
*/
|
||||
scp = SVC_CONF( sp );
|
||||
-/*
|
||||
- if ( ! SVC_IS_MUXCLIENT( sp ) )
|
||||
+
|
||||
+ if ( ! SVC_IS_MUXCLIENT( sp ) && ! SVC_IS_MUXPLUSCLIENT( sp ) )
|
||||
{
|
||||
if ( debug.on )
|
||||
{
|
||||
msg(LOG_DEBUG, "tcpmux_handler", "Non-tcpmux service name: %s.",
|
||||
svc_name);
|
||||
}
|
||||
- exit(0);
|
||||
+ continue;
|
||||
}
|
||||
-*/
|
||||
|
||||
/* Send the accept string if we're a PLUS (+) client.
|
||||
*/
|
||||
@@ -597,6 +596,19 @@
|
||||
msg(LOG_DEBUG, "tcpmux_handler", "Service name %s not found.",
|
||||
svc_name);
|
||||
}
|
||||
+
|
||||
+ /* If a service was not found, we should say so. */
|
||||
+ if ( Swrite( descriptor, TCPMUX_NOT_FOUND, sizeof( TCPMUX_NOT_FOUND ) ) !=
|
||||
+ sizeof ( TCPMUX_NOT_FOUND ) )
|
||||
+ {
|
||||
+ msg(LOG_ERR, "tcpmux_handler", "Not found write failed for %s.",
|
||||
+ svc_name);
|
||||
+ exit(0);
|
||||
+ }
|
||||
+
|
||||
+ /* Flush and exit, nothing to do */
|
||||
+ Sflush( descriptor );
|
||||
+ Sclose( descriptor );
|
||||
exit(0);
|
||||
}
|
||||
|
||||
--- xinetd-2.3.14/xinetd/service.h.old 2012-02-15 16:29:34.186942629 -0600
|
||||
+++ xinetd-2.3.14/xinetd/service.h 2012-02-15 16:30:19.009446694 -0600
|
||||
@@ -114,2 +114,3 @@
|
||||
#define TCPMUX_ACK "+Go\r\n"
|
||||
+#define TCPMUX_NOT_FOUND "-Service name not found\r\n"
|
||||
/*
|
||||
14
xinetd.service
Normal file
14
xinetd.service
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=Xinetd A Powerful Replacement For Inetd
|
||||
After=syslog.target network.target NetworkManager-wait-online.service
|
||||
|
||||
[Service]
|
||||
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
|
||||
|
||||
119
xinetd.spec
119
xinetd.spec
|
|
@ -1,13 +1,13 @@
|
|||
Summary: A secure replacement for inetd
|
||||
Name: xinetd
|
||||
Version: 2.3.14
|
||||
Release: 36%{?dist}
|
||||
Release: 47%{?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
|
||||
|
|
@ -43,14 +43,34 @@ 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
|
||||
# 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
|
||||
# CVE-2012-0862
|
||||
Patch27: xinetd-2.3.14-tcpmux-nonmux-security.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
|
||||
|
|
@ -91,6 +111,13 @@ 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
|
||||
%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 .tcpmux-security
|
||||
|
||||
aclocal
|
||||
autoconf
|
||||
|
|
@ -102,15 +129,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 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}
|
||||
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/itox*
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/itox
|
||||
|
|
@ -120,38 +146,89 @@ 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
|
||||
|
||||
%doc 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
|
||||
* Thu May 17 2012 Jan Synáček <jsynacek@redhat.com> - 2:2.3.14-47
|
||||
- Fix tcpmux security
|
||||
- Resolves: #820318 (CVE-2012-0862)
|
||||
|
||||
* Fri Apr 13 2012 Jan Synáček <jsynacek@redhat.com> - 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 <jsynacek@redhat.com> - 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 <jsynacek@redhat.com> - 2:2.3.14-44
|
||||
- Fix: Instances limit in xinetd can be easily bypassed
|
||||
- Resolves: #770858
|
||||
|
||||
* Mon Mar 05 2012 Jan Synáček <jsynacek@redhat.com> - 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 <jsynacek@redhat.com> - 2:2.3.14-42
|
||||
- Fix leaking descriptor when starting a service fails (#795188)
|
||||
- Bump revision to match in rawhide
|
||||
|
||||
* Wed Jan 18 2012 Jan Synáček <jsynacek@redhat.com> - 2:2.3.14-40
|
||||
- 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 <jsynacek@redhat.com> - 2:2.3.14-39
|
||||
- Fix memory corruption when loading a large number of services
|
||||
- Resolves #720390
|
||||
|
||||
* Mon Jan 16 2012 Jan Synáček <jsynacek@redhat.com> - 2:2.3.14-38
|
||||
- Fix leaking file descriptors
|
||||
- Resolves: #702670
|
||||
|
||||
* Mon Sep 12 2011 Tom Callaway <spot@fedoraproject.org> - 2:2.3.14-37
|
||||
- covert to systemd
|
||||
|
||||
* Thu Apr 21 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 2:2.3.14-36
|
||||
- Fix build warning about "dereferencing type-punned pointer"
|
||||
Related: #695674
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue