CVS commit: src/usr.sbin/inetd

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb  3 12:02:22 UTC 2019

Modified Files:
src/usr.sbin/inetd: ipsec.c

Log Message:
- don't compare pointer with \0.  in this case, *pointer is wanted,
  not \0 -> NULL, as we just tested pointer, and this is wanting to
  be the standard "is this string NULL or nul?" idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/inetd/ipsec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/ipsec.c
diff -u src/usr.sbin/inetd/ipsec.c:1.4 src/usr.sbin/inetd/ipsec.c:1.5
--- src/usr.sbin/inetd/ipsec.c:1.4	Wed Jan  4 16:09:43 2012
+++ src/usr.sbin/inetd/ipsec.c	Sun Feb  3 12:02:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.4 2012/01/04 16:09:43 drochner Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.5 2019/02/03 12:02:22 mrg Exp $	*/
 
 /*
  * Copyright (C) 1999 WIDE Project.
@@ -58,7 +58,7 @@ ipsecsetup(int af, int fd, const char *p
 	char *p0, *p;
 	int error;
 
-	if (!policy || policy == '\0')
+	if (!policy || *policy == '\0')
 		p0 = p = strdup("in entrust; out entrust");
 	else
 		p0 = p = strdup(policy);



CVS commit: src/usr.sbin/inetd

2017-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 28 11:51:11 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Bump MAXARGV from 20 to 64 - with bozohttpd and all config on the command
line it is easy to hit the (silent) limit.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.124 src/usr.sbin/inetd/inetd.c:1.125
--- src/usr.sbin/inetd/inetd.c:1.124	Tue Oct 17 07:13:19 2017
+++ src/usr.sbin/inetd/inetd.c	Tue Nov 28 11:51:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.124 2017/10/17 07:13:19 ozaki-r Exp $	*/
+/*	$NetBSD: inetd.c,v 1.125 2017/11/28 11:51:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.124 2017/10/17 07:13:19 ozaki-r Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.125 2017/11/28 11:51:11 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -101,7 +101,7 @@ __RCSID("$NetBSD: inetd.c,v 1.124 2017/1
  *	wait/nowait[:max]		single-threaded/multi-threaded, max #
  *	user[:group]			user/group to run daemon as
  *	server program			full path name
- *	server program arguments	maximum of MAXARGS (20)
+ *	server program arguments	maximum of MAXARGV (64)
  *
  * For RPC services
  *  service name/versionmust be in /etc/rpc
@@ -110,7 +110,7 @@ __RCSID("$NetBSD: inetd.c,v 1.124 2017/1
  *	wait/nowait[:max]		single-threaded/multi-threaded
  *	user[:group]			user to run daemon as
  *	server program			full path name
- *	server program arguments	maximum of MAXARGS (20)
+ *	server program arguments	maximum of MAXARGV (64)
  *
  * For non-RPC services, the "service name" can be of the form
  * hostaddress:servicename, in which case the hostaddress is used
@@ -298,7 +298,7 @@ struct	servtab {
 	char	*se_group;		/* group name to run as */
 	struct	biltin *se_bi;		/* if built-in, description */
 	char	*se_server;		/* server program */
-#define	MAXARGV 20
+#define	MAXARGV 64
 	char	*se_argv[MAXARGV+1];	/* program arguments */
 #ifdef IPSEC
 	char	*se_policy;		/* IPsec poilcy string */



CVS commit: src/usr.sbin/inetd

2017-10-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Oct 17 07:13:19 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Don't setup SPs if no policy sepecifier is specified

We expect that SPs are set up iff some policy sepecifier(s) are specified.

Found on investigating an issue reported by Robert Swindells


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.123 src/usr.sbin/inetd/inetd.c:1.124
--- src/usr.sbin/inetd/inetd.c:1.123	Wed Feb 15 02:48:31 2017
+++ src/usr.sbin/inetd/inetd.c	Tue Oct 17 07:13:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $	*/
+/*	$NetBSD: inetd.c,v 1.124 2017/10/17 07:13:19 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.124 2017/10/17 07:13:19 ozaki-r Exp $");
 #endif
 #endif /* not lint */
 
