Commit 682e6adb authored by Marco d'Itri's avatar Marco d'Itri

Merge upstream release v0.20080125

parents ae9aa041 578b42ab
/Makefile/1.3/Fri Mar 31 01:00:49 2000//
/inetd.8/1.27/Thu Dec 30 16:35:38 2004//
/inetd.c/1.122/Thu Dec 30 16:35:38 2004//
/pathnames.h/1.2/Thu Dec 30 16:35:39 2004//
D
src/usr.sbin/inetd
anoncvs@anoncvs1.usa.openbsd.org:/cvs
This diff is collapsed.
# $OpenBSD: Makefile,v 1.3 2000/03/31 01:00:49 deraadt Exp $
# $OpenBSD: Makefile,v 1.2 1997/09/21 11:43:44 deraadt Exp $
PROG= inetd
MAN= inetd.8
......
.\" $OpenBSD: inetd.8,v 1.27 2004/06/30 07:58:12 otto Exp $
.\" $OpenBSD: inetd.8,v 1.31 2008/01/06 13:49:42 jmc Exp $
.\" Copyright (c) 1985, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
......@@ -28,7 +28,7 @@
.\"
.\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91
.\"
.Dd March 16, 1991
.Dd $Mdocdate: January 6 2008 $
.Dt INETD 8
.Os
.Sh NAME
......@@ -80,6 +80,11 @@ is silently not executed even if present in
.It Fl R Ar rate
Specify the maximum number of times a service can be invoked
in one minute; the default is 256.
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 wait/nowait configuration fields below.
.El
.Pp
Upon execution,
......@@ -95,8 +100,7 @@ Comments are denoted by a
at the beginning
of a line.
The fields of the configuration file are as follows:
.Pp
.Bd -unfilled -offset indent -compact
.Bd -unfilled -offset indent
service name
socket type
protocol[,sndbuf=size][,rcvbuf=size]
......@@ -108,8 +112,7 @@ server program arguments
.Pp
To specify a Sun-RPC
based service, the entry would contain these fields.
.Pp
.Bd -unfilled -offset indent -compact
.Bd -unfilled -offset indent
service name/version
socket type
rpc/protocol[,sndbuf=size][,rcvbuf=size]
......@@ -293,13 +296,15 @@ suffix (separated from
.Dq wait
or
.Dq nowait
by a dot) specifies the maximum number of server instances that may be
spawned from
.Nm inetd
within an interval of 60 seconds.
When omitted,
.Dq max
defaults to 256.
by a dot) specifies the maximum number of times a service can be invoked
in one minute; the default is 256.
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
Stream servers are usually marked as
.Dq nowait
......@@ -440,7 +445,6 @@ connections mapped in an IPv6 socket. Its usage is discouraged.
.Xr identd 8 ,
.Xr rshd 8 ,
.Xr talkd 8 ,
.Xr telnetd 8 ,
.Xr tftpd 8
.Sh HISTORY
The
......@@ -470,7 +474,3 @@ have more than one entry for a given RPC service, everything should
work correctly.
(Note that default host address specifiers do apply to
RPC lines with no explicit specifier.)
.Pp
.Dq rpc
on IPv6 is not tested enough.
Kerberos support on IPv6 is not tested.
/* $OpenBSD: inetd.c,v 1.123 2005/04/02 18:10:52 otto Exp $ */
/* $OpenBSD: inetd.c,v 1.125 2008/01/05 09:53:42 jmc Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
......@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static const char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
static const char rcsid[] = "$OpenBSD: inetd.c,v 1.123 2005/04/02 18:10:52 otto Exp $";
static const char rcsid[] = "$OpenBSD: inetd.c,v 1.125 2008/01/05 09:53:42 jmc Exp $";
#endif /* not lint */
/*
......@@ -394,7 +394,8 @@ main(int argc, char *argv[], char *envp[])
}
case '?':
default:
fprintf(stderr, "usage: %s [-q len] [-R rate] [-di] [conf]\n",
fprintf(stderr,
"usage: %s [-d] [-R rate] [configuration file]\n",
progname);
exit(1);
}
......@@ -414,6 +415,11 @@ main(int argc, char *argv[], char *envp[])
progname);
exit(1);
}
if (argc > 1) {
fprintf(stderr, "%s: more than one argument specified\n",
progname);
exit(1);
}
umask(022);
if (debug == 0) {
......@@ -1659,13 +1665,9 @@ again:
char *
nextline(FILE *fd)
{
char *cp;
if (fgets(line, sizeof (line), fd) == NULL)
return (NULL);
cp = strchr(line, '\n');
if (cp)
*cp = '\0';
line[strcspn(line, "\n")] = '\0';
return (line);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment