summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>1999-07-09 11:19:01 +0000
committersheldonh <sheldonh@FreeBSD.org>1999-07-09 11:19:01 +0000
commit37c066a7ad337b86b969269c3392c9942dd7c22e (patch)
tree35796b01a50d45fff11d7de8ee1a0e97f05dbc75 /usr.sbin/inetd
parent476eeebd858f14e2bfa6e1e625e02f5c3a7ea2b7 (diff)
downloadFreeBSD-src-37c066a7ad337b86b969269c3392c9942dd7c22e.zip
FreeBSD-src-37c066a7ad337b86b969269c3392c9942dd7c22e.tar.gz
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
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.818
-rw-r--r--usr.sbin/inetd/inetd.c17
2 files changed, 20 insertions, 15 deletions
diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8
index aca5f8c..2ed98eb 100644
--- a/usr.sbin/inetd/inetd.8
+++ b/usr.sbin/inetd/inetd.8
@@ -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
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index e7d610c..9d8b7a0 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -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);
OpenPOWER on IntegriCloud