Maurizio Marini <[EMAIL PROTECTED]> ha escrit:

> using man inted i see:
>  wait/nowait[.massimo]

Probably you were reading a manpage that came with your system, not the
one from mailutils (see inetd/inetd.8 in the inetutils distribution).
Current version of inetd does not implement the `.max' syntax.  To fix this,
apply the attached patch.

Let me know if it works for you.

Regards,
Sergey

Index: inetd/inetd.c
===================================================================
RCS file: /cvsroot/inetutils/inetutils/inetd/inetd.c,v
retrieving revision 1.41
diff -p -u -r1.41 inetd.c
--- inetd/inetd.c	21 May 2008 04:48:57 -0000	1.41
+++ inetd/inetd.c	19 Jul 2008 09:30:29 -0000
@@ -232,6 +232,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 */
@@ -528,7 +529,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;
 
@@ -1202,24 +1204,37 @@ 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;
 	}
 
       sep->se_family = AF_INET;
 #endif
-
-      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);
-	}
-
+      {
+	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 (ISMUX (sep))
 	{
 	  /*
_______________________________________________
bug-inetutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-inetutils

Reply via email to