[packages/xinetd] Rel 2. Keep the instances limit across a cps re-enable

arekm arekm at pld-linux.org
Sun Nov 15 11:56:28 CET 2026


commit ae8150b8d9edc6afad1791e903e79a2613e0213e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Nov 15 11:55:54 2026 +0100

    Rel 2. Keep the instances limit across a cps re-enable

 xinetd-cps-instances-limit.patch | 43 ++++++++++++++++++++++++++++++++++++++++
 xinetd.spec                      |  5 ++++-
 2 files changed, 47 insertions(+), 1 deletion(-)
---
diff --git a/xinetd.spec b/xinetd.spec
index b8b7dc5..e376698 100644
--- a/xinetd.spec
+++ b/xinetd.spec
@@ -5,12 +5,14 @@ Summary(ru.UTF-8):	xinetd - богатая возможностями замен
 Summary(uk.UTF-8):	xinetd - багата можливостями заміна inetd
 Name:		xinetd
 Version:	2.3.15.4
-Release:	1
+Release:	2
 License:	BSD-like
 Group:		Networking/Daemons
 Source0:	https://github.com/openSUSE/xinetd/releases/download/%{version}/%{name}-%{version}.tar.xz
 # Source0-md5:	cbdb8e10a7ccb047c08ac1922e670318
 Source1:	%{name}.inet.sh
+# https://github.com/openSUSE/xinetd/commit/e95de5911c230236b51de59bd1df3f0adcc0b961
+Patch0:		%{name}-cps-instances-limit.patch
 URL:		https://github.com/openSUSE/xinetd/
 BuildRequires:	libselinux-devel
 BuildRequires:	libtirpc-devel
@@ -103,6 +105,7 @@ xinetd также имеет возможность привязывать ко
 
 %prep
 %setup -q
+%patch -P0 -p1
 
 %build
 # empty parameter lists mean (void) since C23, which gcc 15 defaults to
diff --git a/xinetd-cps-instances-limit.patch b/xinetd-cps-instances-limit.patch
new file mode 100644
index 0000000..6e910a4
--- /dev/null
+++ b/xinetd-cps-instances-limit.patch
@@ -0,0 +1,43 @@
+From e95de5911c230236b51de59bd1df3f0adcc0b961 Mon Sep 17 00:00:00 2001
+From: Jan Synacek <jsynacek at redhat.com>
+Date: Tue, 6 Mar 2012 09:29:03 +0000
+Subject: [PATCH] Fix: Instances limit in xinetd can be easily bypassed
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The connections number is limited in the xined.conf file by setting the
+"instances" field.  However, when a connection is blocked after exceeding the
+“cps” limit, the xinetd “forgets” the existing instances and the instances
+limit can be exceeded.
+
+Original patch: https://src.fedoraproject.org/rpms/xinetd/c/5ae7170961e48c7ef7d3ea8b503b3348ba8a7057?branch=rawhide
+Related: https://bugzilla.redhat.com/show_bug.cgi?id=770858
+---
+ src/access.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/access.c b/src/access.c
+index b82fb94..0a2d271 100644
+--- a/src/access.c
++++ b/src/access.c
+@@ -69,6 +69,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++ ) {
+@@ -80,8 +81,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 {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xinetd.git/commitdiff/ae8150b8d9edc6afad1791e903e79a2613e0213e



More information about the pld-cvs-commit mailing list