CVS commit: [netbsd-8] src/usr.sbin/inetd

2017-12-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec  4 19:46:08 UTC 2017

Modified Files:
src/usr.sbin/inetd [netbsd-8]: inetd.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #410):
usr.sbin/inetd/inetd.c: revision 1.125
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.123.4.1 -r1.123.4.2 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.4.1 src/usr.sbin/inetd/inetd.c:1.123.4.2
--- src/usr.sbin/inetd/inetd.c:1.123.4.1	Sat Oct 21 19:56:06 2017
+++ src/usr.sbin/inetd/inetd.c	Mon Dec  4 19:46:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.123.4.1 2017/10/21 19:56:06 snj Exp $	*/
+/*	$NetBSD: inetd.c,v 1.123.4.2 2017/12/04 19:46:08 snj 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.4.1 2017/10/21 19:56:06 snj Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.123.4.2 2017/12/04 19:46:08 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -101,7 +101,7 @@ __RCSID("$NetBSD: inetd.c,v 1.123.4.1 20
  *	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.123.4.1 20
  *	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: [netbsd-8] src/usr.sbin/inetd

2017-12-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec  4 19:46:08 UTC 2017

Modified Files:
src/usr.sbin/inetd [netbsd-8]: inetd.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #410):
usr.sbin/inetd/inetd.c: revision 1.125
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.123.4.1 -r1.123.4.2 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.



CVS commit: [netbsd-8] src/usr.sbin/inetd

2017-10-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 21 19:56:06 UTC 2017

Modified Files:
src/usr.sbin/inetd [netbsd-8]: inetd.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #331):
usr.sbin/inetd/inetd.c: revision 1.124
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.123.4.1 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.



CVS commit: [netbsd-8] src/usr.sbin/inetd

2017-10-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 21 19:56:06 UTC 2017

Modified Files:
src/usr.sbin/inetd [netbsd-8]: inetd.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #331):
usr.sbin/inetd/inetd.c: revision 1.124
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.123.4.1 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.123.4.1
--- src/usr.sbin/inetd/inetd.c:1.123	Wed Feb 15 02:48:31 2017
+++ src/usr.sbin/inetd/inetd.c	Sat Oct 21 19:56:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $	*/
+/*	$NetBSD: inetd.c,v 1.123.4.1 2017/10/21 19:56:06 snj 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.123.4.1 2017/10/21 19:56:06 snj 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