summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2008-07-26 19:21:08 +0000
committerGuillem Jover <guillem@hadrons.org>2010-06-10 23:21:23 +0200
commit9914575e8c5ddbf9f516e3634e1af6097a193fea (patch)
treef8fd6b39cf673eda8256aec1e6c12fe16a653019
parent78ce1cb5aa7412939ad94d5de2251035679b9c01 (diff)
downloadinetutils-9914575e8c5ddbf9f516e3634e1af6097a193fea.tar.gz
Support max option on wait/nowait.max on inetd.conf
Man page update taken from openbsd-inetd. Closes: #451478 Thanks-to: Sergey Poznyakoff <gray@gnu.org.ua> for the patch
-rw-r--r--debian/changelog8
-rw-r--r--debian/patches/99_inetd_max_conn.patch115
-rw-r--r--debian/patches/series1
3 files changed, 124 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index b7b079c..36bc3e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+inetutils (2:1.5.dfsg.1-8) UNRELEASED; urgency=low
+
+ * Support max option on wait/nowait.max on inetd.conf. (Closes: #451478)
+ Thanks to Sergey Poznyakoff <gray@gnu.org.ua> for the patch.
+ Man page update taken from openbsd-inetd.
+
+ -- Guillem Jover <guillem@debian.org> Sat, 26 Jul 2008 22:04:56 +0300
+
inetutils (2:1.5.dfsg.1-7) unstable; urgency=low
* Add a debian/README.source file.
diff --git a/debian/patches/99_inetd_max_conn.patch b/debian/patches/99_inetd_max_conn.patch
new file mode 100644
index 0000000..a366695
--- /dev/null
+++ b/debian/patches/99_inetd_max_conn.patch
@@ -0,0 +1,115 @@
+Index: b/inetd/inetd.c
+===================================================================
+--- a/inetd/inetd.c
++++ b/inetd/inetd.c
+@@ -78,7 +78,7 @@ static char sccsid[] = "@(#)inetd.c 8.4
+ * name a tcpmux service
+ * socket type stream/dgram/raw/rdm/seqpacket
+ * protocol must be in /etc/protocols
+- * wait/nowait single-threaded/multi-threaded
++ * wait/nowait.max single-threaded/multi-threaded
+ * user user to run daemon as
+ * server program full path name
+ * server program arguments arguments starting with argv[0]
+@@ -170,6 +170,7 @@ struct servtab {
+ int se_socktype; /* type of socket to use */
+ char *se_proto; /* protocol used */
+ pid_t se_wait; /* single threaded server */
++ unsigned se_max; /* Maximum number of instances per 60 sec. */
+ short se_checked; /* looked at during merge */
+ char *se_user; /* user name to run as */
+ struct biltin *se_bi; /* if built-in, description */
+@@ -555,7 +556,8 @@ main (int argc, char *argv[], char *envp
+ {
+ if (sep->se_count++ == 0)
+ gettimeofday (&sep->se_time, NULL);
+- else if (sep->se_count >= toomany)
++ else if ((sep->se_max && sep->se_count > sep->se_max)
++ || sep->se_count >= toomany)
+ {
+ struct timeval now;
+
+@@ -1232,7 +1234,7 @@ getconfigent (FILE *fconfig, const char
+ if ((strncmp (sep->se_proto, "tcp6", 4) == 0)
+ || (strncmp (sep->se_proto, "udp6", 4) == 0))
+ {
+- syslog (LOG_ERR, "%s:%lu: %s: IPv6 support isn't eneabled",
++ syslog (LOG_ERR, "%s:%lu: %s: IPv6 support isn't enabled",
+ file, (unsigned long) *line, sep->se_proto);
+ continue;
+ }
+@@ -1240,6 +1242,30 @@ getconfigent (FILE *fconfig, const char
+ sep->se_family = AF_INET;
+ #endif
+
++ {
++ char *p, *q;
++
++ p = strchr(argv[INETD_WAIT], '.');
++ if (p)
++ *p++ = 0;
++ if (strcmp (argv[INETD_WAIT], "wait") == 0)
++ sep->se_wait = 1;
++ else if (strcmp (argv[INETD_WAIT], "nowait") == 0)
++ sep->se_wait = 0;
++ else
++ {
++ syslog (LOG_WARNING, "%s:%lu: bad wait type",
++ file, (unsigned long) *line);
++ }
++ if (p)
++ {
++ sep->se_max = strtoul(p, &q, 10);
++ if (*q)
++ syslog (LOG_WARNING, "%s:%lu: invalid number (%s)",
++ file, (unsigned long) *line, p);
++ }
++ }
++
+ if (strcmp (argv[INETD_WAIT], "wait") == 0)
+ sep->se_wait = 1;
+ else if (strcmp (argv[INETD_WAIT], "nowait") == 0)
+Index: b/inetd/inetd.8
+===================================================================
+--- a/inetd/inetd.8
++++ b/inetd/inetd.8
+@@ -74,7 +74,7 @@ Pass local and remote address data via e
+ \fBENVIRONMENT\fP below.
+ .It Fl R, -rate Ar rate
+ Specifies the maximum number of times a service can be invoked
+-in one minute; the default is 1000.
++in one minute; the default is 40.
+ .It Fl -resolve
+ Resolve local and remote IP addresses and pass them to the server program
+ via \fBTCPLOCALHOST\fP and \fBTCPREMOTEHOST\fP environment variables. See
+@@ -103,7 +103,7 @@ fields of the configuration file are as
+ service name
+ socket type
+ protocol
+-wait/nowait
++wait/nowait[.max]
+ user
+ server program
+ server program arguments
+@@ -215,6 +215,21 @@ are both examples of the latter type of
+ datagram server.
+ .Xr Tftpd 8
+ is an example of a multi-threaded datagram server.
++The optional
++.Dq max
++suffix (separated from
++.Dq wait
++or
++.Dq nowait
++by a dot) specifies the maximum number of times a service can be invoked
++in one minute; the default is 40.
++If a service exceeds this limit,
++.Nm
++will log the problem
++and stop servicing requests for the specific service for ten minutes.
++See also the
++.Fl R
++option above.
+ .Pp
+ Servers using stream sockets generally are multi-threaded and
+ use the
diff --git a/debian/patches/series b/debian/patches/series
index aa08997..730773b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@
50_split_load_conffile.patch
51_add_load_confdir_support.patch
52_sigalarm.patch
+99_inetd_max_conn.patch