@@ -1088,13 +1088,16 @@ setsockopt(fd, SOL_SOCKET, opt, , (so
 	}
 #endif
 #ifdef IPSEC
-	if (ipsecsetup(sep->se_family, sep->se_fd, sep->se_policy) < 0 &&
-	sep->se_policy) {
-		syslog(LOG_ERR, "%s/%s: ipsec setup failed",
-		sep->se_service, sep->se_proto);
-		(void)close(sep->se_fd);
-		sep->se_fd = -1;
-		return;
+	/* Avoid setting a policy if a policy specifier doesn't exist. */
+	if (sep->se_policy != NULL) {
+		int e = ipsecsetup(sep->se_family, sep->se_fd, sep->se_policy);
+		if (e < 0) {
+			syslog(LOG_ERR, "%s/%s: ipsec setup failed",
+			sep->se_service, sep->se_proto);
+			(void)close(sep->se_fd);
+			sep->se_fd = -1;
+			return;
+		}
 	}
 #endif
 



CVS commit: src/usr.sbin/inetd

2017-07-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jul 20 07:42:54 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
Simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.60 src/usr.sbin/inetd/inetd.8:1.61
--- src/usr.sbin/inetd/inetd.8:1.60	Wed Jul 19 16:37:17 2017
+++ src/usr.sbin/inetd/inetd.8	Thu Jul 20 07:42:54 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inetd.8,v 1.60 2017/07/19 16:37:17 dholland Exp $
+.\"	$NetBSD: inetd.8,v 1.61 2017/07/20 07:42:54 wiz Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -141,8 +141,7 @@ containing just
 a
 .Em listen-addr
 followed by a colon.
-The default (compatible with historical configuration files) is \&*
-.Ns .
+The default (compatible with historical configuration files) is \&*.
 To return to this behavior after configuring some services with
 specific listen addresses, give \&* explicitly.
 .Pp



CVS commit: src/usr.sbin/inetd

2017-07-19 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Jul 19 16:37:17 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
Rework previous (and the text it modified) for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.59 src/usr.sbin/inetd/inetd.8:1.60
--- src/usr.sbin/inetd/inetd.8:1.59	Sun Jul 16 21:19:38 2017
+++ src/usr.sbin/inetd/inetd.8	Wed Jul 19 16:37:17 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inetd.8,v 1.59 2017/07/16 21:19:38 wiz Exp $
+.\"	$NetBSD: inetd.8,v 1.60 2017/07/19 16:37:17 dholland Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .\"
 .\" from: @(#)inetd.8   8.4 (Berkeley) 6/1/94
 .\"
-.Dd July 16, 2017
+.Dd July 19, 2017
 .Dt INETD 8
 .Os
 .Sh NAME
@@ -115,8 +115,8 @@ special case, described below).
 The fields of the configuration file are as follows:
 .Pp
 .Bd -unfilled -offset indent -compact
-[addr:]service-name/port-number
-socket-type[:accept_filter]
+[listen-addr:]service-spec
+socket-type[:accept-filter]
 protocol[,sndbuf=size][,rcvbuf=size]
 wait/nowait[:max]
 user[:group]
@@ -124,82 +124,74 @@ server-program
 server program arguments
 .Ed
 .Pp
-To specify an
-.Em Sun-RPC
-based service, the entry would contain these fields:
-.Pp
-.Bd -unfilled -offset indent -compact
-service-name/version
-socket-type
-rpc/protocol[,sndbuf=size][,rcvbuf=size]
-wait/nowait[:max]
-user[:group]
-server-program
-server program arguments
-.Ed
-.Pp
-To specify a UNIX-domain (local) socket, the entry would contain
-these fields:
-.Pp
-.Bd -unfilled -offset indent -compact
-path
-socket-type
-unix[,sndbuf=size][,rcvbuf=size]
-wait/nowait[:max]
-user[:group]
-server-program
-server program arguments
-.Ed
-.Pp
-For Internet services, the first field of the line may also have a host
-address specifier prefixed to it, separated from the service name or port
-number by a colon.
-If this is done, the string before the colon in the
-first field indicates what local address
+The 
+.Em listen-addr
+specifies the local address
 .Nm
-should use when listening for that service, or the single character
+should use when listening.
+The single character
 .Dq \&*
-to indicate
-.Dv INADDR_ANY ,
-meaning
-.Sq all local addresses .
-To avoid repeating an address that occurs frequently, a line with a
-host address specifier and colon, but no further fields, causes the
-host address specifier to be remembered and used for all further lines
-with no explicit host specifier (until another such line or the end of
-the file).
-A line
-.Dl *:
-is implicitly provided at the top of the file; thus, traditional
-configuration files (which have no host address specifiers) will be
-interpreted in the traditional manner, with all services listened for
-on all local addresses.
+means
+.Dv INADDR_ANY :
+all local addresses.
+To avoid the need to repeat listen addresses over and over again,
+listen addresses are inherited from line to line, and the listen
+address can be changed without defining a service by including a line
+containing just
+a
+.Em listen-addr
+followed by a colon.
+The default (compatible with historical configuration files) is \&*
+.Ns .
+To return to this behavior after configuring some services with
+specific listen addresses, give \&* explicitly.
 .Pp
-The
-.Em service-name/port-number
-entry is the name of a valid service in
-the file
-.Pa /etc/services .
-Or an alternate port number.
+Note that restricted listen addresses are meaningless and ignored for
+UNIX-domain services, and are not supported for
+.Em Sun-RPC
+services.
+All 
+.Em Sun-RPC
+services always listen on all interfaces.
+.Pp
+The form of the
+.Em service-spec
+varies with the service type.
+For Internet services, the
+.Em service-spec
+can be either the name of a service from
+.Pa /etc/services
+or a decimal port number.
 For
 .Dq internal
-services (discussed below), the service
-name
+services (discussed below), the service name
 .Em must
 be the official name of the service (that is, the first entry in
-.Pa /etc/services ) .
-When used to specify a
+.Pa /etc/services )
+and not an alias for it.
+.Pp
+For
 .Em Sun-RPC
-based service, this field is a valid RPC service name in
+based services, the
+.Em service-spec
+has the form
+.Em service-name Ns Li / Ns Em version .
+The service name must be a valid RPC service name from
 the file
 .Pa /etc/rpc .
-The part on the right of the
+The
+.Em version
+on the right of the
 .Dq /
 is the RPC version number.
 This can simply be a single numeric argument or a range of versions.
-A range is bounded by the low version to the high version \-
+A range is bounded by the low version to the high version \- e.g.
 .Dq rusers/1-3 .
 .Pp
+For UNIX-domain (local) 

CVS commit: src/usr.sbin/inetd

2017-07-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jul 16 21:19:38 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.58 src/usr.sbin/inetd/inetd.8:1.59
--- src/usr.sbin/inetd/inetd.8:1.58	Sun Jul 16 21:05:19 2017
+++ src/usr.sbin/inetd/inetd.8	Sun Jul 16 21:19:38 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inetd.8,v 1.58 2017/07/16 21:05:19 christos Exp $
+.\"	$NetBSD: inetd.8,v 1.59 2017/07/16 21:19:38 wiz Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -153,7 +153,8 @@ server program arguments
 .Pp
 For Internet services, the first field of the line may also have a host
 address specifier prefixed to it, separated from the service name or port
-number by a colon. If this is done, the string before the colon in the
+number by a colon.
+If this is done, the string before the colon in the
 first field indicates what local address
 .Nm
 should use when listening for that service, or the single character
@@ -179,7 +180,8 @@ The
 entry is the name of a valid service in
 the file
 .Pa /etc/services .
-Or an alternate port number. For
+Or an alternate port number.
+For
 .Dq internal
 services (discussed below), the service
 name



CVS commit: src/usr.sbin/inetd

2017-07-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 16 21:05:19 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
PR/52412: Edgar Pettijohn: Describe the service/port syntax.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.57 src/usr.sbin/inetd/inetd.8:1.58
--- src/usr.sbin/inetd/inetd.8:1.57	Mon Apr 25 18:12:05 2011
+++ src/usr.sbin/inetd/inetd.8	Sun Jul 16 17:05:19 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inetd.8,v 1.57 2011/04/25 22:12:05 wiz Exp $
+.\"	$NetBSD: inetd.8,v 1.58 2017/07/16 21:05:19 christos Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .\"
 .\" from: @(#)inetd.8   8.4 (Berkeley) 6/1/94
 .\"
-.Dd August 27, 2008
+.Dd July 16, 2017
 .Dt INETD 8
 .Os
 .Sh NAME
@@ -115,7 +115,7 @@ special case, described below).
 The fields of the configuration file are as follows:
 .Pp
 .Bd -unfilled -offset indent -compact
-[addr:]service-name
+[addr:]service-name/port-number
 socket-type[:accept_filter]
 protocol[,sndbuf=size][,rcvbuf=size]
 wait/nowait[:max]
@@ -152,9 +152,9 @@ server program arguments
 .Ed
 .Pp
 For Internet services, the first field of the line may also have a host
-address specifier prefixed to it, separated from the service name by a colon.
-If this is done, the string before the colon in the first field
-indicates what local address
+address specifier prefixed to it, separated from the service name or port
+number by a colon. If this is done, the string before the colon in the
+first field indicates what local address
 .Nm
 should use when listening for that service, or the single character
 .Dq \&*
@@ -175,11 +175,11 @@ interpreted in the traditional manner, w
 on all local addresses.
 .Pp
 The
-.Em service-name
+.Em service-name/port-number
 entry is the name of a valid service in
 the file
 .Pa /etc/services .
-For
+Or an alternate port number. For
 .Dq internal
 services (discussed below), the service
 name



CVS commit: src/usr.sbin/inetd

2017-02-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Feb 15 02:48:31 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Increase buffer size reported to strlcpy() to be one larger than the
length of the string we copy in so that there is space for the '\0'.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.122 src/usr.sbin/inetd/inetd.c:1.123
--- src/usr.sbin/inetd/inetd.c:1.122	Sat Apr  5 23:36:10 2014
+++ src/usr.sbin/inetd/inetd.c	Wed Feb 15 02:48:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $	*/
+/*	$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $");
 #endif
 #endif /* not lint */
 
@@ -850,7 +850,7 @@ config(void)
 			}
 			(void)unlink(sep->se_service);
 			strlcpy(sep->se_ctrladdr_un.sun_path,
-			sep->se_service, n);
+			sep->se_service, n + 1);
 			sep->se_ctrladdr_un.sun_family = AF_LOCAL;
 			sep->se_ctrladdr_size = (int)(n +
 			sizeof(sep->se_ctrladdr_un) -



CVS commit: src/usr.sbin/inetd

2012-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 13 19:38:41 UTC 2012

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
PR/47318: Henning Petersen: Replace (r)index with str(r)chr in inetd.c
And while here strncpy with strlcpy


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.120 src/usr.sbin/inetd/inetd.c:1.121
--- src/usr.sbin/inetd/inetd.c:1.120	Wed Jan  4 11:09:43 2012
+++ src/usr.sbin/inetd/inetd.c	Thu Dec 13 14:38:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.120 2012/01/04 16:09:43 drochner Exp $	*/
+/*	$NetBSD: inetd.c,v 1.121 2012/12/13 19:38:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.120 2012/01/04 16:09:43 drochner Exp $);
+__RCSID($NetBSD: inetd.c,v 1.121 2012/12/13 19:38:40 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -842,14 +842,14 @@ config(void)
 			if (sep-se_fd != -1)
 break;
 			n = strlen(sep-se_service);
-			if (n  sizeof(sep-se_ctrladdr_un.sun_path)) {
+			if (n = sizeof(sep-se_ctrladdr_un.sun_path)) {
 syslog(LOG_ERR, %s: address too long,
 sep-se_service);
 sep-se_checked = 0;
 continue;
 			}
 			(void)unlink(sep-se_service);
-			strncpy(sep-se_ctrladdr_un.sun_path,
+			strlcpy(sep-se_ctrladdr_un.sun_path,
 			sep-se_service, n);
 			sep-se_ctrladdr_un.sun_family = AF_LOCAL;
 			sep-se_ctrladdr_size = (int)(n +
@@ -1367,22 +1367,22 @@ more:
 		sep-se_socktype = SOCK_STREAM;
 
 		/* one and only one accept filter */
-		accf = index(arg, ':');	
+		accf = strchr(arg, ':');	
 		if (accf) {
-			if (accf != rindex(arg, ':') ||	/* more than one */
+			if (accf != strrchr(arg, ':') ||/* more than one */
 			*(accf + 1) == '\0') {	/* nothing beyond */
 sep-se_socktype = -1;
 			} else {
 accf++;			/* skip delimiter */
-strncpy(sep-se_accf.af_name, accf,
+strlcpy(sep-se_accf.af_name, accf,
 	sizeof(sep-se_accf.af_name));
-accf_arg = index(accf, ',');
+accf_arg = strchr(accf, ',');
 if (accf_arg) {	/* zero or one arg, no more */
-	if ((rindex(accf, ',') != accf_arg)) {
+	if (strrchr(accf, ',') != accf_arg) {
 		sep-se_socktype = -1;
 	} else {
 		accf_arg++;
-		strncpy(sep-se_accf.af_arg,
+		strlcpy(sep-se_accf.af_arg,
 			accf_arg,
 			sizeof(sep-se_accf.af_arg));
 	}



CVS commit: src/usr.sbin/inetd

2011-04-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 25 22:12:06 UTC 2011

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
Use more markup.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.56 src/usr.sbin/inetd/inetd.8:1.57
--- src/usr.sbin/inetd/inetd.8:1.56	Sat Oct 24 12:23:47 2009
+++ src/usr.sbin/inetd/inetd.8	Mon Apr 25 22:12:05 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: inetd.8,v 1.56 2009/10/24 12:23:47 reed Exp $
+.\	$NetBSD: inetd.8,v 1.57 2011/04/25 22:12:05 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -330,8 +330,11 @@
 defaults to 40.
 If it reaches this maximum spawn rate,
 .Nm
-will log the problem (via the syslogger using the LOG_DAEMON
-facility and LOG_ERR level)
+will log the problem (via the syslogger using the
+.Dv LOG_DAEMON
+facility and
+.Dv LOG_ERR
+level)
 and stop handling the specific service for ten minutes.
 .Pp
 Stream servers are usually marked as



CVS commit: src/usr.sbin/inetd

2010-12-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Dec 15 13:13:28 UTC 2010

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Nuke conditionally compiled MULOG stuff.  Itojun wanted to do it
already 8 years ago when he fixed the compilation last time, and
again it hasn't been buildable in years.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.116 src/usr.sbin/inetd/inetd.c:1.117
--- src/usr.sbin/inetd/inetd.c:1.116	Thu Mar 25 16:36:00 2010
+++ src/usr.sbin/inetd/inetd.c	Wed Dec 15 13:13:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.116 2010/03/25 16:36:00 dholland Exp $	*/
+/*	$NetBSD: inetd.c,v 1.117 2010/12/15 13:13:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.116 2010/03/25 16:36:00 dholland Exp $);
+__RCSID($NetBSD: inetd.c,v 1.117 2010/12/15 13:13:28 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -325,10 +325,6 @@
 	int	se_max;			/* max # of instances of this service */
 	int	se_count;		/* number started since se_time */
 	struct	timeval se_time;	/* start of se_count */
-#ifdef MULOG
-	int	se_log;
-#define MULOG_RFC931	0x4000
-#endif
 	struct	servtab *se_next;
 } *servtab;
 
@@ -383,11 +379,6 @@
 static struct kevent *	allocchange(void);
 static int	get_line(int, char *, int);
 static void	spawn(struct servtab *, int);
-#ifdef MULOG
-static void	dolog(struct servtab *, int);
-static void	timeout(int);
-static char*rfc931_name(struct sockaddr *, int);
-#endif
 
 struct biltin {
 	const char *bi_service;		/* internally provided service name */
@@ -736,10 +727,6 @@
 		if (debug)
 			fprintf(stderr, %d execl %s\n,
 			getpid(), sep-se_server);
-#ifdef MULOG
-		if (sep-se_log)
-			dolog(sep, ctrl);
-#endif
 		/* Set our control descriptor to not close-on-exec... */
 		if (fcntl(ctrl, F_SETFD, 0)  0)
 			syslog(LOG_ERR, fcntl (%d, F_SETFD, 0): %m, ctrl);
@@ -1332,33 +1319,6 @@
 #endif
 		if (*cp == '#' || *cp == '\0')
 			continue;
-#ifdef MULOG
-		/* Avoid use of `skip' if there is a danger of it looking
-		 * at continuation lines.
-		 */
-		do {
-			cp++;
-		} while (*cp == ' ' || *cp == '\t');
-		if (*cp == '\0')
-			continue;
-		if ((arg = skip(cp)) == NULL)
-			continue;
-		if (strcmp(arg, DOMAIN))
-			continue;
-		if (curdom)
-			free(curdom);
-		curdom = NULL;
-		while (*cp == ' ' || *cp == '\t')
-			cp++;
-		if (*cp == '\0')
-			continue;
-		arg = cp;
-		while (*cp  *cp != ' '  *cp != '\t')
-			cp++;
-		if (*cp != '\0')
-			*cp++ = '\0';
-		curdom = newstr(arg);
-#endif
 		break;
 	}
 	if (cp == NULL)
@@ -1667,36 +1627,6 @@
 		sep-se_bi = NULL;
 	argc = 0;
 	for (arg = skip(cp); cp; arg = skip(cp)) {
-#if MULOG
-		char *colon;
-
-		if (argc == 0  (colon = strrchr(arg, ':'))) {
-			while (arg  colon) {
-int	x;
-char	*ccp;
-
-switch (*arg++) {
-case 'l':
-	x = 1;
-	if (isdigit(*arg)) {
-		x = strtol(arg, ccp, 0);
-		if (ccp == arg)
-			break;
-		arg = ccp;
-	}
-	sep-se_log = ~MULOG_RFC931;
-	sep-se_log |= x;
-	break;
-case 'a':
-	sep-se_log |= MULOG_RFC931;
-	break;
-default:
-	break;
-}
-			}
-			arg = colon + 1;
-		}
-#endif
 		if (argc  MAXARGV)
 			sep-se_argv[argc++] = newstr(arg);
 	}
@@ -2243,246 +2173,6 @@
 	_exit(1);
 }
 
-#ifdef MULOG
-void
-dolog(struct servtab *sep, int ctrl)
-{
-	struct sockaddr_storage	ss;
-	struct sockaddr		*sa = (struct sockaddr *)ss;
-	socklen_t		len = sizeof(ss);
-	char			*host, *dp, buf[BUFSIZ], abuf[BUFSIZ];
-	int			connected = 1;
-
-	switch (sep-se_family) {
-	case AF_INET:
-#ifdef INET6
-	case AF_INET6:
-#endif
-		break;
-	default:
-		return;
-	}
-
-	if (getpeername(ctrl, sa, len)  0) {
-		if (errno != ENOTCONN) {
-			syslog(LOG_ERR, getpeername: %m);
-			return;
-		}
-		if (recvfrom(ctrl, buf, sizeof(buf), MSG_PEEK, sa, len)  0) {
-			syslog(LOG_ERR, recvfrom: %m);
-			return;
-		}
-		connected = 0;
-	}
-	switch (sa-sa_family) {
-	case AF_INET:
-#ifdef INET6
-	case AF_INET6:
-#endif
-		break;
-	default:
-		syslog(LOG_ERR, unexpected address family %u, sa-sa_family);
-		return;
-	}
-
-	if (getnameinfo(sa, len, buf, sizeof(buf), NULL, 0, 0) != 0)
-		strlcpy(buf, ?, sizeof(buf));
-	host = buf;
-
-	switch (sep-se_log  ~MULOG_RFC931) {
-	case 0:
-		return;
-	case 1:
-		if (curdom == NULL || *curdom == '\0')
-			break;
-		dp = host + strlen(host) - strlen(curdom);
-		if (dp  host)
-			break;
-		if (debug)
-			fprintf(stderr, check \%s\ against curdom \%s\\n,
-			host, curdom);
-		if (strcasecmp(dp, curdom) == 0)
-			return;
-		break;
-	case 2:
-	default:
-		break;
-	}
-
-	openlog(, LOG_NOWAIT, MULOG);
-
-	sockaddr_snprintf(abuf, 

CVS commit: src/usr.sbin/inetd

2010-12-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Dec 15 15:36:16 UTC 2010

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
RLIMIT_NOFILE stabilized in NetBSD 17 years ago, so it's safe now
to remove the #ifdef's from around code which uses it.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.117 src/usr.sbin/inetd/inetd.c:1.118
--- src/usr.sbin/inetd/inetd.c:1.117	Wed Dec 15 13:13:28 2010
+++ src/usr.sbin/inetd/inetd.c	Wed Dec 15 15:36:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.117 2010/12/15 13:13:28 pooka Exp $	*/
+/*	$NetBSD: inetd.c,v 1.118 2010/12/15 15:36:15 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.117 2010/12/15 13:13:28 pooka Exp $);
+__RCSID($NetBSD: inetd.c,v 1.118 2010/12/15 15:36:15 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -194,10 +194,6 @@
 #include sys/resource.h
 #include sys/event.h
 
-#ifndef RLIMIT_NOFILE
-#define RLIMIT_NOFILE	RLIMIT_OFILE
-#endif
-
 #ifndef NO_RPC
 #define RPC
 #endif
@@ -279,9 +275,7 @@
 #define FD_MARGIN	(8)
 rlim_t		rlim_ofile_cur = OPEN_MAX;
 
-#ifdef RLIMIT_NOFILE
 struct rlimit	rlim_ofile;
-#endif
 
 struct kevent	changebuf[64];
 size_t		changes;
@@ -470,7 +464,6 @@
 		return (EXIT_FAILURE);
 	}
 
-#ifdef RLIMIT_NOFILE
 	if (getrlimit(RLIMIT_NOFILE, rlim_ofile)  0) {
 		syslog(LOG_ERR, getrlimit: %m);
 	} else {
@@ -478,7 +471,6 @@
 		if (rlim_ofile_cur == RLIM_INFINITY)	/* ! */
 			rlim_ofile_cur = OPEN_MAX;
 	}
-#endif
 
 	for (n = 0; n  (int)A_CNT(my_signals); n++) {
 		int	signum;
@@ -738,11 +730,9 @@
 		}
 		dup2(0, 1);
 		dup2(0, 2);
-#ifdef RLIMIT_NOFILE
 		if (rlim_ofile.rlim_cur != rlim_ofile_cur 
 		setrlimit(RLIMIT_NOFILE, rlim_ofile)  0)
 			syslog(LOG_ERR, setrlimit: %m);
-#endif
 		execv(sep-se_server, sep-se_argv);
 		syslog(LOG_ERR, cannot execute %s: %m, sep-se_server);
 	reject:
@@ -1776,10 +1766,7 @@
 static void
 bump_nofile(void)
 {
-#ifdef RLIMIT_NOFILE
-
 #define FD_CHUNK	32
-
 	struct rlimit rl;
 
 	if (getrlimit(RLIMIT_NOFILE, rl)  0) {
@@ -1801,11 +1788,6 @@
 
 	rlim_ofile_cur = rl.rlim_cur;
 	return;
-
-#else
-	syslog(LOG_ERR, bump_nofile: cannot extend file limit);
-	return;
-#endif
 }
 
 /*



CVS commit: src/usr.sbin/inetd

2010-03-25 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Mar 25 16:36:00 UTC 2010

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Avoid SIGSEGV in forked child process for (some?) instant-disconnect clients.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.115 src/usr.sbin/inetd/inetd.c:1.116
--- src/usr.sbin/inetd/inetd.c:1.115	Thu Oct 22 22:50:35 2009
+++ src/usr.sbin/inetd/inetd.c	Thu Mar 25 16:36:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.115 2009/10/22 22:50:35 tsarna Exp $	*/
+/*	$NetBSD: inetd.c,v 1.116 2010/03/25 16:36:00 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.115 2009/10/22 22:50:35 tsarna Exp $);
+__RCSID($NetBSD: inetd.c,v 1.116 2010/03/25 16:36:00 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -671,8 +671,12 @@
 ntohs(sep-se_ctrladdr_in.sin_port));
 			}
 			service = buf;
-			sockaddr_snprintf(abuf, sizeof(abuf), %a,
-			req.client-sin);
+			if (req.client-sin) {
+sockaddr_snprintf(abuf, sizeof(abuf), %a,
+req.client-sin);
+			} else {
+strcpy(abuf, (null));
+			}
 		}
 		if (denied) {
 			syslog(deny_severity,



CVS commit: src/usr.sbin/inetd

2009-10-24 Thread Jeremy C. Reed
Module Name:src
Committed By:   reed
Date:   Sat Oct 24 12:23:47 UTC 2009

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
Change manpage reference from talkd to ntalkd.
(Man link does exist, but no binary.)


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.55 src/usr.sbin/inetd/inetd.8:1.56
--- src/usr.sbin/inetd/inetd.8:1.55	Thu Oct 22 22:50:35 2009
+++ src/usr.sbin/inetd/inetd.8	Sat Oct 24 12:23:47 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: inetd.8,v 1.55 2009/10/22 22:50:35 tsarna Exp $
+.\	$NetBSD: inetd.8,v 1.56 2009/10/24 12:23:47 reed Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -303,7 +303,7 @@
 .Xr comsat 8
 .Pq Xr biff 1
 and
-.Xr talkd 8
+.Xr ntalkd 8
 are both examples of the latter type of
 datagram server.
 .Xr tftpd 8



CVS commit: src/usr.sbin/inetd

2009-10-22 Thread Jochen Kunz
Module Name:src
Committed By:   jkunz
Date:   Thu Oct 22 16:34:27 UTC 2009

Modified Files:
src/usr.sbin/inetd: Makefile inetd.8 inetd.c

Log Message:
Add mDNS Service Directory support to inetd(8).
inetd(8) can now advertize services in the mDNS-SD.
(Per service configuration option in inetd.conf(5).)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/inetd/inetd.8
cvs rdiff -u -r1.113 -r1.114 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/Makefile
diff -u src/usr.sbin/inetd/Makefile:1.21 src/usr.sbin/inetd/Makefile:1.22
--- src/usr.sbin/inetd/Makefile:1.21	Mon May 28 12:06:35 2007
+++ src/usr.sbin/inetd/Makefile	Thu Oct 22 16:34:27 2009
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.21 2007/05/28 12:06:35 tls Exp $
+#	$NetBSD: Makefile,v 1.22 2009/10/22 16:34:27 jkunz Exp $
 
 .include bsd.own.mk
 
@@ -20,6 +20,12 @@
 CPPFLAGS+=-DINET6
 .endif
 
+.if (${MKMDNS} != no)
+CPPFLAGS+=-DMDNS
+LDADD+= -ldns_sd
+DPADD+=	${LIBDNS_SD}
+.endif
+
 CPPFLAGS+=-DIPSEC
 SRCS+=	ipsec.c
 LDADD+= -lipsec

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.52 src/usr.sbin/inetd/inetd.8:1.53
--- src/usr.sbin/inetd/inetd.8:1.52	Tue Jul 14 08:24:15 2009
+++ src/usr.sbin/inetd/inetd.8	Thu Oct 22 16:34:27 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: inetd.8,v 1.52 2009/07/14 08:24:15 wiz Exp $
+.\	$NetBSD: inetd.8,v 1.53 2009/10/22 16:34:27 jkunz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -118,7 +118,7 @@
 [addr:]service-name
 socket-type[:accept_filter]
 protocol[,sndbuf=size][,rcvbuf=size]
-wait/nowait[:max]
+[mdns,]wait/nowait[:max]
 user[:group]
 server-program
 server program arguments
@@ -132,7 +132,7 @@
 service-name/version
 socket-type
 rpc/protocol[,sndbuf=size][,rcvbuf=size]
-wait/nowait[:max]
+[mdns,]wait/nowait[:max]
 user[:group]
 server-program
 server program arguments
@@ -145,7 +145,7 @@
 path
 socket-type
 unix[,sndbuf=size][,rcvbuf=size]
-wait/nowait[:max]
+[mdns,]wait/nowait[:max]
 user[:group]
 server-program
 server program arguments
@@ -279,6 +279,16 @@
 Socket buffer sizes may be specified for all
 services and protocols except for tcpmux services.
 .Pp
+If the
+.Em mdns
+option is present then
+.Nm
+advertises the service in the mDNS Service Directory.
+.Xr mdnsd 8
+needs to run for this to work. Note that mDNS does not distinguish IPv4 and
+IPv6. If a service is enabled for IPv6 only and IPv4 addresses are configured
+on the affected interface, the service will be advertized for IPv4 and IPv6.
+.Pp
 The
 .Em wait/nowait
 entry is used to tell

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.113 src/usr.sbin/inetd/inetd.c:1.114
--- src/usr.sbin/inetd/inetd.c:1.113	Mon Jul 13 19:05:41 2009
+++ src/usr.sbin/inetd/inetd.c	Thu Oct 22 16:34:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.113 2009/07/13 19:05:41 roy Exp $	*/
+/*	$NetBSD: inetd.c,v 1.114 2009/10/22 16:34:27 jkunz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.113 2009/07/13 19:05:41 roy Exp $);
+__RCSID($NetBSD: inetd.c,v 1.114 2009/10/22 16:34:27 jkunz Exp $);
 #endif
 #endif /* not lint */
 
@@ -98,7 +98,8 @@
  *	socket type[:accf[,arg]]	stream/dgram/raw/rdm/seqpacket,
 	only stream can name an accept filter
  *	protocol			must be in /etc/protocols
- *	wait/nowait[:max]		single-threaded/multi-threaded, max #
+ *	[mdns,]wait/nowait[:max]	single-threaded/multi-threaded, max #
+ *	if mdns register service in mDNS-SD
  *	user[:group]			user/group to run daemon as
  *	server program			full path name
  *	server program arguments	maximum of MAXARGS (20)
@@ -107,7 +108,8 @@
  *  service name/versionmust be in /etc/rpc
  *	socket type			stream/dgram/raw/rdm/seqpacket
  *	protocol			must be in /etc/protocols
- *	wait/nowait[:max]		single-threaded/multi-threaded
+ *	[mdns,]wait/nowait[:max]	single-threaded/multi-threaded
+ *	if mdns register service in mDNS-SD
  *	user[:group]			user to run daemon as
  *	server program			full path name
  *	server program arguments	maximum of MAXARGS (20)
@@ -255,6 +257,10 @@
 int deny_severity = LIBWRAP_DENY_FACILITY|LIBWRAP_DENY_SEVERITY;
 #endif
 
+#ifdef MDNS
+#include dns_sd.h
+#endif /* MDNS */
+
 #define	TOOMANY		40		/* don't start more than TOOMANY */
 #define	CNT_INTVL	60		/* servers in CNT_INTVL sec. */
 #define	RETRYTIME	(60*10)		/* retry after bind or server fail */
@@ -320,6 +326,7 @@
 	} se_un;			/* bound address */
 #define se_ctrladdr	se_un.se_un_ctrladdr
 #define se_ctrladdr_in	se_un.se_un_ctrladdr_in
+#define se_ctrladdr_in6	se_un.se_un_ctrladdr_in6
 #define se_ctrladdr_un	

CVS commit: src/usr.sbin/inetd

2009-10-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 22 21:43:28 UTC 2009

Modified Files:
src/usr.sbin/inetd: inetd.8

Log Message:
Bump date for mDNS support.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/inetd/inetd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.53 src/usr.sbin/inetd/inetd.8:1.54
--- src/usr.sbin/inetd/inetd.8:1.53	Thu Oct 22 16:34:27 2009
+++ src/usr.sbin/inetd/inetd.8	Thu Oct 22 21:43:28 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: inetd.8,v 1.53 2009/10/22 16:34:27 jkunz Exp $
+.\	$NetBSD: inetd.8,v 1.54 2009/10/22 21:43:28 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -57,7 +57,7 @@
 .\
 .\ from: @(#)inetd.8   8.4 (Berkeley) 6/1/94
 .\
-.Dd August 27, 2008
+.Dd October 22, 2009
 .Dt INETD 8
 .Os
 .Sh NAME
@@ -285,8 +285,9 @@
 .Nm
 advertises the service in the mDNS Service Directory.
 .Xr mdnsd 8
-needs to run for this to work. Note that mDNS does not distinguish IPv4 and
-IPv6. If a service is enabled for IPv6 only and IPv4 addresses are configured
+needs to run for this to work.
+Note that mDNS does not distinguish IPv4 and IPv6.
+If a service is enabled for IPv6 only and IPv4 addresses are configured
 on the affected interface, the service will be advertized for IPv4 and IPv6.
 .Pp
 The



CVS commit: src/usr.sbin/inetd

2009-05-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 23 03:24:51 UTC 2009

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
print the proper client address (ryo shimizu)


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.111 src/usr.sbin/inetd/inetd.c:1.112
--- src/usr.sbin/inetd/inetd.c:1.111	Wed Apr 15 04:38:37 2009
+++ src/usr.sbin/inetd/inetd.c	Fri May 22 23:24:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.111 2009/04/15 08:38:37 lukem Exp $	*/
+/*	$NetBSD: inetd.c,v 1.112 2009/05/23 03:24:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.111 2009/04/15 08:38:37 lukem Exp $);
+__RCSID($NetBSD: inetd.c,v 1.112 2009/05/23 03:24:51 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -672,7 +672,7 @@
 			}
 			service = buf;
 			sockaddr_snprintf(abuf, sizeof(abuf), %a,
-			sep-se_ctrladdr);
+			req.client-sin);
 		}
 		if (denied) {
 			syslog(deny_severity,



CVS commit: src/usr.sbin/inetd

2009-04-15 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Apr 15 08:38:37 UTC 2009

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Fix -Wsign-compare issue


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.110 src/usr.sbin/inetd/inetd.c:1.111
--- src/usr.sbin/inetd/inetd.c:1.110	Thu Jan  8 21:37:20 2009
+++ src/usr.sbin/inetd/inetd.c	Wed Apr 15 08:38:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.110 2009/01/08 21:37:20 christos Exp $	*/
+/*	$NetBSD: inetd.c,v 1.111 2009/04/15 08:38:37 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)inetd.c	8.4 (Berkeley) 4/13/94;
 #else
-__RCSID($NetBSD: inetd.c,v 1.110 2009/01/08 21:37:20 christos Exp $);
+__RCSID($NetBSD: inetd.c,v 1.111 2009/04/15 08:38:37 lukem Exp $);
 #endif
 #endif /* not lint */
 
@@ -1147,7 +1147,7 @@
 	(intptr_t)sep);
 	if (sep-se_fd  maxsock) {
 		maxsock = sep-se_fd;
-		if (maxsock  rlim_ofile_cur - FD_MARGIN)
+		if (maxsock  (int)(rlim_ofile_cur - FD_MARGIN))
 			bump_nofile();
 	}
 	if (debug)