Allow internal and external wrapping to be enabled independantly of

each other. Instead of allowing the -w option to be specified twice,
we now take -w (wrap external) and -W (wrap internal).

Discussed with:	markm
This commit is contained in:
Sheldon Hearn 1999-07-09 11:19:01 +00:00
parent 946d53a1b3
commit 10d03f50ad
3 changed files with 22 additions and 17 deletions

View File

@ -9,7 +9,7 @@
#
# All arguments must be in double or single quotes.
#
# $Id: rc.conf,v 1.16 1999/07/07 12:49:47 peter Exp $
# $Id: rc.conf,v 1.17 1999/07/08 18:56:04 peter Exp $
##############################################################
### Important initial Boot-time options ####################
@ -58,7 +58,7 @@ sppp_interfaces="" # List of sppp interfaces.
syslogd_enable="YES" # Run syslog daemon (or NO).
syslogd_flags="" # Flags to syslogd (if enabled).
inetd_enable="YES" # Run the network daemon dispatcher (or NO).
inetd_flags="-w -w" # Optional flags to inetd
inetd_flags="-wW" # Optional flags to inetd
#
# named. It may be possible to run named in a sandbox, man security for
# details.

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94
.\" $Id: inetd.8,v 1.32 1999/07/02 15:58:32 sheldonh Exp $
.\" $Id: inetd.8,v 1.33 1999/07/02 16:21:12 sheldonh Exp $
.\"
.Dd February 7, 1996
.Dt INETD 8
@ -43,7 +43,8 @@
.Nm inetd
.Op Fl d
.Op Fl l
.Op Fl w Op Fl w
.Op Fl w
.Op Fl W
.Op Fl c Ar maximum
.Op Fl C Ar rate
.Op Fl a Ar address
@ -80,10 +81,12 @@ Turn on debugging.
.It Fl l
Turn on logging.
.It Fl w
Turn on TCP Wrapping. If this option is specified twice, internal
services will also be wrapped. See the
Turn on TCP Wrapping for external services. See the
.Sx "IMPLEMENTATION NOTES"
section for more information on TCP Wrappers support.
.It Fl W
Turn on TCP Wrapping for internal services which are built in to
.Nm inetd .
.It Fl c Ar maximum
Specify the default maximum number of services that can be invoked.
May be overridden on a per-service basis with the "max-child"
@ -416,10 +419,11 @@ or
except for
.Dq internal
services. If the
.Fl w
option is given twice, such
.Fl W
option is given, such
.Dq internal
services will be wrapped as well.
services will be wrapped. If both options are given, wrapping for both
internal and external services will be enabled.
.Pp
If the
.Fl l

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
#endif
static const char rcsid[] =
"$Id: inetd.c,v 1.56 1999/06/30 23:47:46 sheldonh Exp $";
"$Id: inetd.c,v 1.57 1999/07/02 16:21:13 sheldonh Exp $";
#endif /* not lint */
/*
@ -147,7 +147,7 @@ static const char rcsid[] =
#endif
#define ISWRAP(sep) \
( ((wrap && !(sep)->se_bi) || (wrap_bi && (sep)->se_bi)) \
( ((wrap_ex && !(sep)->se_bi) || (wrap_bi && (sep)->se_bi)) \
&& ( ((sep)->se_accept && (sep)->se_socktype == SOCK_STREAM) \
|| (sep)->se_socktype == SOCK_DGRAM))
@ -181,7 +181,7 @@ static const char rcsid[] =
int allow_severity;
int deny_severity;
int wrap = 0;
int wrap_ex = 0;
int wrap_bi = 0;
int debug = 0;
int log = 0;
@ -373,7 +373,7 @@ main(argc, argv, envp)
openlog("inetd", LOG_PID | LOG_NOWAIT, LOG_DAEMON);
bind_address.s_addr = htonl(INADDR_ANY);
while ((ch = getopt(argc, argv, "dlwR:a:c:C:p:")) != -1)
while ((ch = getopt(argc, argv, "dlwWR:a:c:C:p:")) != -1)
switch(ch) {
case 'd':
debug = 1;
@ -405,14 +405,15 @@ main(argc, argv, envp)
pid_file = optarg;
break;
case 'w':
if (wrap++)
wrap_bi++;
wrap_ex++;
break;
case 'W':
wrap_bi++;
break;
case '?':
default:
syslog(LOG_ERR,
"usage: inetd [-dl] [-w [-w]] [-a address]"
" [-R rate]"
"usage: inetd [-dlwW] [-a address] [-R rate]"
" [-c maximum] [-C rate]"
" [-p pidfile] [conf-file]");
exit(EX_USAGE);