CVS commit: src/bin/ps

2021-09-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 15 13:16:57 UTC 2021

Modified Files:
src/bin/ps: keyword.c

Log Message:
Don't assign v to newvar, so we can still access the original length.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/bin/ps/keyword.c

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

Modified files:

Index: src/bin/ps/keyword.c
diff -u src/bin/ps/keyword.c:1.59 src/bin/ps/keyword.c:1.60
--- src/bin/ps/keyword.c:1.59	Tue Sep 14 18:01:17 2021
+++ src/bin/ps/keyword.c	Wed Sep 15 09:16:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $	*/
+/*	$NetBSD: keyword.c,v 1.60 2021/09/15 13:16:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyword.c	8.5 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $");
+__RCSID("$NetBSD: keyword.c,v 1.60 2021/09/15 13:16:57 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -383,7 +383,6 @@ findvar(const char *p)
 
 	struct var *newvar = emalloc(sizeof(*newvar));
 	*newvar = *v;
-	v = newvar;
 
 	if (hp) {
 		/*
@@ -407,7 +406,7 @@ findvar(const char *p)
 	if (*p != *pp)
 		newvar->flag |= ALTPR|LJUST;
 
-	return v;
+	return newvar;
 }
 
 static int



CVS commit: src/bin/ps

2021-09-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 15 13:16:57 UTC 2021

Modified Files:
src/bin/ps: keyword.c

Log Message:
Don't assign v to newvar, so we can still access the original length.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/bin/ps/keyword.c

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



CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:14:11 UTC 2021

Modified Files:
src/bin/ps: ps.1

Log Message:
reflect reality on flags.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/bin/ps/ps.1

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

Modified files:

Index: src/bin/ps/ps.1
diff -u src/bin/ps/ps.1:1.113 src/bin/ps/ps.1:1.114
--- src/bin/ps/ps.1:1.113	Tue Sep 14 13:09:18 2021
+++ src/bin/ps/ps.1	Tue Sep 14 18:14:11 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ps.1,v 1.113 2021/09/14 17:09:18 christos Exp $
+.\"	$NetBSD: ps.1,v 1.114 2021/09/14 22:14:11 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -292,10 +292,11 @@ The percentage of real memory used by th
 .It Ar flags
 The flags (in hexadecimal) associated with the process as in
 the include file
-.In sys/proc.h :
+.In sys/sysctl.h :
 .Bl -column P_NOCLDSTOP P_NOCLDSTOP compact
 .It Dv "P_ADVLOCK" Ta No "0x0001	process may hold a POSIX advisory lock"
 .It Dv "P_CONTROLT" Ta No "0x0002	process has a controlling terminal"
+.It Dv "P_INMEM" Ta No "0x0004	process is in memory"
 .It Dv "P_NOCLDSTOP" Ta No "0x0008	no" Dv SIGCHLD No when children stop
 .It Dv "P_PPWAIT" Ta No "0x0010	parent is waiting for child to exec/exit"
 .It Dv "P_PROFIL" Ta No "0x0020	process has started profiling"
@@ -303,17 +304,21 @@ the include file
 .It Dv "P_SINTR" Ta No "0x0080	sleep is interruptible"
 .It Dv "P_SUGID" Ta No "0x0100	process had set id privileges since last exec"
 .It Dv "P_SYSTEM" Ta No "0x0200	system process: no sigs or stats"
-.It Dv "P_TIMEOUT" Ta No "0x0400	timing out during sleep"
+.It Dv "P_SA" Ta No "0x0400	process is using scheduler activations (old)"
 .It Dv "P_TRACED" Ta No "0x0800	process is being traced"
 .It Dv "P_WAITED" Ta No "0x1000	debugging process has waited for child"
 .It Dv "P_WEXIT" Ta No "0x2000	working on exiting"
 .It Dv "P_EXEC" Ta No "0x4000	process called" Xr execve 2
 .It Dv "P_OWEUPC" Ta No "0x8000	owe process an addupc() call at next ast"
-.\" the routine addupc is not documented in the man pages
-.It Dv "P_NOCLDWAIT" Ta No "0x0002	no zombies when children die"
+.It Dv "P_NOCLDWAIT" Ta No "0x0002	no zombies if child dies"
 .It Dv "P_32" Ta No "0x0004	32-bit process (used on 64-bit kernels)"
-.It Dv "P_BIGLOCK" Ta No "0x0008	process needs kernel ``big lock'' to run"
-.It Dv "P_INEXEC" Ta No "0x0010	process is exec'ing and cannot be traced"
+.It Dv "P_CLDSIGIGN" Ta No "0x0008000	no" Dv SIGCHLD when children stop
+.It Dv "P_SYSTRACE" Ta No "0x0020	process is under" Xr systrace 1 (old)
+.It Dv "P_CHTRACED" Ta No "0x0040	process has been traced and reparented"
+.It Dv "P_STOPFORK" Ta No "0x0080	process stops at" Xr fork 2
+.It Dv "P_STOPEXEC" Ta No "0x0100	process stops at" Xr exec 2
+.It Dv "P_STOPEXIT" Ta No "0x0200	process stops at" Xr _exit 2"
+.It Dv "P_SYSCALL" Ta No "0x0400	process is tracing syscalls"
 .El
 .It Ar lim
 The soft limit on memory used, specified via a call to



CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:14:11 UTC 2021

Modified Files:
src/bin/ps: ps.1

Log Message:
reflect reality on flags.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/bin/ps/ps.1

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



CVS commit: src/sys/sys

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:01:40 UTC 2021

Modified Files:
src/sys/sys: ktrace.h

Log Message:
add format for flags.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/sys/ktrace.h

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

Modified files:

Index: src/sys/sys/ktrace.h
diff -u src/sys/sys/ktrace.h:1.66 src/sys/sys/ktrace.h:1.67
--- src/sys/sys/ktrace.h:1.66	Thu Apr 19 17:19:07 2018
+++ src/sys/sys/ktrace.h	Tue Sep 14 18:01:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ktrace.h,v 1.66 2018/04/19 21:19:07 christos Exp $	*/
+/*	$NetBSD: ktrace.h,v 1.67 2021/09/14 22:01:40 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -248,6 +248,27 @@ struct ktr_execfd {
 #define KTRFAC_EXEC_ENV	(1<

CVS commit: src/sys/sys

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:01:40 UTC 2021

Modified Files:
src/sys/sys: ktrace.h

Log Message:
add format for flags.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/sys/ktrace.h

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



CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:01:17 UTC 2021

Modified Files:
src/bin/ps: keyword.c print.c ps.c ps.h

Log Message:
use emalloc and friends, add ktrace flag printing.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/bin/ps/keyword.c
cvs rdiff -u -r1.136 -r1.137 src/bin/ps/print.c
cvs rdiff -u -r1.96 -r1.97 src/bin/ps/ps.c
cvs rdiff -u -r1.31 -r1.32 src/bin/ps/ps.h

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

Modified files:

Index: src/bin/ps/keyword.c
diff -u src/bin/ps/keyword.c:1.58 src/bin/ps/keyword.c:1.59
--- src/bin/ps/keyword.c:1.58	Tue Sep 14 13:09:18 2021
+++ src/bin/ps/keyword.c	Tue Sep 14 18:01:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: keyword.c,v 1.58 2021/09/14 17:09:18 christos Exp $	*/
+/*	$NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyword.c	8.5 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: keyword.c,v 1.58 2021/09/14 17:09:18 christos Exp $");
+__RCSID("$NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,6 +55,7 @@ __RCSID("$NetBSD: keyword.c,v 1.58 2021/
 #include 
 #include 
 #include 
+#include 
 
 #include "ps.h"
 
@@ -136,7 +137,7 @@ VAR var[] = {
 	PUVAR("isrss", "ISRSS", 0, p_uru_isrss, UINT64, PRId64),
 	PUVAR("ixrss", "IXRSS", 0, p_uru_ixrss, UINT64, PRId64),
 	PVAR("jobc", "JOBC", 0, p_jobc, SHORT, "d"),
-	PVAR("ktrace", "KTRACE", 0, p_traceflag, INT, "x"),
+	PVAR("ktrace", "KTRACE", 0, p_traceflag, KTRACEFLAG, "x"),
 /*XXX*/	PVAR("ktracep", "KTRACEP", 0, p_tracep, KPTR, PRIx64),
 	LVAR("laddr", "LADDR", 0, l_laddr, KPTR, PRIx64),
 	LVAR("lid", "LID", 0, l_lid, INT32, "d"),
@@ -257,7 +258,7 @@ parsevarlist(const char *pp, struct varl
 	char *p, *sp, *equalsp;
 
 	/* dup to avoid zapping arguments.  We will free sp later. */
-	p = sp = strdup(pp);
+	p = sp = estrdup(pp);
 
 	/*
 	 * Everything after the first '=' is part of a custom header.
@@ -305,8 +306,7 @@ parsevarlist(const char *pp, struct varl
 		 */
 		if ((v = findvar(cp)) == NULL)
 			continue;
-		if ((vent = malloc(sizeof(struct varent))) == NULL)
-			err(EXIT_FAILURE, NULL);
+		vent = emalloc(sizeof(*vent));
 		vent->var = v;
 		if (pos && *pos)
 		SIMPLEQ_INSERT_AFTER(listptr, *pos, vent, next);
@@ -369,7 +369,7 @@ findvar(const char *p)
 	for (char *dp = pp; *dp; dp++)
 		*dp = tolower((unsigned char)*dp);
 
-	v = bsearch(pp, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
+	v = bsearch(pp, var, __arraycount(var) - 1, sizeof(*var), vcmp);
 	if (v && v->flag & ALIAS)
 		v = findvar(v->header);
 	if (!v) {
@@ -381,11 +381,8 @@ findvar(const char *p)
 	if (!hp && *p == *pp)
 		return v;
 
-	struct var *newvar;
-
-	if ((newvar = malloc(sizeof(*newvar))) == NULL)
-		err(EXIT_FAILURE, NULL);
-	memcpy(newvar, v, sizeof(*newvar));
+	struct var *newvar = emalloc(sizeof(*newvar));
+	*newvar = *v;
 	v = newvar;
 
 	if (hp) {
@@ -397,10 +394,7 @@ findvar(const char *p)
 		 * used multiple times with different headers.  We also
 		 * need to strdup the header.
 		 */
-		char *newheader;
-		if ((newheader = strdup(hp)) == NULL)
-			err(EXIT_FAILURE, NULL);
-		newvar->header = newheader;
+		newvar->header = estrdup(hp);
 		/*
 		 * According to P1003.1-2004, if the header text is null,
 		 * such as -o user=, the field width will be at least as

Index: src/bin/ps/print.c
diff -u src/bin/ps/print.c:1.136 src/bin/ps/print.c:1.137
--- src/bin/ps/print.c:1.136	Tue Sep 14 13:09:18 2021
+++ src/bin/ps/print.c	Tue Sep 14 18:01:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.136 2021/09/14 17:09:18 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.137 2021/09/14 22:01:17 christos Exp $	*/
 
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)print.c	8.6 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.136 2021/09/14 17:09:18 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.137 2021/09/14 22:01:17 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -77,6 +77,7 @@ __RCSID("$NetBSD: print.c,v 1.136 2021/0
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1170,9 +1171,7 @@ printsig(VAR *v, const sigset_t *s, enum
 		strprintorsetwidth(v, buf + i, mode);
 	} else {
 		size_t maxlen = 1024, len = 0;
-		char *buf = malloc(maxlen);
-		if (buf == NULL)
-			err(EXIT_FAILURE, NULL);
+		char *buf = emalloc(maxlen);
 		*buf = '\0';
 		for (size_t i = 0; i < SIGSETSIZE; i++) {
 			uint32_t m = s->__bits[i];
@@ -1185,9 +1184,7 @@ printsig(VAR *v, const sigset_t *s, enum
 	sn++;
 if (len + sn >= maxlen) {
 	maxlen += 1024;
-	buf = realloc(buf, maxlen);
-	if (buf == NULL)
-		err(EXIT_FAILURE, NULL);
+	buf = erealloc(buf, maxlen);
 }
 snprintf(buf + len, sn + 1, "%s%s",
 len == 0 ? "" : ",", n);
@@ -1204,15 +1201,23 

CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 22:01:17 UTC 2021

Modified Files:
src/bin/ps: keyword.c print.c ps.c ps.h

Log Message:
use emalloc and friends, add ktrace flag printing.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/bin/ps/keyword.c
cvs rdiff -u -r1.136 -r1.137 src/bin/ps/print.c
cvs rdiff -u -r1.96 -r1.97 src/bin/ps/ps.c
cvs rdiff -u -r1.31 -r1.32 src/bin/ps/ps.h

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



CVS commit: src/sys/sys

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 17:10:46 UTC 2021

Modified Files:
src/sys/sys: acct.h sysctl.h

Log Message:
Provide some snprintb(3) formats.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/acct.h
cvs rdiff -u -r1.234 -r1.235 src/sys/sys/sysctl.h

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

Modified files:

Index: src/sys/sys/acct.h
diff -u src/sys/sys/acct.h:1.27 src/sys/sys/acct.h:1.28
--- src/sys/sys/acct.h:1.27	Sat Jan 10 21:45:55 2009
+++ src/sys/sys/acct.h	Tue Sep 14 13:10:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: acct.h,v 1.27 2009/01/11 02:45:55 christos Exp $	*/
+/*	$NetBSD: acct.h,v 1.28 2021/09/14 17:10:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -66,6 +66,14 @@ struct acct {
 	uint8_t   ac_flag;	/* accounting flags */
 };
 
+#define	__ACCT_FLAG_BITS \
+	"\020" \
+	"\1FORK" \
+	"\2SU" \
+	"\3COMPAT" \
+	"\4CORE" \
+	"\5XSIG"
+
 /*
  * 1/AHZ is the granularity of the data encoded in the comp_t fields.
  * This is not necessarily equal to hz.

Index: src/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.234 src/sys/sys/sysctl.h:1.235
--- src/sys/sys/sysctl.h:1.234	Sat Jul 24 09:28:14 2021
+++ src/sys/sys/sysctl.h	Tue Sep 14 13:10:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.234 2021/07/24 13:28:14 simonb Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.235 2021/09/14 17:10:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -548,6 +548,34 @@ struct kinfo_proc2 {
  */
 #define	L_DETACHED		0x0080
 
+#define	__SYSCTL_PROC_FLAG_BITS \
+	"\20" \
+	"\1ADVLOCK" \
+	"\2CONTROLT" \
+	"\3INMEM" \
+	"\4NOCLDSTOP" \
+	"\5PPWAIT" \
+	"\6PROFIL" \
+	"\7SELECT" \
+	"\10SINTR" \
+	"\11SUGID" \
+	"\12SYSTEM" \
+	"\13SA" \
+	"\14TRACED" \
+	"\15WAITED" \
+	"\16WEXIT" \
+	"\17EXEC" \
+	"\20OWEUPC" \
+	"\22NOCLDWAIT" \
+	"\22P32" \
+	"\24CLDSIGIGN" \
+	"\26SYSTRACE" \
+	"\27CHTRACED" \
+	"\30STOPFORK" \
+	"\31STOPEXEC" \
+	"\32STOPEXIT" \
+	"\33SYSCALL"
+
 /*
  * KERN_LWP structure. See notes on KERN_PROC2 about adding elements.
  */



CVS commit: src/sys/sys

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 17:10:46 UTC 2021

Modified Files:
src/sys/sys: acct.h sysctl.h

Log Message:
Provide some snprintb(3) formats.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/acct.h
cvs rdiff -u -r1.234 -r1.235 src/sys/sys/sysctl.h

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



CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 17:09:18 UTC 2021

Modified Files:
src/bin/ps: Makefile keyword.c print.c ps.1 ps.h

Log Message:
Provide symbolic printing of some keywords by capitalizing them.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/bin/ps/Makefile src/bin/ps/ps.h
cvs rdiff -u -r1.57 -r1.58 src/bin/ps/keyword.c
cvs rdiff -u -r1.135 -r1.136 src/bin/ps/print.c
cvs rdiff -u -r1.112 -r1.113 src/bin/ps/ps.1

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

Modified files:

Index: src/bin/ps/Makefile
diff -u src/bin/ps/Makefile:1.30 src/bin/ps/Makefile:1.31
--- src/bin/ps/Makefile:1.30	Tue Apr  6 00:49:41 2021
+++ src/bin/ps/Makefile	Tue Sep 14 13:09:18 2021
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.30 2021/04/06 04:49:41 simonb Exp $
+#	$NetBSD: Makefile,v 1.31 2021/09/14 17:09:18 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/2/93
 
 PROG=		ps
 SRCS=		fmt.c keyword.c nlist.c print.c ps.c
-DPADD=		${LIBM} ${LIBKVM}
-LDADD=		-lm -lkvm
+DPADD=		${LIBUTIL} ${LIBM} ${LIBKVM}
+LDADD=		-lutil -lm -lkvm
 
 COPTS.print.c = -Wno-format-nonliteral -Wno-format-y2k
 
Index: src/bin/ps/ps.h
diff -u src/bin/ps/ps.h:1.30 src/bin/ps/ps.h:1.31
--- src/bin/ps/ps.h:1.30	Fri Sep 10 18:11:03 2021
+++ src/bin/ps/ps.h	Tue Sep 14 13:09:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ps.h,v 1.30 2021/09/10 22:11:03 rillig Exp $	*/
+/*	$NetBSD: ps.h,v 1.31 2021/09/14 17:09:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -44,7 +44,7 @@ enum type {
 	UNSPECIFIED,
 	CHAR, UCHAR, SHORT, USHORT, INT, UINT, LONG, ULONG,
 	KPTR, KPTR24, INT32, UINT32, SIGLIST, INT64, UINT64,
-	TIMEVAL, CPUTIME, PCPU, VSIZE
+	TIMEVAL, CPUTIME, PCPU, VSIZE, PROCFLAG, PROCACFLAG
 };
 
 /* Variables. */
@@ -73,6 +73,7 @@ typedef struct var {
 #define	LWP	0x10		/* dispatch to kinfo_lwp routine */
 #define	UAREA	0x20		/* need to check p_uvalid */
 #define	ALIAS	0x40		/* entry is alias for 'header' */
+#define	ALTPR	0x80		/* use alternate printing method */
 	u_int	flag;
 /* output routine */
 	void	(*oproc)(struct pinfo *pi, struct varent *, enum mode);

Index: src/bin/ps/keyword.c
diff -u src/bin/ps/keyword.c:1.57 src/bin/ps/keyword.c:1.58
--- src/bin/ps/keyword.c:1.57	Tue Aug  6 14:07:51 2019
+++ src/bin/ps/keyword.c	Tue Sep 14 13:09:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: keyword.c,v 1.57 2019/08/06 18:07:51 kamil Exp $	*/
+/*	$NetBSD: keyword.c,v 1.58 2021/09/14 17:09:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyword.c	8.5 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: keyword.c,v 1.57 2019/08/06 18:07:51 kamil Exp $");
+__RCSID("$NetBSD: keyword.c,v 1.58 2021/09/14 17:09:18 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -49,6 +49,7 @@ __RCSID("$NetBSD: keyword.c,v 1.57 2019/
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -103,7 +104,7 @@ static int  vcmp(const void *, const voi
 VAR var[] = {
 	VAR6("%cpu", "%CPU", 0, pcpu, 0, PCPU),
 	VAR6("%mem", "%MEM", 0, pmem, POFF(p_vm_rssize), INT32),
-	PVAR("acflag", "ACFLG", 0, p_acflag, USHORT, "x"),
+	PVAR("acflag", "ACFLG", 0, p_acflag, PROCACFLAG, "x"),
 	VAR3("acflg", "acflag", ALIAS),
 	VAR3("args", "command", ALIAS),
 	VAR3("blocked", "sigmask", ALIAS),
@@ -120,7 +121,7 @@ VAR var[] = {
 	VAR6("etime", "ELAPSED", 0, elapsed, POFF(p_ustart_sec), TIMEVAL),
 	UID("euid", "EUID", p_uid),
 	VAR4("euser", "EUSER", LJUST, usrname),
-	PVAR("f", "F", 0, p_flag, INT, "x"),
+	PVAR("f", "F", 0, p_flag, PROCFLAG, "x"),
 	VAR3("flags", "f", ALIAS),
 	GID("gid", "GID", p_gid),
 	VAR4("group", "GROUP", LJUST, gname),
@@ -359,12 +360,16 @@ findvar(const char *p)
 {
 	VAR *v;
 	char *hp;
+	char pp[1024];
+	strlcpy(pp, p, sizeof(pp));
 
-	hp = strchr(p, '=');
+	hp = strchr(pp, '=');
 	if (hp)
 		*hp++ = '\0';
+	for (char *dp = pp; *dp; dp++)
+		*dp = tolower((unsigned char)*dp);
 
-	v = bsearch(p, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
+	v = bsearch(pp, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
 	if (v && v->flag & ALIAS)
 		v = findvar(v->header);
 	if (!v) {
@@ -373,7 +378,17 @@ findvar(const char *p)
 		return NULL;
 	}
 
-	if (v && hp) {
+	if (!hp && *p == *pp)
+		return v;
+
+	struct var *newvar;
+
+	if ((newvar = malloc(sizeof(*newvar))) == NULL)
+		err(EXIT_FAILURE, NULL);
+	memcpy(newvar, v, sizeof(*newvar));
+	v = newvar;
+
+	if (hp) {
 		/*
 		 * Override the header.
 		 *
@@ -382,16 +397,10 @@ findvar(const char *p)
 		 * used multiple times with different headers.  We also
 		 * need to strdup the header.
 		 */
-		struct var *newvar;
 		char *newheader;
-
-		if ((newvar = malloc(sizeof(struct var))) == NULL)
-			err(EXIT_FAILURE, NULL);
 		if ((newheader = strdup(hp)) == NULL)
 			err(EXIT_FAILURE, NULL);
-		memcpy(newvar, v, sizeof(struct var));
 		newvar->header = newheader;
-
 		/*
 		 * According to P1003.1-2004, if the header text 

CVS commit: src/bin/ps

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 17:09:18 UTC 2021

Modified Files:
src/bin/ps: Makefile keyword.c print.c ps.1 ps.h

Log Message:
Provide symbolic printing of some keywords by capitalizing them.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/bin/ps/Makefile src/bin/ps/ps.h
cvs rdiff -u -r1.57 -r1.58 src/bin/ps/keyword.c
cvs rdiff -u -r1.135 -r1.136 src/bin/ps/print.c
cvs rdiff -u -r1.112 -r1.113 src/bin/ps/ps.1

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



CVS commit: src/bin/sh

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 15:04:09 UTC 2021

Modified Files:
src/bin/sh: histedit.c

Log Message:
Quote the filenames like before


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/histedit.c

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

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.56 src/bin/sh/histedit.c:1.57
--- src/bin/sh/histedit.c:1.56	Sun Aug 15 06:17:55 2021
+++ src/bin/sh/histedit.c	Tue Sep 14 11:04:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $	*/
+/*	$NetBSD: histedit.c,v 1.57 2021/09/14 15:04:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.57 2021/09/14 15:04:09 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -622,9 +622,9 @@ out:
 unsigned char
 sh_complete(EditLine *sel, int ch __unused)
 {
-	return (unsigned char)fn_complete(sel, NULL, sh_matches,
+	return (unsigned char)fn_complete2(sel, NULL, sh_matches,
 		L" \t\n\"\\'`@$><=;|&{(", NULL, NULL, (size_t)100,
-		NULL, &((int) {0}), NULL, NULL);
+		NULL, &((int) {0}), NULL, NULL, FN_QUOTE_MATCH);
 }
 
 static int



CVS commit: src/bin/sh

2021-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 14 15:04:09 UTC 2021

Modified Files:
src/bin/sh: histedit.c

Log Message:
Quote the filenames like before


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/histedit.c

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



CVS commit: src/bin/csh

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 20:55:03 UTC 2021

Modified Files:
src/bin/csh: const.c csh.1 err.c init.c proc.c

Log Message:
like zsh, have jobs -Z do setproctitle


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/bin/csh/const.c
cvs rdiff -u -r1.54 -r1.55 src/bin/csh/csh.1
cvs rdiff -u -r1.23 -r1.24 src/bin/csh/err.c
cvs rdiff -u -r1.11 -r1.12 src/bin/csh/init.c
cvs rdiff -u -r1.40 -r1.41 src/bin/csh/proc.c

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

Modified files:

Index: src/bin/csh/const.c
diff -u src/bin/csh/const.c:1.10 src/bin/csh/const.c:1.11
--- src/bin/csh/const.c:1.10	Tue Jan 22 15:35:29 2013
+++ src/bin/csh/const.c	Sat Sep 11 16:55:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: const.c,v 1.10 2013/01/22 20:35:29 christos Exp $ */
+/* $NetBSD: const.c,v 1.11 2021/09/11 20:55:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)const.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: const.c,v 1.10 2013/01/22 20:35:29 christos Exp $");
+__RCSID("$NetBSD: const.c,v 1.11 2021/09/11 20:55:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -108,6 +108,7 @@ Char STRmail[]		= { 'm', 'a', 'i', 'l', 
 Char STRmh[]= { '-', 'h', '\0' };
 Char STRminus[]		= { '-', '\0' };
 Char STRml[]		= { '-', 'l', '\0' };
+Char STRmZ[]		= { '-', 'Z', '\0' };
 Char STRmn[]		= { '-', 'n', '\0' };
 Char STRmquestion[] = { '?' | QUOTE, ' ', '\0' };
 Char STRnice[]		= { 'n', 'i', 'c', 'e', '\0' };

Index: src/bin/csh/csh.1
diff -u src/bin/csh/csh.1:1.54 src/bin/csh/csh.1:1.55
--- src/bin/csh/csh.1:1.54	Mon Jul  3 17:33:22 2017
+++ src/bin/csh/csh.1	Sat Sep 11 16:55:03 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: csh.1,v 1.54 2017/07/03 21:33:22 wiz Exp $
+.\"	$NetBSD: csh.1,v 1.55 2021/09/11 20:55:03 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)csh.1	8.2 (Berkeley) 1/21/94
 .\"
-.Dd August 8, 2016
+.Dd September 11, 2021
 .Dt CSH 1
 .Os
 .Sh NAME
@@ -1336,10 +1336,14 @@ must appear alone on its input line or a
 .Ic else . )
 .Pp
 .It Ic jobs
-.It Ic jobs Fl l
+.It Ic jobs Fl lZ
 Lists the active jobs; the
 .Fl l
 option lists process id's in addition to the normal information.
+The
+.Fl Z
+option sets the process title using
+.Xr setproctitle 3.
 .Pp
 .It Ic kill % Ns Ar job
 .It Ic kill Ar pid ...

Index: src/bin/csh/err.c
diff -u src/bin/csh/err.c:1.23 src/bin/csh/err.c:1.24
--- src/bin/csh/err.c:1.23	Sat Jan  5 11:54:00 2019
+++ src/bin/csh/err.c	Sat Sep 11 16:55:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.23 2019/01/05 16:54:00 christos Exp $ */
+/* $NetBSD: err.c,v 1.24 2021/09/11 20:55:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)err.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: err.c,v 1.23 2019/01/05 16:54:00 christos Exp $");
+__RCSID("$NetBSD: err.c,v 1.24 2021/09/11 20:55:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -171,7 +171,7 @@ static const char *errorlist[] =
 #define ERR_STRING	56
 "%s",
 #define ERR_JOBS	57
-"usage: jobs [ -l ]",
+"usage: jobs [ -lZ ]",
 #define ERR_JOBARGS	58
 "Arguments should be jobs or process id's",
 #define ERR_JOBCUR	59

Index: src/bin/csh/init.c
diff -u src/bin/csh/init.c:1.11 src/bin/csh/init.c:1.12
--- src/bin/csh/init.c:1.11	Tue Jan 22 14:28:00 2013
+++ src/bin/csh/init.c	Sat Sep 11 16:55:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.11 2013/01/22 19:28:00 christos Exp $ */
+/* $NetBSD: init.c,v 1.12 2021/09/11 20:55:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)init.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: init.c,v 1.11 2013/01/22 19:28:00 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.12 2021/09/11 20:55:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,7 +73,7 @@ struct biltins bfunc[] =
 { "hashstat", 	hashstat, 	0, 0	},
 { "history", 	dohist, 	0, 2	},
 { "if", 		doif, 		1, INF	},
-{ "jobs", 		dojobs, 	0, 1	},
+{ "jobs", 		dojobs, 	0, 2	},
 { "kill", 		dokill, 	1, INF	},
 { "limit", 		dolimit, 	0, 3	},
 { "linedit", 	doecho, 	0, INF	},

Index: src/bin/csh/proc.c
diff -u src/bin/csh/proc.c:1.40 src/bin/csh/proc.c:1.41
--- src/bin/csh/proc.c:1.40	Sat Aug  8 20:22:53 2020
+++ src/bin/csh/proc.c	Sat Sep 11 16:55:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.c,v 1.40 2020/08/09 00:22:53 dholland Exp $ */
+/* $NetBSD: proc.c,v 1.41 2021/09/11 20:55:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)proc.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: proc.c,v 1.40 2020/08/09 00:22:53 dholland Exp $");
+__RCSID("$NetBSD: proc.c,v 1.41 2021/09/11 20:55:03 christos Exp $");

CVS commit: src/bin/csh

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 20:55:03 UTC 2021

Modified Files:
src/bin/csh: const.c csh.1 err.c init.c proc.c

Log Message:
like zsh, have jobs -Z do setproctitle


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/bin/csh/const.c
cvs rdiff -u -r1.54 -r1.55 src/bin/csh/csh.1
cvs rdiff -u -r1.23 -r1.24 src/bin/csh/err.c
cvs rdiff -u -r1.11 -r1.12 src/bin/csh/init.c
cvs rdiff -u -r1.40 -r1.41 src/bin/csh/proc.c

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



CVS commit: src/bin/sh

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 20:43:32 UTC 2021

Modified Files:
src/bin/sh: jobs.c jobs.h sh.1

Log Message:
Add jobs -Z (like in zsh(1)) to setproctitle(3).


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/bin/sh/jobs.c
cvs rdiff -u -r1.24 -r1.25 src/bin/sh/jobs.h
cvs rdiff -u -r1.229 -r1.230 src/bin/sh/sh.1

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



CVS commit: src/bin/sh

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 20:43:32 UTC 2021

Modified Files:
src/bin/sh: jobs.c jobs.h sh.1

Log Message:
Add jobs -Z (like in zsh(1)) to setproctitle(3).


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/bin/sh/jobs.c
cvs rdiff -u -r1.24 -r1.25 src/bin/sh/jobs.h
cvs rdiff -u -r1.229 -r1.230 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.110 src/bin/sh/jobs.c:1.111
--- src/bin/sh/jobs.c:1.110	Sun Apr  4 09:24:07 2021
+++ src/bin/sh/jobs.c	Sat Sep 11 16:43:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.110 2021/04/04 13:24:07 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.111 2021/09/11 20:43:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.110 2021/04/04 13:24:07 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.111 2021/09/11 20:43:32 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -550,11 +550,23 @@ jobscmd(int argc, char **argv)
 	int mode, m;
 
 	mode = 0;
-	while ((m = nextopt("lp")))
-		if (m == 'l')
+	while ((m = nextopt("lpZ")))
+		switch (m) {
+		case 'l':
 			mode = SHOW_PID;
-		else
+			break;
+		case 'p':
 			mode = SHOW_PGID;
+			break;
+		case 'Z':
+			mode = SHOW_PROCTITLE;
+			break;
+		}
+
+	if (mode == SHOW_PROCTITLE) {
+		setproctitle("%s", *argptr);
+		return 0;
+	}
 
 	if (!iflag && !posix)
 		mode |= SHOW_NO_FREE;

Index: src/bin/sh/jobs.h
diff -u src/bin/sh/jobs.h:1.24 src/bin/sh/jobs.h:1.25
--- src/bin/sh/jobs.h:1.24	Sun Apr  4 09:24:07 2021
+++ src/bin/sh/jobs.h	Sat Sep 11 16:43:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.h,v 1.24 2021/04/04 13:24:07 kre Exp $	*/
+/*	$NetBSD: jobs.h,v 1.25 2021/09/11 20:43:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -49,6 +49,7 @@
 #define	SHOW_SIGNALLED	0x10	/* only if stopped/exited on signal */
 #define	SHOW_ISSIG	0x20	/* job was signalled */
 #define	SHOW_NO_FREE	0x40	/* do not free job */
+#define	SHOW_PROCTITLE	0x80	/* set the process title */
 
 
 /*

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.229 src/bin/sh/sh.1:1.230
--- src/bin/sh/sh.1:1.229	Fri Sep 18 03:21:26 2020
+++ src/bin/sh/sh.1	Sat Sep 11 16:43:32 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.229 2020/09/18 07:21:26 wiz Exp $
+.\"	$NetBSD: sh.1,v 1.230 2021/09/11 20:43:32 christos Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\"	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\"
-.Dd September 18, 2020
+.Dd September 11, 2021
 .Dt SH 1
 .\" everything except c o and s (keep them ordered)
 .ds flags abCEeFfhIiLmnpquVvXx
@@ -2977,7 +2977,7 @@ or with
 there is no process group leader (should not happen),
 and otherwise exits with status 0.
 .\"
-.It Ic jobs Oo Fl l Ns \&| Ns Fl p Oc Op Ar job ...
+.It Ic jobs Oo Fl l Ns \&| Ns Fl p \&| Fl Z Oc Op Ar job ...
 Without
 .Ar job
 arguments,
@@ -3005,6 +3005,11 @@ With the
 flag, the output contains only the process identifier of the lead
 process.
 .Pp
+With the
+.Fl Z
+flag, the process command line is set using
+.Xr setproctitle 3 .
+.Pp
 In an interactive shell, each job shown as completed in the output
 from the jobs command is implicitly waited for, and is removed from
 the jobs table, never to be seen again.



CVS commit: src/lib/librumpclient

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 14:23:04 UTC 2021

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
Ignore failed closes (if for example a closed file descriptor is passed as
a starting point). This is how the kernel behaves.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/librumpclient/rumpclient.c

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

Modified files:

Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.67 src/lib/librumpclient/rumpclient.c:1.68
--- src/lib/librumpclient/rumpclient.c:1.67	Tue Sep  6 03:45:41 2016
+++ src/lib/librumpclient/rumpclient.c	Sat Sep 11 10:23:04 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.67 2016/09/06 07:45:41 martin Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.68 2021/09/11 14:23:04 christos Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -50,7 +50,7 @@
 #define USE_SIGNALFD
 #endif
 
-__RCSID("$NetBSD: rumpclient.c,v 1.67 2016/09/06 07:45:41 martin Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.68 2021/09/11 14:23:04 christos Exp $");
 
 #include 
 #include 
@@ -1087,7 +1087,7 @@ int
 rumpclient__closenotify(int *fdp, enum rumpclient_closevariant variant)
 {
 	int fd = *fdp;
-	int untilfd, rv;
+	int untilfd;
 	int newfd;
 
 	switch (variant) {
@@ -1096,9 +1096,7 @@ rumpclient__closenotify(int *fdp, enum r
 		for (; fd <= untilfd; fd++) {
 			if (fd == clispc.spc_fd || fd == holyfd)
 continue;
-			rv = host_close(fd);
-			if (rv == -1)
-return -1;
+			(void)host_close(fd);
 		}
 		*fdp = fd;
 		break;



CVS commit: src/lib/librumpclient

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 14:23:04 UTC 2021

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
Ignore failed closes (if for example a closed file descriptor is passed as
a starting point). This is how the kernel behaves.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/librumpclient/rumpclient.c

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



CVS commit: src/lib/librumphijack

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 14:22:12 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
remove fake closefrom()


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.134 src/lib/librumphijack/hijack.c:1.135
--- src/lib/librumphijack/hijack.c:1.134	Sat Sep 11 04:32:11 2021
+++ src/lib/librumphijack/hijack.c	Sat Sep 11 10:22:12 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.134 2021/09/11 08:32:11 rillig Exp $	*/
+/*  $NetBSD: hijack.c,v 1.135 2021/09/11 14:22:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.134 2021/09/11 08:32:11 rillig Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.135 2021/09/11 14:22:12 christos Exp $");
 #endif
 
 #include 
@@ -2854,8 +2854,3 @@ nfssvc(int flags, void *argstructp)
 	return op_nfssvc(flags, argstructp);
 }
 #endif /* __NetBSD__ */
-
-int
-closefrom(int fd) {
-	return 0;
-}



CVS commit: src/lib/librumphijack

2021-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 11 14:22:12 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
remove fake closefrom()


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/lib/librumphijack/hijack.c

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



CVS commit: src/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 21:22:05 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Ignore closefrom(3) for now; too complicated to descern between regular
and rump fds.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.132 src/lib/librumphijack/hijack.c:1.133
--- src/lib/librumphijack/hijack.c:1.132	Fri Sep 10 16:33:38 2021
+++ src/lib/librumphijack/hijack.c	Fri Sep 10 17:22:05 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.132 2021/09/10 20:33:38 christos Exp $	*/
+/*  $NetBSD: hijack.c,v 1.133 2021/09/10 21:22:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.132 2021/09/10 20:33:38 christos Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.133 2021/09/10 21:22:05 christos Exp $");
 #endif
 
 #include 
@@ -2854,3 +2854,8 @@ nfssvc(int flags, void *argstructp)
 	return op_nfssvc(flags, argstructp);
 }
 #endif /* __NetBSD__ */
+
+int
+closefrom(int fd) {
+	return 0;
+}



CVS commit: src/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 21:22:05 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Ignore closefrom(3) for now; too complicated to descern between regular
and rump fds.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/lib/librumphijack/hijack.c

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



CVS commit: src/tests/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 21:21:35 UTC 2021

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
fix the ssh rump test


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/tests/lib/librumphijack/t_tcpip.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_tcpip.sh
diff -u src/tests/lib/librumphijack/t_tcpip.sh:1.19 src/tests/lib/librumphijack/t_tcpip.sh:1.20
--- src/tests/lib/librumphijack/t_tcpip.sh:1.19	Mon May 13 13:55:08 2019
+++ src/tests/lib/librumphijack/t_tcpip.sh	Fri Sep 10 17:21:35 2021
@@ -1,4 +1,4 @@
-#   $NetBSD: t_tcpip.sh,v 1.19 2019/05/13 17:55:08 bad Exp $
+#   $NetBSD: t_tcpip.sh,v 1.20 2021/09/10 21:21:35 christos Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -91,12 +91,14 @@ start_sshd() {
 	atf_check -s eq:0 -o empty -e empty chmod 400 ssh_host_key
 	atf_check -s eq:0 -o empty -e empty chmod 444 ssh_host_key.pub
 
+# Start in debugging mode so we don't have parent<->child privsep stuff
 env LD_PRELOAD=/usr/lib/librumphijack.so \
-	/usr/sbin/sshd -e -f ./sshd_config
-	while [ ! -f sshd.pid ]; do
-		sleep 0.01
-	done
-	echo "SSH server started (pid $(cat sshd.pid))"
+	/usr/sbin/sshd -d -e -E out -f ./sshd_config &
+#	while [ ! -f sshd.pid ]; do
+#		sleep 0.01
+#	done
+#	echo "SSH server started (pid $(cat sshd.pid))"
+	sleep 1
 
 	echo "Setting up SSH client configuration"
 	atf_check -s eq:0 -o empty -e empty \
@@ -122,8 +124,6 @@ ssh_head()
 
 ssh_body()
 {
-	atf_expect_fail "PR lib/50174"
-
 	atf_check -s exit:0 ${rumpnetsrv} ${RUMP_SERVER}
 	# make sure clients die after we nuke the server
 	export RUMPHIJACK_RETRYCONNECT='die'
@@ -137,7 +137,8 @@ ssh_body()
 	jot 11 12 | xargs mkdir
 	cd ..
 
-	atf_check -s exit:0 -o save:ssh.out\
+	# ignore stderr for now, prints environment in debug mode
+	atf_check -s exit:0 -o save:ssh.out -e ignore			\
 	env LD_PRELOAD=/usr/lib/librumphijack.so			\
 	ssh -T -F ssh_config 127.0.0.1 env BLOCKSIZE=512		\
 	ls -li $(pwd)/testdir



CVS commit: src/tests/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 21:21:35 UTC 2021

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
fix the ssh rump test


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/tests/lib/librumphijack/t_tcpip.sh

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



CVS commit: src/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 20:33:38 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
- implement pselect so that the ssh test has a chance to work
- 1 -> EXIT_FAILURE
- more info about fds


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.131 src/lib/librumphijack/hijack.c:1.132
--- src/lib/librumphijack/hijack.c:1.131	Wed May 27 14:55:36 2020
+++ src/lib/librumphijack/hijack.c	Fri Sep 10 16:33:38 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.131 2020/05/27 18:55:36 christos Exp $	*/
+/*  $NetBSD: hijack.c,v 1.132 2021/09/10 20:33:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.131 2020/05/27 18:55:36 christos Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.132 2021/09/10 20:33:38 christos Exp $");
 #endif
 
 #include 
@@ -187,6 +187,7 @@ enum dualcall {
 #if defined(__NetBSD__)
 
 #if !__NetBSD_Prereq__(5,99,7)
+#define REALSELECT pselect
 #define REALSELECT select
 #define REALPOLLTS pollts
 #define REALKEVENT kevent
@@ -199,6 +200,7 @@ enum dualcall {
 #define REALMKNOD mknod
 #define REALFHSTAT __fhstat40
 #else /* >= 5.99.7 */
+#define REALPSELECT _sys___pselect50
 #define REALSELECT _sys___select50
 #define REALPOLLTS _sys___pollts50
 #define REALKEVENT _sys___kevent50
@@ -248,6 +250,7 @@ int __getcwd(char *, size_t);
 #define REALREAD read
 #define REALPREAD pread
 #define REALPWRITE pwrite
+#define REALPSELECT pselect
 #define REALSELECT select
 #define REALPOLLTS ppoll
 #define REALUTIMES utimes
@@ -262,6 +265,8 @@ int __getcwd(char *, size_t);
 
 #endif /* platform */
 
+int REALPSELECT(int, fd_set *, fd_set *, fd_set *, const struct timespec *,
+		const sigset_t *);
 int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 int REALPOLLTS(struct pollfd *, nfds_t,
 	   const struct timespec *, const sigset_t *);
@@ -482,7 +487,7 @@ setdup2(int hostfd, int rumpfd)
 {
 
 	if (hostfd > DUP2HIGH) {
-		_DIAGASSERT(0);
+		_DIAGASSERT(/*CONSTCOND*/0);
 		return;
 	}
 
@@ -494,7 +499,7 @@ clrdup2(int hostfd)
 {
 
 	if (hostfd > DUP2HIGH) {
-		_DIAGASSERT(0);
+		_DIAGASSERT(/*CONSTCOND*/0);
 		return;
 	}
 
@@ -696,7 +701,7 @@ sockparser(char *buf)
 			}
 		}
 		if (socketmap[i].name == NULL) {
-			errx(1, "invalid socket specifier %s", p);
+			errx(EXIT_FAILURE, "invalid socket specifier %s", p);
 		}
 	}
 }
@@ -707,16 +712,17 @@ pathparser(char *buf)
 
 	/* sanity-check */
 	if (*buf != '/')
-		errx(1, "hijack path specifier must begin with ``/''");
+		errx(EXIT_FAILURE,
+		"hijack path specifier must begin with ``/''");
 	rumpprefixlen = strlen(buf);
 	if (rumpprefixlen < 2)
-		errx(1, "invalid hijack prefix: %s", buf);
+		errx(EXIT_FAILURE, "invalid hijack prefix: %s", buf);
 	if (buf[rumpprefixlen-1] == '/' && strspn(buf, "/") != rumpprefixlen)
-		errx(1, "hijack prefix may end in slash only if pure "
-		"slash, gave %s", buf);
+		errx(EXIT_FAILURE, "hijack prefix may end in slash only if "
+		"pure slash, gave %s", buf);
 
 	if ((rumpprefix = strdup(buf)) == NULL)
-		err(1, "strdup");
+		err(EXIT_FAILURE, "strdup");
 	rumpprefixlen = strlen(rumpprefix);
 }
 
@@ -737,19 +743,19 @@ blanketparser(char *buf)
 
 	blanket = malloc(nblanket * sizeof(*blanket));
 	if (blanket == NULL)
-		err(1, "alloc blanket %d", nblanket);
+		err(EXIT_FAILURE, "alloc blanket %d", nblanket);
 
 	for (p = strtok_r(buf, ":", ), i = 0; p;
 	p = strtok_r(NULL, ":", ), i++) {
 		blanket[i].pfx = strdup(p);
 		if (blanket[i].pfx == NULL)
-			err(1, "strdup blanket");
+			err(EXIT_FAILURE, "strdup blanket");
 		blanket[i].len = strlen(p);
 
 		if (blanket[i].len == 0 || *blanket[i].pfx != '/')
-			errx(1, "invalid blanket specifier %s", p);
+			errx(EXIT_FAILURE, "invalid blanket specifier %s", p);
 		if (*(blanket[i].pfx + blanket[i].len-1) == '/')
-			errx(1, "invalid blanket specifier %s", p);
+			errx(EXIT_FAILURE, "invalid blanket specifier %s", p);
 	}
 }
 
@@ -780,7 +786,8 @@ vfsparser(char *buf)
 	fullmask = 0;
 	for (i = 0; vfscalls[i].name != NULL; i++) {
 		if (fullmask & vfscalls[i].bit)
-			errx(1, "problem exists between vi and chair");
+			errx(EXIT_FAILURE,
+			"problem exists between vi and chair");
 		fullmask |= vfscalls[i].bit;
 	}
 
@@ -810,7 +817,7 @@ vfsparser(char *buf)
 			}
 		}
 		if (vfscalls[i].name == NULL) {
-			errx(1, "invalid vfscall specifier %s", p);
+			errx(EXIT_FAILURE, "invalid vfscall specifier %s", p);
 		}
 	}
 }
@@ -836,7 +843,7 @@ sysctlparser(char *buf)
 		return;
 	}
 
-	errx(1, "sysctl value should be y(es)/n(o), gave: %s", buf);
+	errx(EXIT_FAILURE, "sysctl value should be y(es)/n(o), gave: %s", 

CVS commit: src/lib/librumphijack

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 20:33:38 UTC 2021

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
- implement pselect so that the ssh test has a chance to work
- 1 -> EXIT_FAILURE
- more info about fds


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/lib/librumphijack/hijack.c

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



CVS commit: src/lib/libedit/TEST

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 13:33:45 UTC 2021

Added Files:
src/lib/libedit/TEST: fuzz1.c

Log Message:
Add an LLVM fuzzing wrapper for the portable libedit (Christian Holler)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libedit/TEST/fuzz1.c

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

Added files:

Index: src/lib/libedit/TEST/fuzz1.c
diff -u /dev/null src/lib/libedit/TEST/fuzz1.c:1.1
--- /dev/null	Fri Sep 10 09:33:45 2021
+++ src/lib/libedit/TEST/fuzz1.c	Fri Sep 10 09:33:45 2021
@@ -0,0 +1,63 @@
+/*
+ * build:
+ *   CC=clang CXX=clang++ CFLAGS="-fsanitize=address,fuzzer-no-link -g" \
+ *   	CXXFLAGS="-fsanitize=address,fuzzer-no-link -g" ./configure && make
+ * run:
+ *   LD_LIBRARY_PATH=../src/.libs/ .libs/fuzz1 -max_len=32 \
+ *	-use_value_profile=1 -only_ascii=1
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int init = 0;
+
+int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+  if (!Size)
+return 0;
+
+  if (!init) {
+setlocale(LC_CTYPE, "");
+stifle_history(7);
+init = 1;
+  }
+
+  clear_history();
+
+  size_t lasti = 0;
+
+  for (size_t i = 0;; ++i) {
+if (i == Size || Data[i] == '\n') {
+  if (i - lasti) {
+char *s = (char *)malloc(i - lasti + 1);
+memcpy(s, [lasti], i - lasti);
+s[i - lasti] = '\0';
+
+char *expansion;
+int result;
+
+#ifdef DEBUG
+fprintf(stderr, "Calling history_expand: >%s<\n", s);
+#endif
+result = history_expand(s, );
+
+if (result < 0 || result == 2) {
+  /* Errors ignored */
+} else {
+  add_history(expansion);
+}
+free(expansion);
+free(s);
+  }
+  lasti = i + 1;
+}
+
+if (i == Size)
+  break;
+  }
+
+  return 0;
+}



CVS commit: src/lib/libedit/TEST

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 13:33:45 UTC 2021

Added Files:
src/lib/libedit/TEST: fuzz1.c

Log Message:
Add an LLVM fuzzing wrapper for the portable libedit (Christian Holler)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libedit/TEST/fuzz1.c

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



CVS commit: src/lib/libedit

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 13:29:06 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
rl_startup_hook should be called each time. From Carlos Henrique Lima Melara


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.166 src/lib/libedit/readline.c:1.167
--- src/lib/libedit/readline.c:1.166	Thu Sep  9 16:25:30 2021
+++ src/lib/libedit/readline.c	Fri Sep 10 09:29:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -123,7 +123,6 @@ int readline_echoing_p = 1;
 int _rl_print_completions_horizontally = 0;
 VFunction *rl_redisplay_function = NULL;
 Function *rl_startup_hook = NULL;
-int rl_did_startup_hook = 0;
 VFunction *rl_completion_display_matches_hook = NULL;
 VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
 VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
@@ -425,8 +424,7 @@ readline(const char *p)
 
 	if (e == NULL || h == NULL)
 		rl_initialize();
-	if (rl_did_startup_hook == 0 && rl_startup_hook) {
-		rl_did_startup_hook = 1;
+	if (rl_startup_hook) {
 		(*rl_startup_hook)(NULL, 0);
 	}
 	tty_init(e);



CVS commit: src/lib/libedit

2021-09-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 10 13:29:06 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
rl_startup_hook should be called each time. From Carlos Henrique Lima Melara


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/lib/libedit/readline.c

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



CVS commit: src/lib/libedit

2021-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  9 20:25:30 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
fix memory issues found by fuzzing (double frees and buffer overflows)


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.165 src/lib/libedit/readline.c:1.166
--- src/lib/libedit/readline.c:1.165	Fri Sep  3 08:20:38 2021
+++ src/lib/libedit/readline.c	Thu Sep  9 16:25:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -624,8 +624,7 @@ get_history_event(const char *cmd, int *
 
 	if (sub) {
 		if (pat != last_search_pat) {
-			if (last_search_pat)
-el_free(last_search_pat);
+			el_free(last_search_pat);
 			last_search_pat = pat;
 		}
 		ret = history_search(pat, -1);
@@ -642,9 +641,8 @@ get_history_event(const char *cmd, int *
 	}
 
 	if (sub && len) {
-		if (last_search_match && last_search_match != pat)
-			el_free(last_search_match);
-		last_search_match = pat;
+		el_free(last_search_match);
+		last_search_match = strdup(pat);
 	}
 
 	if (pat != last_search_pat)
@@ -676,7 +674,7 @@ getfrom(const char **cmdp, char **fromp,
 	for (; *cmd && *cmd != delim; cmd++) {
 		if (*cmd == '\\' && cmd[1] == delim)
 			cmd++;
-		if (len >= size) {
+		if (len - 1 >= size) {
 			char *nwhat;
 			nwhat = el_realloc(what, (size <<= 1) * sizeof(*nwhat));
 			if (nwhat == NULL) {
@@ -707,6 +705,7 @@ getfrom(const char **cmdp, char **fromp,
 	}
 	if (!*cmd) {
 		el_free(what);
+		*fromp = NULL;
 		return -1;
 	}
 
@@ -715,6 +714,7 @@ getfrom(const char **cmdp, char **fromp,
 
 	if (!*cmd) {
 		el_free(what);
+		*fromp = NULL;
 		return -1;
 	}
 	return 1;
@@ -728,6 +728,7 @@ getto(const char **cmdp, char **top, con
 	size_t from_len = strlen(from);
 	const char *cmd = *cmdp;
 	char *with = el_realloc(*top, size * sizeof(*with));
+	*top = NULL;
 	if (with == NULL)
 		goto out;
 
@@ -848,7 +849,7 @@ _history_expand_command(const char *comm
 	/* Now parse any word designators */
 
 	if (*cmd == '%')	/* last word matched by ?pat? */
-		tmp = strdup(last_search_match? last_search_match:"");
+		tmp = strdup(last_search_match ? last_search_match : "");
 	else if (strchr("^*$-0123456789", *cmd)) {
 		start = end = -1;
 		if (*cmd == '^')
@@ -928,26 +929,30 @@ _history_expand_command(const char *comm
 continue;
 			/*FALLTHROUGH*/
 		case 's':
-			delim = *(++cmd), cmd++;	/* XXX: check */
-			if ((ev = getfrom(, , search, delim)) != 1) {
-el_free(tmp);
-return ev;
-			}
-			if ((ev = getto(, , from, delim)) != 1) {
-el_free(tmp);
-return ev;
-			}
+			ev = -1;
+			delim = *++cmd;
+			if (delim == '\0' || *++cmd == '\0')
+goto out;
+			if ((ev = getfrom(, , search, delim)) != 1)
+goto out;
+			if ((ev = getto(, , from, delim)) != 1)
+goto out;
 			aptr = _rl_compat_sub(tmp, from, to, g_on);
 			if (aptr) {
 el_free(tmp);
 tmp = aptr;
 			}
 			g_on = 0;
+			cmd--;
 			continue;
 		}
 	}
 	*result = tmp;
 	return p_on ? 2 : 1;
+out:
+	el_free(tmp);
+	return ev;
+	
 }
 
 



CVS commit: src/lib/libedit

2021-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  9 20:25:30 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
fix memory issues found by fuzzing (double frees and buffer overflows)


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/lib/libedit/readline.c

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



CVS commit: src/lib/libedit

2021-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  9 20:24:08 UTC 2021

Modified Files:
src/lib/libedit: refresh.c terminal.c

Log Message:
Add casts to appease conversions between wchar_t and wint_t


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/refresh.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libedit/terminal.c

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

Modified files:

Index: src/lib/libedit/refresh.c
diff -u src/lib/libedit/refresh.c:1.57 src/lib/libedit/refresh.c:1.58
--- src/lib/libedit/refresh.c:1.57	Mon Mar 30 02:54:37 2020
+++ src/lib/libedit/refresh.c	Thu Sep  9 16:24:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $	*/
+/*	$NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -105,7 +105,7 @@ re_nextline(EditLine *el)
 	 */
 	if (el->el_refresh.r_cursor.v + 1 >= el->el_terminal.t_size.v) {
 		int i, lins = el->el_terminal.t_size.v;
-		wchar_t *firstline = el->el_vdisplay[0];
+		wint_t *firstline = el->el_vdisplay[0];
 
 		for(i = 1; i < lins; i++)
 			el->el_vdisplay[i - 1] = el->el_vdisplay[i];
@@ -334,7 +334,8 @@ re_refresh(EditLine *el)
 	ELRE_DEBUG(1, (__F, "updating %d lines.\r\n", el->el_refresh.r_newcv));
 	for (i = 0; i <= el->el_refresh.r_newcv; i++) {
 		/* NOTE THAT re_update_line MAY CHANGE el_display[i] */
-		re_update_line(el, el->el_display[i], el->el_vdisplay[i], i);
+		re_update_line(el, (wchar_t *)el->el_display[i],
+		(wchar_t *)el->el_vdisplay[i], i);
 
 		/*
 		 * Copy the new line to be the current one, and pad out with
@@ -343,7 +344,8 @@ re_refresh(EditLine *el)
 		 * end of the screen line, it won't be a NUL or some old
 		 * leftover stuff.
 		 */
-		re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
+		re__copy_and_pad((wchar_t *)el->el_display[i],
+		(wchar_t *)el->el_vdisplay[i],
 		(size_t) el->el_terminal.t_size.h);
 	}
 	ELRE_DEBUG(1, (__F,
@@ -355,7 +357,8 @@ re_refresh(EditLine *el)
 			terminal_move_to_line(el, i);
 			terminal_move_to_char(el, 0);
 /* This wcslen should be safe even with MB_FILL_CHARs */
-			terminal_clear_EOL(el, (int) wcslen(el->el_display[i]));
+			terminal_clear_EOL(el,
+			(int) wcslen((const wchar_t *)el->el_display[i]));
 #ifdef DEBUG_REFRESH
 			terminal_overwrite(el, L"C\b", 2);
 #endif /* DEBUG_REFRESH */
@@ -1091,7 +1094,7 @@ re_refresh_cursor(EditLine *el)
 static void
 re_fastputc(EditLine *el, wint_t c)
 {
-	wchar_t *lastline;
+	wint_t *lastline;
 	int w;
 
 	w = wcwidth(c);
@@ -1126,7 +1129,8 @@ re_fastputc(EditLine *el, wint_t c)
 			el->el_cursor.v++;
 			lastline = el->el_display[++el->el_refresh.r_oldcv];
 		}
-		re__copy_and_pad(lastline, L"", (size_t)el->el_terminal.t_size.h);
+		re__copy_and_pad((wchar_t *)lastline, L"",
+		(size_t)el->el_terminal.t_size.h);
 
 		if (EL_HAS_AUTO_MARGINS) {
 			if (EL_HAS_MAGIC_MARGINS) {

Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.43 src/lib/libedit/terminal.c:1.44
--- src/lib/libedit/terminal.c:1.43	Fri Jul 10 16:34:24 2020
+++ src/lib/libedit/terminal.c	Thu Sep  9 16:24:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c	8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -588,7 +588,8 @@ mc_again:
  * NOTE THAT terminal_overwrite() WILL CHANGE
  * el->el_cursor.h!!!
  */
-terminal_overwrite(el, >el_display[
+terminal_overwrite(el,
+(wchar_t *)>el_display[
 el->el_cursor.v][el->el_cursor.h],
 (size_t)(where - el->el_cursor.h));
 



CVS commit: src/lib/libedit

2021-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  9 20:24:08 UTC 2021

Modified Files:
src/lib/libedit: refresh.c terminal.c

Log Message:
Add casts to appease conversions between wchar_t and wint_t


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/refresh.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libedit/terminal.c

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



CVS commit: src/distrib/evbarm/installimage

2021-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep  8 11:20:44 UTC 2021

Modified Files:
src/distrib/evbarm/installimage: Makefile

Log Message:
bump for clang/llvm


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/evbarm/installimage/Makefile

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



CVS commit: src/distrib/evbarm/installimage

2021-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep  8 11:20:44 UTC 2021

Modified Files:
src/distrib/evbarm/installimage: Makefile

Log Message:
bump for clang/llvm


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/evbarm/installimage/Makefile

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

Modified files:

Index: src/distrib/evbarm/installimage/Makefile
diff -u src/distrib/evbarm/installimage/Makefile:1.8 src/distrib/evbarm/installimage/Makefile:1.9
--- src/distrib/evbarm/installimage/Makefile:1.8	Mon Feb  8 14:11:41 2021
+++ src/distrib/evbarm/installimage/Makefile	Wed Sep  8 07:20:44 2021
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.8 2021/02/08 19:11:41 martin Exp $
+#	$NetBSD: Makefile,v 1.9 2021/09/08 11:20:44 christos Exp $
 
 .include 
 
 INSTIMGBASE=	NetBSD-${DISTRIBVER}-evbarm-${MACHINE_ARCH}-install	# gives ${IMGBASE}.img
 
-INSTIMAGEMB?=	1550			# for all installation binaries
+INSTIMAGEMB?=	1600			# for all installation binaries
 
 .if !empty(MACHINE_ARCH:Maarch64*)
 EFIBOOT=		${WORKDIR}/usr/mdec/bootaa64.efi



CVS commit: src/lib/libedit

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 12:20:38 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
Try to refactor this in order to correct some of the memory issues
reported by Christian Holler.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.164 src/lib/libedit/readline.c:1.165
--- src/lib/libedit/readline.c:1.164	Sat Aug 21 08:38:56 2021
+++ src/lib/libedit/readline.c	Fri Sep  3 08:20:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -460,14 +460,10 @@ readline(const char *p)
 	ret = el_gets(e, );
 
 	if (ret && count > 0) {
-		int lastidx;
-
 		buf = strdup(ret);
 		if (buf == NULL)
 			goto out;
-		lastidx = count - 1;
-		if (buf[lastidx] == '\n')
-			buf[lastidx] = '\0';
+		buf[strcspn(buf, "\n")] = '\0';
 	} else
 		buf = NULL;
 
@@ -665,6 +661,120 @@ get_history_event(const char *cmd, int *
 	return rptr;
 }
 
+static int
+getfrom(const char **cmdp, char **fromp, const char *search, int delim)
+{
+	size_t size = 16;
+	size_t len = 0;
+	const char *cmd = *cmdp;
+	char *what = el_realloc(*fromp, size * sizeof(*what));
+	if (what == NULL){
+		el_free(*fromp);
+		*fromp = NULL;
+		return 0;
+	}
+	for (; *cmd && *cmd != delim; cmd++) {
+		if (*cmd == '\\' && cmd[1] == delim)
+			cmd++;
+		if (len >= size) {
+			char *nwhat;
+			nwhat = el_realloc(what, (size <<= 1) * sizeof(*nwhat));
+			if (nwhat == NULL) {
+el_free(what);
+el_free(*fromp);
+*cmdp = cmd;
+*fromp = NULL;
+return 0;
+			}
+			what = nwhat;
+		}
+		what[len++] = *cmd;
+	}
+	what[len] = '\0';
+	*fromp = what;
+	*cmdp = cmd;
+	if (*what == '\0') {
+		el_free(what);
+		if (search) {
+			*fromp = strdup(search);
+			if (*fromp == NULL) {
+return 0;
+			}
+		} else {
+			*fromp = NULL;
+			return -1;
+		}
+	}
+	if (!*cmd) {
+		el_free(what);
+		return -1;
+	}
+
+	cmd++;	/* shift after delim */
+	*cmdp = cmd;
+
+	if (!*cmd) {
+		el_free(what);
+		return -1;
+	}
+	return 1;
+}
+
+static int
+getto(const char **cmdp, char **top, const char *from, int delim)
+{
+	size_t size = 16;
+	size_t len = 0;
+	size_t from_len = strlen(from);
+	const char *cmd = *cmdp;
+	char *with = el_realloc(*top, size * sizeof(*with));
+	if (with == NULL)
+		goto out;
+
+	for (; *cmd && *cmd != delim; cmd++) {
+		if (len + from_len + 1 >= size) {
+			char *nwith;
+			size += from_len + 1;
+			nwith = el_realloc(with, size * sizeof(*nwith));
+			if (nwith == NULL)
+goto out;
+			with = nwith;
+		}
+		if (*cmd == '&') {
+			/* safe */
+			strcpy([len], from);
+			len += from_len;
+			continue;
+		}
+		if (*cmd == '\\' && (*(cmd + 1) == delim || *(cmd + 1) == '&'))
+			cmd++;
+		with[len++] = *cmd;
+	}
+	if (!*cmd)
+		goto out;
+	with[len] = '\0';
+	*top = with;
+	*cmdp = cmd;
+	return 1;
+out:
+	el_free(with);
+	el_free(*top);
+	*top = NULL;
+	*cmdp = cmd;
+	return -1;
+}
+
+static void
+replace(char **tmp, int c)
+{
+	char *aptr;
+	if ((aptr = strrchr(*tmp, c)) == NULL)
+		return;
+	aptr = strdup(aptr + 1); // XXX: check
+	el_free(*tmp);
+	*tmp = aptr;
+}
+
 /*
  * the real function doing history expansion - takes as argument command
  * to do and data upon which the command should be executed
@@ -679,11 +789,11 @@ static int
 _history_expand_command(const char *command, size_t offs, size_t cmdlen,
 char **result)
 {
-	char *tmp, *search = NULL, *aptr;
+	char *tmp, *search = NULL, *aptr, delim;
 	const char *ptr, *cmd;
 	static char *from = NULL, *to = NULL;
 	int start, end, idx, has_mods = 0;
-	int p_on = 0, g_on = 0;
+	int p_on = 0, g_on = 0, ev;
 
 	*result = NULL;
 	aptr = NULL;
@@ -747,7 +857,7 @@ _history_expand_command(const char *comm
 			start = -1, cmd++;
 		else if (*cmd == '*')
 			start = 1, cmd++;
-	   else if (*cmd == '-' || isdigit((unsigned char) *cmd)) {
+		else if (*cmd == '-' || isdigit((unsigned char) *cmd)) {
 			start = 0;
 			while (*cmd && '0' <= *cmd && *cmd <= '9')
 start = start * 10 + *cmd++ - '0';
@@ -790,132 +900,54 @@ _history_expand_command(const char *comm
 	}
 
 	for (; *cmd; cmd++) {
-		if (*cmd == ':')
+		switch (*cmd) {
+		case ':':
 			continue;
-		else if (*cmd == 'h') {		/* remove trailing path */
+		case 'h': 	/* remove trailing path */
 			if ((aptr = strrchr(tmp, '/')) != NULL)
 *aptr = '\0';
-		} else if (*cmd == 't') {	/* remove 

CVS commit: src/lib/libedit

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 12:20:38 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
Try to refactor this in order to correct some of the memory issues
reported by Christian Holler.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libedit/readline.c

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



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 10:30:33 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: cipher-chachapoly-libcrypto.c
includes.h kexsntrup761x25519.c namespace.h sntrup761.c

Log Message:
add some more functions to namespace.h; add missing RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c \
src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c \
src/crypto/external/bsd/openssh/dist/sntrup761.c
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssh/dist/includes.h
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/dist/namespace.h

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c
diff -u src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.2
--- src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.1.1.1	Thu May 28 13:02:59 2020
+++ src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: cipher-chachapoly-libcrypto.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /*
  * Copyright (c) 2013 Damien Miller 
  *
@@ -15,6 +16,8 @@
  */
 
 /* $OpenBSD: cipher-chachapoly-libcrypto.c,v 1.1 2020/04/03 04:32:21 djm Exp $ */
+#include "includes.h"
+__RCSID("$NetBSD: cipher-chachapoly-libcrypto.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
 
 #include 
 #include  /* needed for log.h */
Index: src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c
diff -u src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.2
--- src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.1.1.1	Fri Mar  5 12:45:25 2021
+++ src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: kexsntrup761x25519.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /* $OpenBSD: kexsntrup761x25519.c,v 1.1 2020/12/29 00:59:15 djm Exp $ */
 /*
  * Copyright (c) 2019 Markus Friedl.  All rights reserved.
@@ -23,6 +24,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "includes.h"
+__RCSID("$NetBSD: kexsntrup761x25519.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
+
 #include 
 
 #include 
Index: src/crypto/external/bsd/openssh/dist/sntrup761.c
diff -u src/crypto/external/bsd/openssh/dist/sntrup761.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/sntrup761.c:1.2
--- src/crypto/external/bsd/openssh/dist/sntrup761.c:1.1.1.1	Fri Mar  5 12:45:26 2021
+++ src/crypto/external/bsd/openssh/dist/sntrup761.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: sntrup761.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /*  $OpenBSD: sntrup761.c,v 1.5 2021/01/08 02:33:13 dtucker Exp $ */
 
 /*
@@ -7,6 +8,8 @@
  * - Tanja Lange
  * - Christine van Vredendaal
  */
+#include "includes.h"
+__RCSID("$NetBSD: sntrup761.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
 
 #include 
 #include "crypto_api.h"

Index: src/crypto/external/bsd/openssh/dist/includes.h
diff -u src/crypto/external/bsd/openssh/dist/includes.h:1.8 src/crypto/external/bsd/openssh/dist/includes.h:1.9
--- src/crypto/external/bsd/openssh/dist/includes.h:1.8	Fri Apr  6 14:59:00 2018
+++ src/crypto/external/bsd/openssh/dist/includes.h	Fri Sep  3 06:30:33 2021
@@ -1,13 +1,14 @@
-/*	$NetBSD: includes.h,v 1.8 2018/04/06 18:59:00 christos Exp $	*/
+/*	$NetBSD: includes.h,v 1.9 2021/09/03 10:30:33 christos Exp $	*/
 #include 
 #ifndef __OpenBSD__
 #define __bounded__(a, b, c)
 #include 
+
+#include "namespace.h"
+
 void freezero(void *, size_t);
 #define explicit_bzero(a, b) explicit_memset((a), 0, (b))
 #define timingsafe_bcmp(a, b, c) (!consttime_memequal((a), (b), (c)))
-#include 
 void	*recallocarray(void *, size_t, size_t, size_t);
 #endif
 
-#include "namespace.h"

Index: src/crypto/external/bsd/openssh/dist/namespace.h
diff -u src/crypto/external/bsd/openssh/dist/namespace.h:1.9 src/crypto/external/bsd/openssh/dist/namespace.h:1.10
--- src/crypto/external/bsd/openssh/dist/namespace.h:1.9	Fri Mar  5 12:47:16 2021
+++ src/crypto/external/bsd/openssh/dist/namespace.h	Fri Sep  3 06:30:33 2021
@@ -1,27 +1,98 @@
-/*	$NetBSD: namespace.h,v 1.9 2021/03/05 17:47:16 christos Exp $	*/
+/*	$NetBSD: namespace.h,v 1.10 2021/09/03 10:30:33 christos Exp $	*/
 #ifndef _SSH_NAMESPACE_H_
-#define _SSH_NAMESPACE_H_
-#define addargs		ssh_addargs
-#define atomicio	ssh_atomicio
-#define chop		ssh_chop
-#define colon		ssh_colon
-#define convtime	ssh_convtime
-#define do_log		ssh_do_log
-#define freeargs	ssh_freeargs
-#define freerrset	ssh_freerrset
-#define hpdelim		ssh_hpdelim
-#define getpass		ssh_getpass
-#define getpeereid	ssh_getpeereid
-#define getrrsetbyname	

CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 10:30:33 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: cipher-chachapoly-libcrypto.c
includes.h kexsntrup761x25519.c namespace.h sntrup761.c

Log Message:
add some more functions to namespace.h; add missing RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c \
src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c \
src/crypto/external/bsd/openssh/dist/sntrup761.c
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssh/dist/includes.h
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/dist/namespace.h

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



CVS commit: src/distrib/sets/lists

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:28:45 UTC 2021

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump libssh


To generate a diff of this commit:
cvs rdiff -u -r1.924 -r1.925 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.281 -r1.282 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.924 src/distrib/sets/lists/base/shl.mi:1.925
--- src/distrib/sets/lists/base/shl.mi:1.924	Thu Aug 19 07:53:02 2021
+++ src/distrib/sets/lists/base/shl.mi	Thu Sep  2 07:28:45 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.924 2021/08/19 11:53:02 christos Exp $
+# $NetBSD: shl.mi,v 1.925 2021/09/02 11:28:45 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -882,8 +882,8 @@
 ./usr/lib/libsqlite3.so.1.4			base-sys-shlib		compatfile
 ./usr/lib/libss.sobase-obsolete		obsolete
 ./usr/lib/libssh.sobase-secsh-shlib	compatfile
-./usr/lib/libssh.so.40base-secsh-shlib	compatfile
-./usr/lib/libssh.so.40.0			base-secsh-shlib	compatfile
+./usr/lib/libssh.so.41base-secsh-shlib	compatfile
+./usr/lib/libssh.so.41.0			base-secsh-shlib	compatfile
 ./usr/lib/libssl.sobase-crypto-shlib	compatfile
 ./usr/lib/libssl.so.12base-crypto-shlib	compatfile,openssl=10
 ./usr/lib/libssl.so.12.0			base-crypto-shlib	compatfile,openssl=10

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.281 src/distrib/sets/lists/debug/shl.mi:1.282
--- src/distrib/sets/lists/debug/shl.mi:1.281	Thu Aug 19 07:53:02 2021
+++ src/distrib/sets/lists/debug/shl.mi	Thu Sep  2 07:28:45 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.281 2021/08/19 11:53:02 christos Exp $
+# $NetBSD: shl.mi,v 1.282 2021/09/02 11:28:45 christos Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
@@ -307,7 +307,7 @@
 ./usr/libdata/debug/usr/lib/libskey.so.2.0.debug		comp-sys-debug	debug,compatfile,skey
 ./usr/libdata/debug/usr/lib/libsl.so.6.0.debug			comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libsqlite3.so.1.4.debug		comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/libssh.so.40.0.debug		comp-secsh-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libssh.so.41.0.debug		comp-secsh-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libssl.so.12.0.debug		comp-crypto-debug	debug,compatfile,openssl=10
 ./usr/libdata/debug/usr/lib/libssl.so.14.0.debug		comp-crypto-debug	debug,compatfile,openssl=11
 ./usr/libdata/debug/usr/lib/libstdc++.so.9.0.debug		comp-sys-debug	debug,compatfile,gcc=9,cxx,libstdcxx



CVS commit: src/distrib/sets/lists

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:28:45 UTC 2021

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump libssh


To generate a diff of this commit:
cvs rdiff -u -r1.924 -r1.925 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.281 -r1.282 src/distrib/sets/lists/debug/shl.mi

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



CVS commit: src/doc

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:27:19 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
New OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1812 -r1.1813 src/doc/3RDPARTY
cvs rdiff -u -r1.2826 -r1.2827 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1812 src/doc/3RDPARTY:1.1813
--- src/doc/3RDPARTY:1.1812	Thu Aug 19 07:52:17 2021
+++ src/doc/3RDPARTY	Thu Sep  2 07:27:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1812 2021/08/19 11:52:17 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1813 2021/09/02 11:27:19 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1070,12 +1070,12 @@ Notes:
 Patch applied after OpenSSH import.
 
 Package:	OpenSSH
-Version:	8.6
-Current Vers:	8.6 / portable 8.6p1
+Version:	8.7
+Current Vers:	8.7 / portable 8.7p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html
-Date:		2021-04-19
+Date:		2021-09-02
 Mailing List:	openssh-unix-annou...@mindrot.org
 Responsible:	thorpej, christos, elric
 License:	BSD. See src/crypto/external/bsd/openssh/dist/LICENSE

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2826 src/doc/CHANGES:1.2827
--- src/doc/CHANGES:1.2826	Mon Aug 30 19:27:13 2021
+++ src/doc/CHANGES	Thu Sep  2 07:27:19 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2826 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2827 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -415,3 +415,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbarm: Support marvell-based machines in big-endian mode. Currently,
 		only KUROBOX_PRO has been tested. [rin 20210830]
 	evbarm: Add support for Apple M1. [jmcneill 20210830]
+	OpenSSH: Import 8.7. [christos 20210902]



CVS commit: src/doc

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:27:19 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
New OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1812 -r1.1813 src/doc/3RDPARTY
cvs rdiff -u -r1.2826 -r1.2827 src/doc/CHANGES

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



CVS commit: src/crypto/external/bsd/openssh

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:26:18 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/bin/scp: Makefile
src/crypto/external/bsd/openssh/dist: PROTOCOL PROTOCOL.certkeys
auth-options.c auth-options.h auth-pam.c auth.c auth2-hostbased.c
auth2-kbdint.c auth2-pubkey.c channels.c channels.h clientloop.c
compat.c compat.h dns.c dns.h hostfile.c krl.c log.c misc.c misc.h
monitor.c mux.c nchan.c packet.c packet.h readconf.c readconf.h
readpass.c scp.1 scp.c servconf.c servconf.h serverloop.c session.c
sftp-client.c sftp-client.h sftp-server.8 sftp-server.c sftp.1
sftp.c sk-usbhid.c ssh-keygen.1 ssh-keygen.c ssh-keysign.c
ssh-pkcs11-helper.c ssh-pkcs11.c ssh.1 ssh.c ssh_config.5
sshbuf-misc.c sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config
sshd_config.5 sshkey.c sshkey.h sshsig.c version.h
src/crypto/external/bsd/openssh/dist/moduli-gen: moduli.2048
moduli.3072 moduli.4096 moduli.6144 moduli.7680 moduli.8192
src/crypto/external/bsd/openssh/lib: shlib_version

Log Message:
Merge our changes from OpenSSH-8.6 to OpenSSH-8.7


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/bin/scp/Makefile
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/openssh/dist/PROTOCOL \
src/crypto/external/bsd/openssh/dist/readpass.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssh/dist/PROTOCOL.certkeys \
src/crypto/external/bsd/openssh/dist/nchan.c \
src/crypto/external/bsd/openssh/dist/sshbuf-misc.c
cvs rdiff -u -r1.26 -r1.27 \
src/crypto/external/bsd/openssh/dist/auth-options.c \
src/crypto/external/bsd/openssh/dist/misc.c \
src/crypto/external/bsd/openssh/dist/readconf.h \
src/crypto/external/bsd/openssh/dist/sshkey.c
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/openssh/dist/auth-options.h \
src/crypto/external/bsd/openssh/dist/compat.h \
src/crypto/external/bsd/openssh/dist/sshkey.h
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/auth-pam.c \
src/crypto/external/bsd/openssh/dist/auth2-hostbased.c \
src/crypto/external/bsd/openssh/dist/channels.h \
src/crypto/external/bsd/openssh/dist/krl.c
cvs rdiff -u -r1.30 -r1.31 src/crypto/external/bsd/openssh/dist/auth.c \
src/crypto/external/bsd/openssh/dist/channels.c \
src/crypto/external/bsd/openssh/dist/serverloop.c \
src/crypto/external/bsd/openssh/dist/ssh_config.5 \
src/crypto/external/bsd/openssh/dist/sshconnect.c
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssh/dist/auth2-kbdint.c \
src/crypto/external/bsd/openssh/dist/sftp-client.h \
src/crypto/external/bsd/openssh/dist/sftp-server.8
cvs rdiff -u -r1.28 -r1.29 \
src/crypto/external/bsd/openssh/dist/auth2-pubkey.c \
src/crypto/external/bsd/openssh/dist/ssh-keygen.1
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/dist/clientloop.c \
src/crypto/external/bsd/openssh/dist/sftp.c
cvs rdiff -u -r1.22 -r1.23 src/crypto/external/bsd/openssh/dist/compat.c \
src/crypto/external/bsd/openssh/dist/packet.h \
src/crypto/external/bsd/openssh/dist/ssh-pkcs11.c
cvs rdiff -u -r1.18 -r1.19 src/crypto/external/bsd/openssh/dist/dns.c
cvs rdiff -u -r1.11 -r1.12 src/crypto/external/bsd/openssh/dist/dns.h
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/dist/hostfile.c \
src/crypto/external/bsd/openssh/dist/ssh-pkcs11-helper.c
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/dist/log.c \
src/crypto/external/bsd/openssh/dist/scp.1
cvs rdiff -u -r1.21 -r1.22 src/crypto/external/bsd/openssh/dist/misc.h \
src/crypto/external/bsd/openssh/dist/ssh-keysign.c
cvs rdiff -u -r1.37 -r1.38 src/crypto/external/bsd/openssh/dist/monitor.c
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssh/dist/mux.c \
src/crypto/external/bsd/openssh/dist/ssh.1
cvs rdiff -u -r1.44 -r1.45 src/crypto/external/bsd/openssh/dist/packet.c
cvs rdiff -u -r1.34 -r1.35 src/crypto/external/bsd/openssh/dist/readconf.c \
src/crypto/external/bsd/openssh/dist/session.c \
src/crypto/external/bsd/openssh/dist/sshd_config.5
cvs rdiff -u -r1.31 -r1.32 src/crypto/external/bsd/openssh/dist/scp.c
cvs rdiff -u -r1.36 -r1.37 src/crypto/external/bsd/openssh/dist/servconf.c \
src/crypto/external/bsd/openssh/dist/ssh.c \
src/crypto/external/bsd/openssh/dist/version.h
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/dist/servconf.h \
src/crypto/external/bsd/openssh/dist/sshd_config
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssh/dist/sftp-client.c
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/sftp-server.c \
src/crypto/external/bsd/openssh/dist/sftp.1 \
src/crypto/external/bsd/openssh/dist/sshd.8
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/sk-usbhid.c
cvs rdiff -u -r1.39 

CVS commit: src/crypto/external/bsd/openssh

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:26:18 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/bin/scp: Makefile
src/crypto/external/bsd/openssh/dist: PROTOCOL PROTOCOL.certkeys
auth-options.c auth-options.h auth-pam.c auth.c auth2-hostbased.c
auth2-kbdint.c auth2-pubkey.c channels.c channels.h clientloop.c
compat.c compat.h dns.c dns.h hostfile.c krl.c log.c misc.c misc.h
monitor.c mux.c nchan.c packet.c packet.h readconf.c readconf.h
readpass.c scp.1 scp.c servconf.c servconf.h serverloop.c session.c
sftp-client.c sftp-client.h sftp-server.8 sftp-server.c sftp.1
sftp.c sk-usbhid.c ssh-keygen.1 ssh-keygen.c ssh-keysign.c
ssh-pkcs11-helper.c ssh-pkcs11.c ssh.1 ssh.c ssh_config.5
sshbuf-misc.c sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config
sshd_config.5 sshkey.c sshkey.h sshsig.c version.h
src/crypto/external/bsd/openssh/dist/moduli-gen: moduli.2048
moduli.3072 moduli.4096 moduli.6144 moduli.7680 moduli.8192
src/crypto/external/bsd/openssh/lib: shlib_version

Log Message:
Merge our changes from OpenSSH-8.6 to OpenSSH-8.7


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/bin/scp/Makefile
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/openssh/dist/PROTOCOL \
src/crypto/external/bsd/openssh/dist/readpass.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssh/dist/PROTOCOL.certkeys \
src/crypto/external/bsd/openssh/dist/nchan.c \
src/crypto/external/bsd/openssh/dist/sshbuf-misc.c
cvs rdiff -u -r1.26 -r1.27 \
src/crypto/external/bsd/openssh/dist/auth-options.c \
src/crypto/external/bsd/openssh/dist/misc.c \
src/crypto/external/bsd/openssh/dist/readconf.h \
src/crypto/external/bsd/openssh/dist/sshkey.c
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/openssh/dist/auth-options.h \
src/crypto/external/bsd/openssh/dist/compat.h \
src/crypto/external/bsd/openssh/dist/sshkey.h
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/auth-pam.c \
src/crypto/external/bsd/openssh/dist/auth2-hostbased.c \
src/crypto/external/bsd/openssh/dist/channels.h \
src/crypto/external/bsd/openssh/dist/krl.c
cvs rdiff -u -r1.30 -r1.31 src/crypto/external/bsd/openssh/dist/auth.c \
src/crypto/external/bsd/openssh/dist/channels.c \
src/crypto/external/bsd/openssh/dist/serverloop.c \
src/crypto/external/bsd/openssh/dist/ssh_config.5 \
src/crypto/external/bsd/openssh/dist/sshconnect.c
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssh/dist/auth2-kbdint.c \
src/crypto/external/bsd/openssh/dist/sftp-client.h \
src/crypto/external/bsd/openssh/dist/sftp-server.8
cvs rdiff -u -r1.28 -r1.29 \
src/crypto/external/bsd/openssh/dist/auth2-pubkey.c \
src/crypto/external/bsd/openssh/dist/ssh-keygen.1
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/dist/clientloop.c \
src/crypto/external/bsd/openssh/dist/sftp.c
cvs rdiff -u -r1.22 -r1.23 src/crypto/external/bsd/openssh/dist/compat.c \
src/crypto/external/bsd/openssh/dist/packet.h \
src/crypto/external/bsd/openssh/dist/ssh-pkcs11.c
cvs rdiff -u -r1.18 -r1.19 src/crypto/external/bsd/openssh/dist/dns.c
cvs rdiff -u -r1.11 -r1.12 src/crypto/external/bsd/openssh/dist/dns.h
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/dist/hostfile.c \
src/crypto/external/bsd/openssh/dist/ssh-pkcs11-helper.c
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/dist/log.c \
src/crypto/external/bsd/openssh/dist/scp.1
cvs rdiff -u -r1.21 -r1.22 src/crypto/external/bsd/openssh/dist/misc.h \
src/crypto/external/bsd/openssh/dist/ssh-keysign.c
cvs rdiff -u -r1.37 -r1.38 src/crypto/external/bsd/openssh/dist/monitor.c
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssh/dist/mux.c \
src/crypto/external/bsd/openssh/dist/ssh.1
cvs rdiff -u -r1.44 -r1.45 src/crypto/external/bsd/openssh/dist/packet.c
cvs rdiff -u -r1.34 -r1.35 src/crypto/external/bsd/openssh/dist/readconf.c \
src/crypto/external/bsd/openssh/dist/session.c \
src/crypto/external/bsd/openssh/dist/sshd_config.5
cvs rdiff -u -r1.31 -r1.32 src/crypto/external/bsd/openssh/dist/scp.c
cvs rdiff -u -r1.36 -r1.37 src/crypto/external/bsd/openssh/dist/servconf.c \
src/crypto/external/bsd/openssh/dist/ssh.c \
src/crypto/external/bsd/openssh/dist/version.h
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/dist/servconf.h \
src/crypto/external/bsd/openssh/dist/sshd_config
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssh/dist/sftp-client.c
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/sftp-server.c \
src/crypto/external/bsd/openssh/dist/sftp.1 \
src/crypto/external/bsd/openssh/dist/sshd.8
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/sk-usbhid.c
cvs rdiff -u -r1.39 

CVS import: src/crypto/external/bsd/openssh/dist

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:22:34 UTC 2021

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv15920

Log Message:
Import OpenSSH-8.7:

Imminent deprecation notice
===

OpenSSH will disable the ssh-rsa signature scheme by default in the
next release.

In the SSH protocol, the "ssh-rsa" signature scheme uses the SHA-1
hash algorithm in conjunction with the RSA public key algorithm.
It is now possible[1] to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K.

Note that the deactivation of "ssh-rsa" signatures does not necessarily
require cessation of use for RSA keys. In the SSH protocol, keys may be
capable of signing using multiple algorithms. In particular, "ssh-rsa"
keys are capable of signing using "rsa-sha2-256" (RSA/SHA256),
"rsa-sha2-512" (RSA/SHA512) and "ssh-rsa" (RSA/SHA1). Only the last of
these is being turned off by default.

This algorithm is unfortunately still used widely despite the
existence of better alternatives, being the only remaining public key
signature algorithm specified by the original SSH RFCs that is still
enabled by default.

The better alternatives include:

 * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These
   algorithms have the advantage of using the same key type as
   "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been
   supported since OpenSSH 7.2 and are already used by default if the
   client and server support them.

 * The RFC8709 ssh-ed25519 signature algorithm. It has been supported
   in OpenSSH since release 6.5.

 * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These
   have been supported by OpenSSH since release 5.7.

To check whether a server is using the weak ssh-rsa public key
algorithm, for host authentication, try to connect to it after
removing the ssh-rsa algorithm from ssh(1)'s allowed list:

ssh -oHostKeyAlgorithms=-ssh-rsa user@host

If the host key verification fails and no other supported host key
types are available, the server software on that host should be
upgraded.

OpenSSH recently enabled the UpdateHostKeys option by default to
assist the client by automatically migrating to better algorithms.

[1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and
Application to the PGP Web of Trust" Leurent, G and Peyrin, T
(2020) https://eprint.iacr.org/2020/014.pdf

Potentially-incompatible changes


This release includes a number of changes that may affect existing
configurations:

 * scp(1): this release changes the behaviour of remote to remote
   copies (e.g. "scp host-a:/path host-b:") to transfer through the
   local host by default. This was previously available via the -3
   flag. This mode avoids the need to expose credentials on the
   origin hop, avoids triplicate interpretation of filenames by the
   shell (by the local system, the copy origin and the destination)
   and, in conjunction with the SFTP support for scp(1) mentioned
   below, allows use of all authentication methods to the remote
   hosts (previously, only non-interactive methods could be used).
   A -R flag has been added to select the old behaviour.

 * ssh(1)/sshd(8): both the client and server are now using a
   stricter configuration file parser. The new parser uses more
   shell-like rules for quotes, space and escape characters. It is
   also more strict in rejecting configurations that include options
   lacking arguments. Previously some options (e.g. DenyUsers) could
   appear on a line with no subsequent arguments. This release will
   reject such configurations. The new parser will also reject
   configurations with unterminated quotes and multiple '='
   characters after the option name.

 * ssh(1): when using SSHFP DNS records for host key verification,
   ssh(1) will verify all matching records instead of just those
   with the specific signature type requested. This may cause host
   key verification problems if stale SSHFP records of a different
   or legacy signature type exist alongside other records for a
   particular host. bz#3322

 * ssh-keygen(1): when generating a FIDO key and specifying an
   explicit attestation challenge (using -Ochallenge), the challenge
   will now be hashed by the builtin security key middleware. This
   removes the (undocumented) requirement that challenges be exactly
   32 bytes in length and matches the expectations of libfido2.

 * sshd(8): environment="..." directives in authorized_keys files are
   now first-match-wins and limited to 1024 discrete environment
   variable names.

Changes since OpenSSH 8.6
=

This release contains a mix of new features and bug-fixes.

New features


 - scp(1): experimental support for transfers using the SFTP protocol
   as a replacement for the venerable SCP/RCP protocol that it has
   traditionally used. 

CVS import: src/crypto/external/bsd/openssh/dist

2021-09-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  2 11:22:34 UTC 2021

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv15920

Log Message:
Import OpenSSH-8.7:

Imminent deprecation notice
===

OpenSSH will disable the ssh-rsa signature scheme by default in the
next release.

In the SSH protocol, the "ssh-rsa" signature scheme uses the SHA-1
hash algorithm in conjunction with the RSA public key algorithm.
It is now possible[1] to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K.

Note that the deactivation of "ssh-rsa" signatures does not necessarily
require cessation of use for RSA keys. In the SSH protocol, keys may be
capable of signing using multiple algorithms. In particular, "ssh-rsa"
keys are capable of signing using "rsa-sha2-256" (RSA/SHA256),
"rsa-sha2-512" (RSA/SHA512) and "ssh-rsa" (RSA/SHA1). Only the last of
these is being turned off by default.

This algorithm is unfortunately still used widely despite the
existence of better alternatives, being the only remaining public key
signature algorithm specified by the original SSH RFCs that is still
enabled by default.

The better alternatives include:

 * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These
   algorithms have the advantage of using the same key type as
   "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been
   supported since OpenSSH 7.2 and are already used by default if the
   client and server support them.

 * The RFC8709 ssh-ed25519 signature algorithm. It has been supported
   in OpenSSH since release 6.5.

 * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These
   have been supported by OpenSSH since release 5.7.

To check whether a server is using the weak ssh-rsa public key
algorithm, for host authentication, try to connect to it after
removing the ssh-rsa algorithm from ssh(1)'s allowed list:

ssh -oHostKeyAlgorithms=-ssh-rsa user@host

If the host key verification fails and no other supported host key
types are available, the server software on that host should be
upgraded.

OpenSSH recently enabled the UpdateHostKeys option by default to
assist the client by automatically migrating to better algorithms.

[1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and
Application to the PGP Web of Trust" Leurent, G and Peyrin, T
(2020) https://eprint.iacr.org/2020/014.pdf

Potentially-incompatible changes


This release includes a number of changes that may affect existing
configurations:

 * scp(1): this release changes the behaviour of remote to remote
   copies (e.g. "scp host-a:/path host-b:") to transfer through the
   local host by default. This was previously available via the -3
   flag. This mode avoids the need to expose credentials on the
   origin hop, avoids triplicate interpretation of filenames by the
   shell (by the local system, the copy origin and the destination)
   and, in conjunction with the SFTP support for scp(1) mentioned
   below, allows use of all authentication methods to the remote
   hosts (previously, only non-interactive methods could be used).
   A -R flag has been added to select the old behaviour.

 * ssh(1)/sshd(8): both the client and server are now using a
   stricter configuration file parser. The new parser uses more
   shell-like rules for quotes, space and escape characters. It is
   also more strict in rejecting configurations that include options
   lacking arguments. Previously some options (e.g. DenyUsers) could
   appear on a line with no subsequent arguments. This release will
   reject such configurations. The new parser will also reject
   configurations with unterminated quotes and multiple '='
   characters after the option name.

 * ssh(1): when using SSHFP DNS records for host key verification,
   ssh(1) will verify all matching records instead of just those
   with the specific signature type requested. This may cause host
   key verification problems if stale SSHFP records of a different
   or legacy signature type exist alongside other records for a
   particular host. bz#3322

 * ssh-keygen(1): when generating a FIDO key and specifying an
   explicit attestation challenge (using -Ochallenge), the challenge
   will now be hashed by the builtin security key middleware. This
   removes the (undocumented) requirement that challenges be exactly
   32 bytes in length and matches the expectations of libfido2.

 * sshd(8): environment="..." directives in authorized_keys files are
   now first-match-wins and limited to 1024 discrete environment
   variable names.

Changes since OpenSSH 8.6
=

This release contains a mix of new features and bug-fixes.

New features


 - scp(1): experimental support for transfers using the SFTP protocol
   as a replacement for the venerable SCP/RCP protocol that it has
   traditionally used. 

CVS commit: src/tests/usr.sbin/inetd

2021-09-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep  1 06:12:51 UTC 2021

Modified Files:
src/tests/usr.sbin/inetd: Makefile t_inetd.c test_server.c

Log Message:
fix warnings


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/inetd/Makefile \
src/tests/usr.sbin/inetd/t_inetd.c src/tests/usr.sbin/inetd/test_server.c

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

Modified files:

Index: src/tests/usr.sbin/inetd/Makefile
diff -u src/tests/usr.sbin/inetd/Makefile:1.1 src/tests/usr.sbin/inetd/Makefile:1.2
--- src/tests/usr.sbin/inetd/Makefile:1.1	Sun Aug 29 05:54:18 2021
+++ src/tests/usr.sbin/inetd/Makefile	Wed Sep  1 02:12:50 2021
@@ -1,5 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2021/08/29 09:54:18 christos Exp $
+# $NetBSD: Makefile,v 1.2 2021/09/01 06:12:50 christos Exp $
 
+WARNS=6
 .include 
 
 TESTSDIR=${TESTSBASE}/usr.sbin/inetd
Index: src/tests/usr.sbin/inetd/t_inetd.c
diff -u src/tests/usr.sbin/inetd/t_inetd.c:1.1 src/tests/usr.sbin/inetd/t_inetd.c:1.2
--- src/tests/usr.sbin/inetd/t_inetd.c:1.1	Sun Aug 29 05:54:18 2021
+++ src/tests/usr.sbin/inetd/t_inetd.c	Wed Sep  1 02:12:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_inetd.c,v 1.1 2021/08/29 09:54:18 christos Exp $	*/
+/*	$NetBSD: t_inetd.c,v 1.2 2021/09/01 06:12:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_inetd.c,v 1.1 2021/08/29 09:54:18 christos Exp $");
+__RCSID("$NetBSD: t_inetd.c,v 1.2 2021/09/01 06:12:50 christos Exp $");
 
 #include 
 #include 
@@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_inetd.c,v 1.1 2021/0
 #define TCP 6
 #define UDP 17
 
-static pid_t	run(const char *, char **);
+static pid_t	run(const char *, char *const *);
 static char	*concat(const char *restrict, const char *restrict);
 static void	waitfor(pid_t, const char *);
 static bool	run_udp_client(const char *);
@@ -83,15 +83,15 @@ ATF_TC_BODY(test_ratelimit, tc)
 	);
 	
 	/* Run inetd in debug mode using specified config file */
-	proc = run("inetd", (char*[]) {
-	"inetd", "-d",
+	proc = run("inetd", (char* const []) {
+	__UNCONST("inetd"), __UNCONST("-d"),
 	concat(atf_tc_get_config_var(tc, "srcdir"),
 	"/inetd_ratelimit.conf"),
 	NULL
 	});
 
 	/* Wait for inetd to load services */
-	CHECK_ERROR(sleep(1));
+	sleep(1);
 
 	/*
 	 * TODO test dgram/nowait? Specified in manpage but doesn't seem to
@@ -151,6 +151,8 @@ ATF_TC_BODY(test_ratelimit, tc)
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, test_ratelimit);
+
+	return atf_no_error();
 }
 
 /* Return true if successfully received message, false if timeout */
@@ -177,10 +179,6 @@ run_udp_client(const char *port)
 		.msg_iovlen = 1
 	};
 
-	struct mmsghdr msglist = {
-		.msg_hdr = 
-	};
-	
 	ssize_t count = recvmsg(udp, , 0);
 	if (count == -1) {
 		if (errno == EAGAIN) {
@@ -254,7 +252,7 @@ create_socket(const char *address, const
 	ATF_REQUIRE_MSG(res->ai_next == NULL, "Ambiguous create_socket args");
 	CHECK_ERROR(fd = socket(res->ai_family, 
 	res->ai_socktype, res->ai_protocol));
-	struct timeval timeout = { timeout_sec };
+	struct timeval timeout = { timeout_sec, 0 };
 	CHECK_ERROR(setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, , 
 	sizeof(timeout)));
 	memcpy(dst, res->ai_addr, res->ai_addrlen);
@@ -264,7 +262,7 @@ create_socket(const char *address, const
 
 /* Run program with args */
 static pid_t
-run(const char *prog, char **args)
+run(const char *prog, char *const *args)
 {
 	pid_t proc;
 	extern char **environ;
@@ -278,7 +276,9 @@ static void
 waitfor(pid_t pid, const char *taskname)
 {
 	int status;
-	CHECK_ERROR(waitpid(pid, , WALLSIG) == pid);
+	int rpid = waitpid(pid, , WALLSIG);
+	ATF_REQUIRE_MSG(rpid == pid, "wait %d != %d %s",
+	rpid, pid, strerror(errno));
 
 	ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), EXIT_SUCCESS, 
 	"%s failed with "
Index: src/tests/usr.sbin/inetd/test_server.c
diff -u src/tests/usr.sbin/inetd/test_server.c:1.1 src/tests/usr.sbin/inetd/test_server.c:1.2
--- src/tests/usr.sbin/inetd/test_server.c:1.1	Sun Aug 29 05:54:18 2021
+++ src/tests/usr.sbin/inetd/test_server.c	Wed Sep  1 02:12:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: test_server.c,v 1.1 2021/08/29 09:54:18 christos Exp $	*/
+/*	$NetBSD: test_server.c,v 1.2 2021/09/01 06:12:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: test_server.c,v 1.1 2021/08/29 09:54:18 christos Exp $");
+__RCSID("$NetBSD: test_server.c,v 1.2 2021/09/01 06:12:50 christos Exp $");
 
 #include 
 #include 
@@ -91,18 +91,18 @@ main(int argc, char **argv)
 }
 
 static void
-stream_nowait_service()
+stream_nowait_service(void)
 {
 	ssize_t count;
 	char buffer[10];
 	CHECK(count = recv(0, buffer, sizeof(buffer), 0));
 	syslog(LOG_WARNING, "Received stream/nowait message \"%.*s\"\n",
-	count, buffer);
-	CHECK(send(1, buffer, count, 0));
+	(int)count, 

CVS commit: src/tests/usr.sbin/inetd

2021-09-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep  1 06:12:51 UTC 2021

Modified Files:
src/tests/usr.sbin/inetd: Makefile t_inetd.c test_server.c

Log Message:
fix warnings


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/inetd/Makefile \
src/tests/usr.sbin/inetd/t_inetd.c src/tests/usr.sbin/inetd/test_server.c

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



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 20:22:52 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: INSTALL

Log Message:
The INSTALL kernel needs to be small too


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/sun2/conf/INSTALL

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

Modified files:

Index: src/sys/arch/sun2/conf/INSTALL
diff -u src/sys/arch/sun2/conf/INSTALL:1.53 src/sys/arch/sun2/conf/INSTALL:1.54
--- src/sys/arch/sun2/conf/INSTALL:1.53	Wed Aug  1 16:04:14 2018
+++ src/sys/arch/sun2/conf/INSTALL	Mon Aug 30 16:22:52 2021
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.53 2018/08/01 20:04:14 maxv Exp $
+# $NetBSD: INSTALL,v 1.54 2021/08/30 20:22:52 christos Exp $
 
 # INSTALL Sun2 (2/120, 2/170, 2/50, ...)
 
@@ -6,9 +6,11 @@ include "arch/sun2/conf/std.sun2"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"INSTALL-$Revision: 1.53 $"
+#ident 		"INSTALL-$Revision: 1.54 $"
 
-makeoptions	COPTS="-Os"	# optimize for size
+makeoptions	COPTS="-Os -ffunction-sections -fdata-sections"	# optimize for size
+makeoptions	EXTRA_LINKFLAGS="--gc-sections"
+makeoptions	KERNLDSCRIPT="${SUN2}/conf/kern.ldscript"
 
 # Machines to be supported by this kernel
 #options 	FPU_EMULATE



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 20:22:52 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: INSTALL

Log Message:
The INSTALL kernel needs to be small too


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/sun2/conf/INSTALL

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



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 19:01:06 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: Makefile.sun2

Log Message:
Only use the ldscript for the RAMDISK kernel for now.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sun2/conf/Makefile.sun2

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

Modified files:

Index: src/sys/arch/sun2/conf/Makefile.sun2
diff -u src/sys/arch/sun2/conf/Makefile.sun2:1.28 src/sys/arch/sun2/conf/Makefile.sun2:1.29
--- src/sys/arch/sun2/conf/Makefile.sun2:1.28	Mon Aug 30 14:59:57 2021
+++ src/sys/arch/sun2/conf/Makefile.sun2	Mon Aug 30 15:01:05 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.sun2,v 1.28 2021/08/30 18:59:57 christos Exp $
+# $NetBSD: Makefile.sun2,v 1.29 2021/08/30 19:01:05 christos Exp $
 
 # Makefile for NetBSD
 #
@@ -34,8 +34,6 @@ GENASSYM_CONF=	${SUN2}/sun2/genassym.cf
 CPPFLAGS+=	-Dsun2
 CFLAGS+=	-msoft-float -fno-defer-pop
 AFLAGS+=	-x assembler-with-cpp
-KERNLDSCRIPT?= ${SUN2}/conf/kern.ldscript
-
 
 # XXX
 COPTS.promlib.c+=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 19:01:06 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: Makefile.sun2

Log Message:
Only use the ldscript for the RAMDISK kernel for now.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sun2/conf/Makefile.sun2

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



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 18:59:57 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: Makefile.sun2 RAMDISK
Added Files:
src/sys/arch/sun2/conf: kern.ldscript

Log Message:
use -ffunction-sections -fdata-sections --gc-sections with an ldscript
that keeps _start. This deletes all unused code and shrinks the RAMDISK
kernel enough to be able to boot again:

-rwxr-xr-x  1 root  src  2519436 Aug 30 06:38 RAMDISK.1/netbsd*
-rwxr-xr-x  1 root  src  2104440 Aug 30 07:41 RAMDISK/netbsd*

   textdata bss dec hex filename
   1525412  686252   63552 2275216  22b790 RAMDISK.1/netbsd
   1098524  686400   67008 1851932  1c421c RAMDISK/netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun2/conf/Makefile.sun2
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sun2/conf/RAMDISK
cvs rdiff -u -r0 -r1.1 src/sys/arch/sun2/conf/kern.ldscript

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

Modified files:

Index: src/sys/arch/sun2/conf/Makefile.sun2
diff -u src/sys/arch/sun2/conf/Makefile.sun2:1.27 src/sys/arch/sun2/conf/Makefile.sun2:1.28
--- src/sys/arch/sun2/conf/Makefile.sun2:1.27	Mon Oct  5 06:42:53 2020
+++ src/sys/arch/sun2/conf/Makefile.sun2	Mon Aug 30 14:59:57 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.sun2,v 1.27 2020/10/05 10:42:53 rin Exp $
+# $NetBSD: Makefile.sun2,v 1.28 2021/08/30 18:59:57 christos Exp $
 
 # Makefile for NetBSD
 #
@@ -34,6 +34,8 @@ GENASSYM_CONF=	${SUN2}/sun2/genassym.cf
 CPPFLAGS+=	-Dsun2
 CFLAGS+=	-msoft-float -fno-defer-pop
 AFLAGS+=	-x assembler-with-cpp
+KERNLDSCRIPT?= ${SUN2}/conf/kern.ldscript
+
 
 # XXX
 COPTS.promlib.c+=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}

Index: src/sys/arch/sun2/conf/RAMDISK
diff -u src/sys/arch/sun2/conf/RAMDISK:1.60 src/sys/arch/sun2/conf/RAMDISK:1.61
--- src/sys/arch/sun2/conf/RAMDISK:1.60	Wed Apr  3 12:30:28 2019
+++ src/sys/arch/sun2/conf/RAMDISK	Mon Aug 30 14:59:57 2021
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.60 2019/04/03 16:30:28 christos Exp $
+# $NetBSD: RAMDISK,v 1.61 2021/08/30 18:59:57 christos Exp $
 
 # RAMDISK: Root/swap on ramdisk
 # This kernel is used to:
@@ -13,7 +13,9 @@ include "arch/sun2/conf/std.sun2"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-makeoptions	COPTS="-Os"	# optimize for size
+makeoptions	COPTS="-Os -ffunction-sections -fdata-sections"	# optimize for size
+makeoptions	EXTRA_LINKFLAGS="--gc-sections"
+makeoptions	KERNLDSCRIPT="${SUN2}/conf/kern.ldscript"
 
 # Machines to be supported by this kernel
 #options 	FPU_EMULATE

Added files:

Index: src/sys/arch/sun2/conf/kern.ldscript
diff -u /dev/null src/sys/arch/sun2/conf/kern.ldscript:1.1
--- /dev/null	Mon Aug 30 14:59:58 2021
+++ src/sys/arch/sun2/conf/kern.ldscript	Mon Aug 30 14:59:57 2021
@@ -0,0 +1,88 @@
+/*	$NetBSD: kern.ldscript,v 1.1 2021/08/30 18:59:57 christos Exp $	*/
+
+#include "assym.h"
+
+__PAGE_SIZE = 0x1000 ;
+
+ENTRY(_start)
+SECTIONS
+{
+	.text : AT (ADDR(.text) & 0x0fff)
+	{
+		KEEP(*(.text._start));
+		. = ALIGN(__PAGE_SIZE);
+		__text_user_start = . ;
+		*(.text.user)
+		. = ALIGN(__PAGE_SIZE);
+		__text_user_end = . ;
+
+		*(.text)
+		*(.text.*)
+		*(.stub)
+		. = ALIGN(__PAGE_SIZE);
+	} =0xCC
+	_etext = . ;
+	PROVIDE (etext = .) ;
+
+	/*
+	 * Push the rodata segment up to the next large page boundary so that we
+	 * can map the text segment with large pages.
+	 */
+	. = ALIGN(__PAGE_SIZE);
+
+	__rodata_start = . ;
+
+	.rodata :
+	{
+		*(.rodata)
+		*(.rodata.*)
+		. = ALIGN(COHERENCY_UNIT);
+		__CTOR_LIST__ = .;
+		*(.ctors)
+		__CTOR_END__ = .;
+	}
+
+	. = ALIGN(__PAGE_SIZE);
+
+	__data_start = . ;
+	.data :
+	{
+		*(.data)
+	}
+
+	. = ALIGN(COHERENCY_UNIT);
+	.data.cacheline_aligned :
+	{
+		*(.data.cacheline_aligned)
+	}
+	. = ALIGN(COHERENCY_UNIT);
+	.data.read_mostly :
+	{
+		*(.data.read_mostly)
+	}
+	. = ALIGN(COHERENCY_UNIT);
+
+	_edata = . ;
+	PROVIDE (edata = .) ;
+	__bss_start = . ;
+	.bss :
+	{
+		*(.bss)
+		*(.bss.*)
+		*(COMMON)
+		. = ALIGN(__PAGE_SIZE);
+	}
+
+	. = ALIGN(__PAGE_SIZE);
+
+	/* End of the kernel image */
+	__kernel_end = . ;
+
+	_end = . ;
+	PROVIDE (end = .) ;
+	.note.netbsd.ident :
+	{
+		KEEP(*(.note.netbsd.ident));
+	}
+}
+



CVS commit: src/sys/arch/sun2/conf

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 18:59:57 UTC 2021

Modified Files:
src/sys/arch/sun2/conf: Makefile.sun2 RAMDISK
Added Files:
src/sys/arch/sun2/conf: kern.ldscript

Log Message:
use -ffunction-sections -fdata-sections --gc-sections with an ldscript
that keeps _start. This deletes all unused code and shrinks the RAMDISK
kernel enough to be able to boot again:

-rwxr-xr-x  1 root  src  2519436 Aug 30 06:38 RAMDISK.1/netbsd*
-rwxr-xr-x  1 root  src  2104440 Aug 30 07:41 RAMDISK/netbsd*

   textdata bss dec hex filename
   1525412  686252   63552 2275216  22b790 RAMDISK.1/netbsd
   1098524  686400   67008 1851932  1c421c RAMDISK/netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun2/conf/Makefile.sun2
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sun2/conf/RAMDISK
cvs rdiff -u -r0 -r1.1 src/sys/arch/sun2/conf/kern.ldscript

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



CVS commit: src/usr.bin/xlint/lint2

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 18:03:52 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
Move the character one back so that we don't increment twice


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/lint2/read.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.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.59 src/usr.bin/xlint/lint2/read.c:1.60
--- src/usr.bin/xlint/lint2/read.c:1.59	Mon Aug 30 10:57:04 2021
+++ src/usr.bin/xlint/lint2/read.c	Mon Aug 30 14:03:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.59 2021/08/30 14:57:04 christos Exp $ */
+/* $NetBSD: read.c,v 1.60 2021/08/30 18:03:52 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.59 2021/08/30 14:57:04 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.60 2021/08/30 18:03:52 christos Exp $");
 #endif
 
 #include 
@@ -137,8 +137,11 @@ static short
 parse_short(const char **p)
 {
 
+	short s;
 	(*p)++;
-	return (short)parse_int(p);
+	s = (short)parse_int(p);
+	(*p)--;
+	return s;
 }
 
 void



CVS commit: src/usr.bin/xlint/lint2

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 18:03:52 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
Move the character one back so that we don't increment twice


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/usr.bin/xlint/lint2

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 14:57:04 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
Skip the current character before parsing the number of arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint2/read.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.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.58 src/usr.bin/xlint/lint2/read.c:1.59
--- src/usr.bin/xlint/lint2/read.c:1.58	Sun Aug 29 06:18:17 2021
+++ src/usr.bin/xlint/lint2/read.c	Mon Aug 30 10:57:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.58 2021/08/29 10:18:17 rillig Exp $ */
+/* $NetBSD: read.c,v 1.59 2021/08/30 14:57:04 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.58 2021/08/29 10:18:17 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.59 2021/08/30 14:57:04 christos Exp $");
 #endif
 
 #include 
@@ -137,6 +137,7 @@ static short
 parse_short(const char **p)
 {
 
+	(*p)++;
 	return (short)parse_int(p);
 }
 



CVS commit: src/usr.bin/xlint/lint2

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 14:57:04 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
Skip the current character before parsing the number of arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/lib/libc/stdlib

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 13:12:16 UTC 2021

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
Remove lint workarounds


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/stdlib/jemalloc.c

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

Modified files:

Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.53 src/lib/libc/stdlib/jemalloc.c:1.54
--- src/lib/libc/stdlib/jemalloc.c:1.53	Fri May 15 10:37:21 2020
+++ src/lib/libc/stdlib/jemalloc.c	Mon Aug 30 09:12:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.53 2020/05/15 14:37:21 joerg Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.54 2021/08/30 13:12:16 christos Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -117,7 +117,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.53 2020/05/15 14:37:21 joerg Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.54 2021/08/30 13:12:16 christos Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -1276,7 +1276,6 @@ stats_print(arena_t *arena)
  * Begin chunk management functions.
  */
 
-#ifndef lint
 static inline int
 chunk_comp(chunk_node_t *a, chunk_node_t *b)
 {
@@ -1293,8 +1292,7 @@ chunk_comp(chunk_node_t *a, chunk_node_t
 }
 
 /* Generate red-black tree code for chunks. */
-RB_GENERATE_STATIC(chunk_tree_s, chunk_node_s, link, chunk_comp);
-#endif
+RB_GENERATE_STATIC(chunk_tree_s, chunk_node_s, link, chunk_comp)
 
 static void *
 pages_map_align(void *addr, size_t size, int align)
@@ -1371,18 +1369,15 @@ chunk_alloc(size_t size)
 		 * to use them.
 		 */
 
-		/* LINTED */
 		tchunk = RB_MIN(chunk_tree_s, _chunks);
 		while (tchunk != NULL) {
 			/* Found an address range.  Try to recycle it. */
 
 			chunk = tchunk->chunk;
 			delchunk = tchunk;
-			/* LINTED */
 			tchunk = RB_NEXT(chunk_tree_s, _chunks, delchunk);
 
 			/* Remove delchunk from the tree. */
-			/* LINTED */
 			RB_REMOVE(chunk_tree_s, _chunks, delchunk);
 			base_chunk_node_dealloc(delchunk);
 
@@ -1465,15 +1460,12 @@ RETURN:
 		 * memory we just allocated.
 		 */
 		key.chunk = ret;
-		/* LINTED */
 		tchunk = RB_NFIND(chunk_tree_s, _chunks, );
 		while (tchunk != NULL
 		&& (uintptr_t)tchunk->chunk >= (uintptr_t)ret
 		&& (uintptr_t)tchunk->chunk < (uintptr_t)ret + size) {
 			delchunk = tchunk;
-			/* LINTED */
 			tchunk = RB_NEXT(chunk_tree_s, _chunks, delchunk);
-			/* LINTED */
 			RB_REMOVE(chunk_tree_s, _chunks, delchunk);
 			base_chunk_node_dealloc(delchunk);
 		}
@@ -1551,7 +1543,6 @@ chunk_dealloc(void *chunk, size_t size)
 node->chunk = (void *)((uintptr_t)chunk
 + (uintptr_t)offset);
 node->size = chunksize;
-/* LINTED */
 RB_INSERT(chunk_tree_s, _chunks, node);
 			}
 		}
@@ -1571,7 +1562,6 @@ chunk_dealloc(void *chunk, size_t size)
 			if (node != NULL) {
 node->chunk = (void *)(uintptr_t)chunk;
 node->size = chunksize;
-/* LINTED */
 RB_INSERT(chunk_tree_s, _chunks, node);
 			}
 		}
@@ -1644,7 +1634,6 @@ choose_arena(void)
 return choose_arena_hard();
 }
 
-#ifndef lint
 static inline int
 arena_chunk_comp(arena_chunk_t *a, arena_chunk_t *b)
 {
@@ -1666,10 +1655,8 @@ arena_chunk_comp(arena_chunk_t *a, arena
 }
 
 /* Generate red-black tree code for arena chunks. */
-RB_GENERATE_STATIC(arena_chunk_tree_s, arena_chunk_s, link, arena_chunk_comp);
-#endif
+RB_GENERATE_STATIC(arena_chunk_tree_s, arena_chunk_s, link, arena_chunk_comp)
 
-#ifndef lint
 static inline int
 arena_run_comp(arena_run_t *a, arena_run_t *b)
 {
@@ -1686,8 +1673,7 @@ arena_run_comp(arena_run_t *a, arena_run
 }
 
 /* Generate red-black tree code for arena runs. */
-RB_GENERATE_STATIC(arena_run_tree_s, arena_run_s, link, arena_run_comp);
-#endif
+RB_GENERATE_STATIC(arena_run_tree_s, arena_run_s, link, arena_run_comp)
 
 static inline void *
 arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin)
@@ -1896,7 +1882,6 @@ arena_chunk_alloc(arena_t *arena)
 		chunk = arena->spare;
 		arena->spare = NULL;
 
-		/* LINTED */
 		RB_INSERT(arena_chunk_tree_s, >chunks, chunk);
 	} else {
 		chunk = (arena_chunk_t *)chunk_alloc(chunksize);
@@ -1942,7 +1927,6 @@ arena_chunk_dealloc(arena_t *arena, aren
 	 * Remove chunk from the chunk tree, regardless of whether this chunk
 	 * will be cached, so that the arena does not use it.
 	 */
-	/* LINTED */
 	RB_REMOVE(arena_chunk_tree_s, >arena->chunks, chunk);
 
 	if (opt_hint == false) {
@@ -2145,10 +2129,8 @@ arena_bin_nonfull_run_get(arena_t *arena
 	unsigned i, remainder;
 
 	/* Look for a usable run. */
-	/* LINTED */
 	if ((run = RB_MIN(arena_run_tree_s, >runs)) != NULL) {
 		/* run is guaranteed to have available space. */
-		/* LINTED */
 		RB_REMOVE(arena_run_tree_s, >runs, run);
 #ifdef MALLOC_STATS
 		bin->stats.reruns++;
@@ -2621,7 +2603,6 @@ arena_dalloc(arena_t *arena, 

CVS commit: src/lib/libc/stdlib

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 13:12:16 UTC 2021

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
Remove lint workarounds


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/stdlib/jemalloc.c

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



CVS commit: src/common/lib/libc/gmon

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 12:52:32 UTC 2021

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
remove lint exclusion


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libc/gmon/mcount.c

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



CVS commit: src/common/lib/libc/gmon

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 12:52:32 UTC 2021

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
remove lint exclusion


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libc/gmon/mcount.c

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

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.16 src/common/lib/libc/gmon/mcount.c:1.17
--- src/common/lib/libc/gmon/mcount.c:1.16	Sat Aug 14 13:51:18 2021
+++ src/common/lib/libc/gmon/mcount.c	Mon Aug 30 08:52:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.16 2021/08/14 17:51:18 ryo Exp $	*/
+/*	$NetBSD: mcount.c,v 1.17 2021/08/30 12:52:32 christos Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)mcount.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mcount.c,v 1.16 2021/08/14 17:51:18 ryo Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.17 2021/08/30 12:52:32 christos Exp $");
 #endif
 #endif
 
@@ -95,13 +95,11 @@ extern struct gmonparam _gmondummy;
 struct gmonparam *_m_gmon_alloc(void);
 #endif
 
-#ifndef __LINT__
 _MCOUNT_DECL(u_long, u_long)
 #ifdef _KERNEL
 __attribute__((__no_instrument_function__))
 #endif
 __used;
-#endif
 
 /* XXX: make these interfaces */
 #ifdef _RUMPKERNEL
@@ -128,7 +126,6 @@ _MCOUNT_DECL(u_long, u_long)
  * both frompcindex and frompc.  Any reasonable, modern compiler will
  * perform this optimization.
  */
-#ifndef __LINT__
 /* _mcount; may be static, inline, etc */
 _MCOUNT_DECL(u_long frompc, u_long selfpc)
 {
@@ -275,7 +272,6 @@ overflow:
 #endif
 	return;
 }
-#endif
 
 #ifdef MCOUNT
 /*



Re: CVS commit: src

2021-08-30 Thread Christos Zoulas
In article ,
Tom Ivar Helbekkmo   wrote:
>Christos Zoulas  writes:
>
>> Module Name: src
>> Committed By:christos
>> Date:Sun Aug 29 09:54:18 UTC 2021
>>
>> Modified Files:
>>  src/distrib/sets/lists/debug: mi
>>  src/distrib/sets/lists/tests: mi
>>  src/etc/mtree: NetBSD.dist.tests
>>  src/tests/usr.sbin: Makefile
>>  src/usr.sbin/inetd: Makefile inetd.8 inetd.c
>> Added Files:
>>  src/tests/usr.sbin/inetd: Makefile inetd_ratelimit.conf t_inetd.c
>>  test_server.c
>>  src/usr.sbin/inetd: inetd.h parse_v2.c
>
>parse_v2.c contains a couple of comparisons of char values to -1.  On
>arm, this fails to build, because the compiler observes that those
>comparisons are always false.
>
>-tih

Thanks for fixing it.

christos



CVS commit: src/lib/libedit

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 09:18:17 UTC 2021

Added Files:
src/lib/libedit: ChangeLog

Log Message:
Add a changes file


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libedit/ChangeLog

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

Added files:

Index: src/lib/libedit/ChangeLog
diff -u /dev/null src/lib/libedit/ChangeLog:1.1
--- /dev/null	Mon Aug 30 05:18:17 2021
+++ src/lib/libedit/ChangeLog	Mon Aug 30 05:18:17 2021
@@ -0,0 +1,6 @@
+2021-08-29	Christos Zoulas	
+
+	Change default mappings:
+	map ^W to ed-delete-prev-word and not kill-region
+	map ^R to em-inc-search-next and not redisplay
+



CVS commit: src/lib/libedit

2021-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 30 09:18:17 UTC 2021

Added Files:
src/lib/libedit: ChangeLog

Log Message:
Add a changes file


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libedit/ChangeLog

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



CVS commit: src/usr.sbin/inetd

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 11:43:48 UTC 2021

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

Log Message:
remove -m32 accidentally committed


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/inetd/Makefile

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.26 src/usr.sbin/inetd/Makefile:1.27
--- src/usr.sbin/inetd/Makefile:1.26	Sun Aug 29 07:43:25 2021
+++ src/usr.sbin/inetd/Makefile	Sun Aug 29 07:43:48 2021
@@ -1,10 +1,8 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.26 2021/08/29 11:43:25 christos Exp $
+#	$NetBSD: Makefile,v 1.27 2021/08/29 11:43:48 christos Exp $
 
 .include 
 
-COPTS+=-m32
-
 USE_FORT?= yes	# network server
 
 PROG=	inetd



CVS commit: src/usr.sbin/inetd

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 11:43:48 UTC 2021

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

Log Message:
remove -m32 accidentally committed


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/inetd/Makefile

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



CVS commit: src/usr.sbin/inetd

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 11:43:25 UTC 2021

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

Log Message:
fix printf formats (intmax -> j)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.127 -r1.128 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.25 src/usr.sbin/inetd/Makefile:1.26
--- src/usr.sbin/inetd/Makefile:1.25	Sun Aug 29 05:54:18 2021
+++ src/usr.sbin/inetd/Makefile	Sun Aug 29 07:43:25 2021
@@ -1,8 +1,10 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.25 2021/08/29 09:54:18 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2021/08/29 11:43:25 christos Exp $
 
 .include 
 
+COPTS+=-m32
+
 USE_FORT?= yes	# network server
 
 PROG=	inetd

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.127 src/usr.sbin/inetd/inetd.c:1.128
--- src/usr.sbin/inetd/inetd.c:1.127	Sun Aug 29 05:54:18 2021
+++ src/usr.sbin/inetd/inetd.c	Sun Aug 29 07:43:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.127 2021/08/29 09:54:18 christos Exp $	*/
+/*	$NetBSD: inetd.c,v 1.128 2021/08/29 11:43:25 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.127 2021/08/29 09:54:18 christos Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.128 2021/08/29 11:43:25 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -2713,9 +2713,9 @@ rl_process(struct servtab *sep, int ctrl
 			rl_reset(sep, now);
 		} else {
 			syslog(LOG_ERR,
-SERV_FMT ": max spawn rate (%zu in %zi seconds) "
+SERV_FMT ": max spawn rate (%zu in %ji seconds) "
 "already met, closing until end of timeout in "
-			"%zu seconds",
+			"%ju seconds",
 SERV_PARAMS(sep),
 sep->se_service_max,
 			(intmax_t)CNT_INTVL,
@@ -2770,7 +2770,7 @@ rl_process(struct servtab *sep, int ctrl
 	 */
 	syslog(LOG_ERR, SERV_FMT
 	": max ip spawn rate (%zu in " 
-	"%zi seconds) for "
+	"%ji seconds) for "
 	"%." TOSTRING(NI_MAXHOST) "s "
 	"already met; service not started",
 	SERV_PARAMS(sep),
@@ -2941,7 +2941,7 @@ rl_add(struct servtab *sep, char* ip)
 static void
 rl_reset(struct servtab *sep, time_t now)
 {
-	DPRINTF(SERV_FMT ": %zi seconds passed; resetting rate limiting ", 
+	DPRINTF(SERV_FMT ": %ji seconds passed; resetting rate limiting ", 
 	SERV_PARAMS(sep), (intmax_t)(now - sep->se_time));
 
 	sep->se_count = 0;



CVS commit: src/usr.sbin/inetd

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 11:43:25 UTC 2021

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

Log Message:
fix printf formats (intmax -> j)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.127 -r1.128 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: src

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:54:18 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
src/usr.sbin/inetd: Makefile inetd.8 inetd.c
Added Files:
src/tests/usr.sbin/inetd: Makefile inetd_ratelimit.conf t_inetd.c
test_server.c
src/usr.sbin/inetd: inetd.h parse_v2.c

Log Message:
Inetd enhancements by James Browning, Gabe Coffland, Alex Gavin, Solomon Ritzow
Described in:
https://www.mail-archive.com/tech-userlevel@netbsd.org/msg03114.html
And developed in:
https://github.com/ritzow/src/pull/1

>From their notes:

All new functionality should be explained by the updated manpage.

The manpage has been refactored a bit: A new section "Directives"
has been added and the information about default hostnames and
IPsec directives has been moved there, and the new file include
directive information is also there.

getconfigent has the most major changes. A newline is no longer
read immediately, but is called only by a "goto more" (inside an
if(false) block). This allows multiple definitions or directives
to exist on a single line for anything that doesn't terminate using
a newline. This means a key-values service definition can be followed
by another key-values service definition, a positional definition,
or an ipsec, hostname, or .include directive on the same line.

memset is no longer used explicitly to clear the servtab structure,
a function init_servtab() is used instead, which uses a C struct
initializer.

The servtab se_group field is its own allocation now, and not just
a pointer into the user:group string.

Refactored some stuff out of getconfigent to separate functions
for use by parse_v2.c. These functions in inetd.c are named with
the form parse_*()

parse_v2.c only has code for parsing a key-values service definition
into a provided servtab. It should not have anything that affects
global state other than line and line_number.

Some function prototypes, structures, and #defines have been moved
from inetd.c to inetd.h.

The function config_root replaces config as the function called on
a config file load/reload. The code removed from the end of
config(void) is now called in config_root, so it is not run on each
recursive config call.

setconfig(void) was removed and its code added into config_root
because that is the only place it is called, and redundant checks
for non-null globals were removed because they are always freed by
endconfig. The fseek code was also removed because the config files
are always closed by endconfig.

Rate limiting code was updated to add a per-service per-IP rate
limiting form. Some of that code was refactored out of other places
into functions with names in the form rl_*()

We have not added any of the license or version information to the
new files parse_v2.c, parse_v2.h, and inetd.h and we have not
updated the license or version info for inetd.c.

Security related:

The behavior when reading invalid IPsec strings has changed. Inetd
no longer exits, it quits reading the current config file instead.
Could this impact program security?

We have not checked for memory leaks. Solomon tried to use dmalloc
without success. getconfigent seemed to have a memory leak at each
"goto more". It seems like inetd has never free'd allocated strings
when throwing away erroneous service definitions during parsing
(i.e. when "goto more" is called when parsing fields). OpenBSD's
version calls freeconfig on "goto more"
(https://github.com/openbsd/src/blob/c5eae130d6c937080c3d30d124e8c8b86db7d625/usr.sbin/inetd/inetd.c#L1049)
but NetBSD only calls it when service definitions are no longer
needed. This has been fixed. freeconfig is called immediately before
any "goto more". There shouldn't be any time when a servtab is in
an invalid state where freeconfig would break.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1118 -r1.1119 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.187 -r1.188 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/inetd/Makefile \
src/tests/usr.sbin/inetd/inetd_ratelimit.conf \
src/tests/usr.sbin/inetd/t_inetd.c src/tests/usr.sbin/inetd/test_server.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.61 -r1.62 src/usr.sbin/inetd/inetd.8
cvs rdiff -u -r1.126 -r1.127 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/inetd/inetd.h \
src/usr.sbin/inetd/parse_v2.c

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.359 src/distrib/sets/lists/debug/mi:1.360
--- src/distrib/sets/lists/debug/mi:1.359	Thu Aug 12 09:27:42 

CVS commit: src

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:54:18 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
src/usr.sbin/inetd: Makefile inetd.8 inetd.c
Added Files:
src/tests/usr.sbin/inetd: Makefile inetd_ratelimit.conf t_inetd.c
test_server.c
src/usr.sbin/inetd: inetd.h parse_v2.c

Log Message:
Inetd enhancements by James Browning, Gabe Coffland, Alex Gavin, Solomon Ritzow
Described in:
https://www.mail-archive.com/tech-userlevel@netbsd.org/msg03114.html
And developed in:
https://github.com/ritzow/src/pull/1

>From their notes:

All new functionality should be explained by the updated manpage.

The manpage has been refactored a bit: A new section "Directives"
has been added and the information about default hostnames and
IPsec directives has been moved there, and the new file include
directive information is also there.

getconfigent has the most major changes. A newline is no longer
read immediately, but is called only by a "goto more" (inside an
if(false) block). This allows multiple definitions or directives
to exist on a single line for anything that doesn't terminate using
a newline. This means a key-values service definition can be followed
by another key-values service definition, a positional definition,
or an ipsec, hostname, or .include directive on the same line.

memset is no longer used explicitly to clear the servtab structure,
a function init_servtab() is used instead, which uses a C struct
initializer.

The servtab se_group field is its own allocation now, and not just
a pointer into the user:group string.

Refactored some stuff out of getconfigent to separate functions
for use by parse_v2.c. These functions in inetd.c are named with
the form parse_*()

parse_v2.c only has code for parsing a key-values service definition
into a provided servtab. It should not have anything that affects
global state other than line and line_number.

Some function prototypes, structures, and #defines have been moved
from inetd.c to inetd.h.

The function config_root replaces config as the function called on
a config file load/reload. The code removed from the end of
config(void) is now called in config_root, so it is not run on each
recursive config call.

setconfig(void) was removed and its code added into config_root
because that is the only place it is called, and redundant checks
for non-null globals were removed because they are always freed by
endconfig. The fseek code was also removed because the config files
are always closed by endconfig.

Rate limiting code was updated to add a per-service per-IP rate
limiting form. Some of that code was refactored out of other places
into functions with names in the form rl_*()

We have not added any of the license or version information to the
new files parse_v2.c, parse_v2.h, and inetd.h and we have not
updated the license or version info for inetd.c.

Security related:

The behavior when reading invalid IPsec strings has changed. Inetd
no longer exits, it quits reading the current config file instead.
Could this impact program security?

We have not checked for memory leaks. Solomon tried to use dmalloc
without success. getconfigent seemed to have a memory leak at each
"goto more". It seems like inetd has never free'd allocated strings
when throwing away erroneous service definitions during parsing
(i.e. when "goto more" is called when parsing fields). OpenBSD's
version calls freeconfig on "goto more"
(https://github.com/openbsd/src/blob/c5eae130d6c937080c3d30d124e8c8b86db7d625/usr.sbin/inetd/inetd.c#L1049)
but NetBSD only calls it when service definitions are no longer
needed. This has been fixed. freeconfig is called immediately before
any "goto more". There shouldn't be any time when a servtab is in
an invalid state where freeconfig would break.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1118 -r1.1119 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.187 -r1.188 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/inetd/Makefile \
src/tests/usr.sbin/inetd/inetd_ratelimit.conf \
src/tests/usr.sbin/inetd/t_inetd.c src/tests/usr.sbin/inetd/test_server.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.61 -r1.62 src/usr.sbin/inetd/inetd.8
cvs rdiff -u -r1.126 -r1.127 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/inetd/inetd.h \
src/usr.sbin/inetd/parse_v2.c

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



CVS commit: src/lib/libedit

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:41:59 UTC 2021

Modified Files:
src/lib/libedit: map.c

Log Message:
^W is traditionally bound to ed-delete-prev-word and not kill-region
^R is traditionally bound to em-inc-search-next and not redisplay
This is what mksh, zsh bash, readline do (Baptiste Daroussin)


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libedit/map.c

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

Modified files:

Index: src/lib/libedit/map.c
diff -u src/lib/libedit/map.c:1.53 src/lib/libedit/map.c:1.54
--- src/lib/libedit/map.c:1.53	Mon Mar 30 02:54:37 2020
+++ src/lib/libedit/map.c	Sun Aug 29 05:41:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: map.c,v 1.53 2020/03/30 06:54:37 ryo Exp $	*/
+/*	$NetBSD: map.c,v 1.54 2021/08/29 09:41:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)map.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: map.c,v 1.53 2020/03/30 06:54:37 ryo Exp $");
+__RCSID("$NetBSD: map.c,v 1.54 2021/08/29 09:41:59 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -85,12 +85,12 @@ static const el_action_t  el_map_emacs[]
 	/*  15 */	ED_IGNORE,		/* ^O */
 	/*  16 */	ED_PREV_HISTORY,	/* ^P */
 	/*  17 */	ED_IGNORE,		/* ^Q */
-	/*  18 */	ED_REDISPLAY,		/* ^R */
+	/*  18 */	EM_INC_SEARCH_PREV,	/* ^R */
 	/*  19 */	ED_IGNORE,		/* ^S */
 	/*  20 */	ED_TRANSPOSE_CHARS,	/* ^T */
 	/*  21 */	EM_KILL_LINE,		/* ^U */
 	/*  22 */	ED_QUOTED_INSERT,	/* ^V */
-	/*  23 */	EM_KILL_REGION,		/* ^W */
+	/*  23 */	ED_DELETE_PREV_WORD,	/* ^W */
 	/*  24 */	ED_SEQUENCE_LEAD_IN,	/* ^X */
 	/*  25 */	EM_YANK,		/* ^Y */
 	/*  26 */	ED_IGNORE,		/* ^Z */



CVS commit: src/lib/libedit

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:41:59 UTC 2021

Modified Files:
src/lib/libedit: map.c

Log Message:
^W is traditionally bound to ed-delete-prev-word and not kill-region
^R is traditionally bound to em-inc-search-next and not redisplay
This is what mksh, zsh bash, readline do (Baptiste Daroussin)


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libedit/map.c

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



CVS commit: src/sbin/restore

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:17:58 UTC 2021

Modified Files:
src/sbin/restore: interactive.c

Log Message:
Fix reversed test (thanks phone@)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sbin/restore/interactive.c

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

Modified files:

Index: src/sbin/restore/interactive.c
diff -u src/sbin/restore/interactive.c:1.30 src/sbin/restore/interactive.c:1.31
--- src/sbin/restore/interactive.c:1.30	Sun Aug 29 05:15:33 2021
+++ src/sbin/restore/interactive.c	Sun Aug 29 05:17:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: interactive.c,v 1.30 2021/08/29 09:15:33 christos Exp $	*/
+/*	$NetBSD: interactive.c,v 1.31 2021/08/29 09:17:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1985, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)interactive.c	8.5 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: interactive.c,v 1.30 2021/08/29 09:15:33 christos Exp $");
+__RCSID("$NetBSD: interactive.c,v 1.31 2021/08/29 09:17:58 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -597,7 +597,7 @@ mkentry(char *name, struct direct *dp, s
 	fp->fnum = dp->d_ino;
 	fp->fname = savename(dp->d_name);
 	for (cp = fp->fname; *cp; cp++)
-		if (!vflag && isprint((unsigned char)*cp))
+		if (!vflag && !isprint((unsigned char)*cp))
 			*cp = '?';
 	fp->len = cp - fp->fname;
 	if (dflag && TSTINO(fp->fnum, dumpmap) == 0)



CVS commit: src/sbin/restore

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:17:58 UTC 2021

Modified Files:
src/sbin/restore: interactive.c

Log Message:
Fix reversed test (thanks phone@)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sbin/restore/interactive.c

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



CVS commit: src/sbin/restore

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:15:33 UTC 2021

Modified Files:
src/sbin/restore: interactive.c

Log Message:
fix wrong size (thanks mlelstv@)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/restore/interactive.c

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

Modified files:

Index: src/sbin/restore/interactive.c
diff -u src/sbin/restore/interactive.c:1.29 src/sbin/restore/interactive.c:1.30
--- src/sbin/restore/interactive.c:1.29	Sat Jun 19 09:56:35 2021
+++ src/sbin/restore/interactive.c	Sun Aug 29 05:15:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: interactive.c,v 1.29 2021/06/19 13:56:35 christos Exp $	*/
+/*	$NetBSD: interactive.c,v 1.30 2021/08/29 09:15:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1985, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)interactive.c	8.5 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: interactive.c,v 1.29 2021/06/19 13:56:35 christos Exp $");
+__RCSID("$NetBSD: interactive.c,v 1.30 2021/08/29 09:15:33 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -371,7 +371,7 @@ getnext:
 		 * it then canonicalize and return it.
 		 */
 		snprintf(output, sizeof(output), "%s/%s", curdir, rawname);
-		canon(output, name, sizeof(name));
+		canon(output, name, size);
 	}
 	if ((globretval = glob(name, GLOB_ALTDIRFUNC, NULL, >glob)) < 0) {
 		fprintf(stderr, "%s: %s: ", ap->cmd, name);



CVS commit: src/sbin/restore

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:15:33 UTC 2021

Modified Files:
src/sbin/restore: interactive.c

Log Message:
fix wrong size (thanks mlelstv@)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/restore/interactive.c

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



CVS commit: src

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:02:01 UTC 2021

Modified Files:
src: build.sh

Log Message:
Fix rumptest target && enable separate rump target. From Damien Zammit


To generate a diff of this commit:
cvs rdiff -u -r1.354 -r1.355 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.354 src/build.sh:1.355
--- src/build.sh:1.354	Fri Aug  6 03:55:13 2021
+++ src/build.sh	Sun Aug 29 05:02:01 2021
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.354 2021/08/06 07:55:13 andvar Exp $
+#	$NetBSD: build.sh,v 1.355 2021/08/29 09:02:01 christos Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1965,7 +1965,7 @@ createmakewrapper()
 	eval cat <&1 -o /tmp/rumptest.$$ | \
+		-static --whole-archive -lpthread -lc ${set} 2>&1 -o /tmp/rumptest.$$ | \
 		  awk -v quirks="${md_quirks}" '
 			/undefined reference/ &&
 			!/more undefined references.*follow/{
@@ -2488,7 +2484,17 @@ main()
 			installworld "${arg}"
 			;;
 
-		rump|rumptest)
+		rump)
+			make_in_dir . do-distrib-dirs
+			make_in_dir . includes
+			make_in_dir lib/csu dependall
+			make_in_dir lib/csu install
+			make_in_dir external/gpl3/gcc/lib/libgcc dependall
+			make_in_dir external/gpl3/gcc/lib/libgcc install
+			dorump "${op}"
+			;;
+
+		rumptest)
 			dorump "${op}"
 			;;
 



CVS commit: src

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 09:02:01 UTC 2021

Modified Files:
src: build.sh

Log Message:
Fix rumptest target && enable separate rump target. From Damien Zammit


To generate a diff of this commit:
cvs rdiff -u -r1.354 -r1.355 src/build.sh

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



CVS commit: src/external/cddl/osnet/sys/sys

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 08:43:12 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: time.h

Log Message:
Include  for all GNU systems (hurd). From Damien Zammit


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/cddl/osnet/sys/sys/time.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/time.h
diff -u src/external/cddl/osnet/sys/sys/time.h:1.12 src/external/cddl/osnet/sys/sys/time.h:1.13
--- src/external/cddl/osnet/sys/sys/time.h:1.12	Sun Jun  3 01:55:08 2018
+++ src/external/cddl/osnet/sys/sys/time.h	Sun Aug 29 04:43:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.h,v 1.12 2018/06/03 05:55:08 chs Exp $	*/
+/*	$NetBSD: time.h,v 1.13 2021/08/29 08:43:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek 
@@ -96,7 +96,7 @@ ddi_get_lbolt64(void)
 int clock_gettime(clockid_t, struct timespec *)
 __RENAME(__clock_gettime50);
 #endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__GNU__)
 #include 
 #endif
 



CVS commit: src/external/cddl/osnet/sys/sys

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 08:43:12 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: time.h

Log Message:
Include  for all GNU systems (hurd). From Damien Zammit


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/cddl/osnet/sys/sys/time.h

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



CVS commit: src/external/gpl3/gcc/dist/libcpp

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 08:41:57 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libcpp: files.c

Log Message:
Add missing parentheses around ternary operator (Etienne Brateau, via
Damien Zammit)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/dist/libcpp/files.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/libcpp/files.c
diff -u src/external/gpl3/gcc/dist/libcpp/files.c:1.14 src/external/gpl3/gcc/dist/libcpp/files.c:1.15
--- src/external/gpl3/gcc/dist/libcpp/files.c:1.14	Sat Apr 10 20:02:18 2021
+++ src/external/gpl3/gcc/dist/libcpp/files.c	Sun Aug 29 04:41:57 2021
@@ -233,7 +233,7 @@ open_file (_cpp_file *file)
 }
   else
 file->fd = open (file->path, O_RDONLY | O_NOCTTY | O_BINARY
-		 | (cpp_restricted != NULL) ? O_NONBLOCK : 0, 0666);
+		 | ((cpp_restricted != NULL) ? O_NONBLOCK : 0), 0666);
 
 
   if (file->fd != -1)



CVS commit: src/external/gpl3/gcc/dist/libcpp

2021-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 29 08:41:57 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libcpp: files.c

Log Message:
Add missing parentheses around ternary operator (Etienne Brateau, via
Damien Zammit)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/dist/libcpp/files.c

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



CVS commit: src/lib/libedit

2021-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 28 17:17:48 UTC 2021

Modified Files:
src/lib/libedit: vi.c

Log Message:
Respect $EDITOR when execution one (Baptiste Daroussin)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libedit/vi.c

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

Modified files:

Index: src/lib/libedit/vi.c
diff -u src/lib/libedit/vi.c:1.63 src/lib/libedit/vi.c:1.64
--- src/lib/libedit/vi.c:1.63	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/vi.c	Sat Aug 28 13:17:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vi.c,v 1.63 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: vi.c,v 1.64 2021/08/28 17:17:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)vi.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: vi.c,v 1.63 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: vi.c,v 1.64 2021/08/28 17:17:47 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -1008,12 +1008,15 @@ vi_histedit(EditLine *el, wint_t c __att
 	char *cp = NULL;
 	size_t len;
 	wchar_t *line = NULL;
+	const char *editor;
 
 	if (el->el_state.doingarg) {
 		if (vi_to_history_line(el, 0) == CC_ERROR)
 			return CC_ERROR;
 	}
 
+	if ((editor = getenv("EDITOR")) == NULL)
+		editor = "vi";
 	fd = mkstemp(tempfile);
 	if (fd < 0)
 		return CC_ERROR;
@@ -1038,7 +1041,7 @@ vi_histedit(EditLine *el, wint_t c __att
 		goto error;
 	case 0:
 		close(fd);
-		execlp("vi", "vi", tempfile, (char *)NULL);
+		execlp(editor, editor, tempfile, (char *)NULL);
 		exit(0);
 		/*NOTREACHED*/
 	default:



CVS commit: src/lib/libedit

2021-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 28 17:17:48 UTC 2021

Modified Files:
src/lib/libedit: vi.c

Log Message:
Respect $EDITOR when execution one (Baptiste Daroussin)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libedit/vi.c

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



CVS commit: src/usr.bin/base64

2021-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 28 10:29:15 UTC 2021

Modified Files:
src/usr.bin/base64: base64.1

Log Message:
reflect reality.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/base64/base64.1

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

Modified files:

Index: src/usr.bin/base64/base64.1
diff -u src/usr.bin/base64/base64.1:1.3 src/usr.bin/base64/base64.1:1.4
--- src/usr.bin/base64/base64.1:1.3	Thu Sep  3 05:41:21 2020
+++ src/usr.bin/base64/base64.1	Sat Aug 28 06:29:15 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: base64.1,v 1.3 2020/09/03 09:41:21 nia Exp $
+.\"	$NetBSD: base64.1,v 1.4 2021/08/28 10:29:15 christos Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd September 3, 2020
+.Dd August 28, 2021
 .Dt BASE64 1
 .Os
 .Sh NAME
@@ -50,7 +50,7 @@ The following options are available:
 .It Fl d
 Decode the input instead of encoding it.
 .It Fl i
-Ignore whitespace characters when decoding.
+Ignore non-base64 characters when decoding. (not implemented)
 .It Fl w Ar wrap
 Wrap lines longer than
 .Ar wrap



CVS commit: src/usr.bin/base64

2021-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 28 10:29:15 UTC 2021

Modified Files:
src/usr.bin/base64: base64.1

Log Message:
reflect reality.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/base64/base64.1

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



CVS commit: src/usr.bin/base64

2021-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 17:53:13 UTC 2021

Modified Files:
src/usr.bin/base64: base64.c

Log Message:
make ignore whitespace the default


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/base64/base64.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.bin/base64/base64.c
diff -u src/usr.bin/base64/base64.c:1.4 src/usr.bin/base64/base64.c:1.5
--- src/usr.bin/base64/base64.c:1.4	Wed Aug 25 18:43:20 2021
+++ src/usr.bin/base64/base64.c	Fri Aug 27 13:53:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: base64.c,v 1.4 2021/08/25 22:43:20 rillig Exp $	*/
+/*	$NetBSD: base64.c,v 1.5 2021/08/27 17:53:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: base64.c,v 1.4 2021/08/25 22:43:20 rillig Exp $");
+__RCSID("$NetBSD: base64.c,v 1.5 2021/08/27 17:53:13 christos Exp $");
 
 #include 
 #include 
@@ -240,7 +240,7 @@ main(int argc, char *argv[])
 {
 	bool decode = false;
 	size_t wrap = 76;
-	bool ignore = false;
+	bool ignore = true;
 	int c;
 
 	while ((c = getopt(argc, argv, "b:Ddiw:")) != -1) {



CVS commit: src/usr.bin/base64

2021-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 27 17:53:13 UTC 2021

Modified Files:
src/usr.bin/base64: base64.c

Log Message:
make ignore whitespace the default


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

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



CVS commit: src/usr.bin/systat

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 13:22:19 UTC 2021

Modified Files:
src/usr.bin/systat: extern.h main.c systat.1 vmstat.c

Log Message:
PR/56331: Paul Goyette: Add -z option to display 0 instead of ' ' in vmstat.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/systat/extern.h
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/systat/main.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/systat/systat.1
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/systat/vmstat.c

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



CVS commit: src/usr.bin/systat

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 13:22:19 UTC 2021

Modified Files:
src/usr.bin/systat: extern.h main.c systat.1 vmstat.c

Log Message:
PR/56331: Paul Goyette: Add -z option to display 0 instead of ' ' in vmstat.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/systat/extern.h
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/systat/main.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/systat/systat.1
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/systat/vmstat.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.bin/systat/extern.h
diff -u src/usr.bin/systat/extern.h:1.47 src/usr.bin/systat/extern.h:1.48
--- src/usr.bin/systat/extern.h:1.47	Fri Jan 25 10:31:11 2019
+++ src/usr.bin/systat/extern.h	Sat Aug 21 09:22:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.47 2019/01/25 15:31:11 christos Exp $	*/
+/*	$NetBSD: extern.h,v 1.48 2021/08/21 13:22:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -64,6 +64,7 @@ extern int	turns;
 extern gid_t	egid;
 extern float	hertz;
 extern double	etime;
+extern bool 	showzero;
 
 struct inpcb;
 #ifdef INET6

Index: src/usr.bin/systat/main.c
diff -u src/usr.bin/systat/main.c:1.55 src/usr.bin/systat/main.c:1.56
--- src/usr.bin/systat/main.c:1.55	Fri Jan 25 10:31:11 2019
+++ src/usr.bin/systat/main.c	Sat Aug 21 09:22:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.55 2019/01/25 15:31:11 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.56 2021/08/21 13:22:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: main.c,v 1.55 2019/01/25 15:31:11 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.56 2021/08/21 13:22:19 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -81,6 +81,7 @@ int allcounter;
 sig_atomic_t needsredraw = 0;
 float	hertz;
 double	etime;
+bool	showzero = false;
 
 static	WINDOW *wload;			/* one line window for load average */
 
@@ -105,7 +106,7 @@ main(int argc, char **argv)
 	egid = getegid();
 	(void)setegid(getgid());
 
-	while ((ch = getopt(argc, argv, "M:N:bnw:t:")) != -1)
+	while ((ch = getopt(argc, argv, "M:N:bnw:t:z")) != -1)
 		switch(ch) {
 		case 'M':
 			memf = optarg;
@@ -121,11 +122,14 @@ main(int argc, char **argv)
 			break;
 		case 't':
 			if ((turns = atoi(optarg)) <= 0)
-errx(1, "turns <= 0.");
+errx(EXIT_FAILURE, "turns <= 0.");
 			break;
 		case 'w':
 			if ((naptime = strtod(optarg, NULL)) <= 0)
-errx(1, "interval <= 0.");
+errx(EXIT_FAILURE, "interval <= 0.");
+			break;
+		case 'z':
+			showzero = true;
 			break;
 		case '?':
 		default:
@@ -177,7 +181,7 @@ main(int argc, char **argv)
 
 	kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
 	if (kd == NULL)
-		errx(1, "%s", errbuf);
+		errx(EXIT_FAILURE, "%s", errbuf);
 
 	/* Get rid of privs for now. */
 	if (nlistf == NULL && memf == NULL)
@@ -195,7 +199,7 @@ main(int argc, char **argv)
 	 * routines to minimize update work by curses.
 	 */
 	if (initscr() == NULL)
-		errx(1, "couldn't initialize screen");
+		errx(EXIT_FAILURE, "couldn't initialize screen");
 
 	CMDLINE = LINES - 1;
 	wnd = (*curmode->c_open)();
@@ -248,9 +252,9 @@ main(int argc, char **argv)
 static void
 usage(void)
 {
-	fprintf(stderr, "usage: systat [-bn] [-M core] [-N system] [-w wait] "
-		"[-t turns]\n\t\t[display] [refresh-interval]\n");
-	exit(1);
+	fprintf(stderr, "usage: %s [-bnz] [-M core] [-N system] [-w wait] "
+	"[-t turns]\n\t\t[display] [refresh-interval]\n", getprogname());
+	exit(EXIT_FAILURE);
 }
 
 
@@ -366,7 +370,7 @@ die(int signo)
 	clrtoeol();
 	refresh();
 	endwin();
-	exit(0);
+	exit(EXIT_SUCCESS);
 }
 
 void
@@ -417,7 +421,7 @@ nlisterr(struct nlist name_list[])
 	clrtoeol();
 	refresh();
 	endwin();
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 
 bool

Index: src/usr.bin/systat/systat.1
diff -u src/usr.bin/systat/systat.1:1.51 src/usr.bin/systat/systat.1:1.52
--- src/usr.bin/systat/systat.1:1.51	Fri Dec 28 07:21:53 2018
+++ src/usr.bin/systat/systat.1	Sat Aug 21 09:22:19 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: systat.1,v 1.51 2018/12/28 12:21:53 wiz Exp $
+.\"	$NetBSD: systat.1,v 1.52 2021/08/21 13:22:19 christos Exp $
 .\"
 .\" Copyright (c) 1985, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)systat.1	8.2 (Berkeley) 12/30/93
 .\"
-.Dd December 26, 2018
+.Dd August 21, 2021
 .Dt SYSTAT 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd display system statistics in a full-screen view
 .Sh SYNOPSIS
 .Nm
-.Op Fl bn
+.Op Fl bnz
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl t Ar turns
@@ -141,6 +141,8 @@ This is provided for backwards compatibi
 specified with the
 .Fl w
 flag.
+.It Fl z
+Display 0 instead of space when there is no data.
 .El
 .Pp
 Certain characters cause immediate action by

Index: 

CVS commit: src/lib/libedit

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 12:38:56 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
PR/56370: mirabilos: libedit change from 2017 kills history in gdb


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.163 src/lib/libedit/readline.c:1.164
--- src/lib/libedit/readline.c:1.163	Sat Aug 21 08:34:59 2021
+++ src/lib/libedit/readline.c	Sat Aug 21 08:38:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.163 2021/08/21 12:34:59 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.163 2021/08/21 12:34:59 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -2078,6 +2078,7 @@ rl_callback_read_char(void)
 	const char *buf = el_gets(e, );
 	char *wbuf;
 
+	el_set(e, EL_UNBUFFERED, 1);
 	if (buf == NULL || count-- <= 0)
 		return;
 	if (count == 0 && buf[0] == e->el_tty.t_c[TS_IO][C_EOF])
@@ -2093,7 +2094,6 @@ rl_callback_read_char(void)
 		} else
 			wbuf = NULL;
 		(*(void (*)(const char *))rl_linefunc)(wbuf);
-		el_set(e, EL_UNBUFFERED, 1);
 	}
 }
 
@@ -2111,9 +2111,8 @@ rl_callback_handler_install(const char *
 void
 rl_callback_handler_remove(void)
 {
+	el_set(e, EL_UNBUFFERED, 0);
 	rl_linefunc = NULL;
-	el_end(e);
-	e = NULL;
 }
 
 void



CVS commit: src/lib/libedit

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 12:38:56 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
PR/56370: mirabilos: libedit change from 2017 kills history in gdb


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/lib/libedit/readline.c

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



CVS commit: src/lib/libedit

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 12:34:59 UTC 2021

Modified Files:
src/lib/libedit: readline.c
src/lib/libedit/readline: readline.h

Log Message:
Add more api to make gdb-11 happy (but not gdbtui as usual)


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/lib/libedit/readline.c
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/readline/readline.h

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.162 src/lib/libedit/readline.c:1.163
--- src/lib/libedit/readline.c:1.162	Sun Aug 15 18:22:52 2021
+++ src/lib/libedit/readline.c	Sat Aug 21 08:34:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig Exp $	*/
+/*	$NetBSD: readline.c,v 1.163 2021/08/21 12:34:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig Exp $");
+__RCSID("$NetBSD: readline.c,v 1.163 2021/08/21 12:34:59 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -108,6 +108,7 @@ int rl_attempted_completion_over = 0;
 const char *rl_basic_word_break_characters = break_chars;
 char *rl_completer_word_break_characters = NULL;
 const char *rl_completer_quote_characters = NULL;
+const char *rl_basic_quote_characters = "\"'";
 rl_compentry_func_t *rl_completion_entry_function = NULL;
 char *(*rl_completion_word_break_hook)(void) = NULL;
 rl_completion_func_t *rl_attempted_completion_function = NULL;
@@ -127,6 +128,15 @@ VFunction *rl_completion_display_matches
 VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
 VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
 KEYMAP_ENTRY_ARRAY emacs_meta_keymap;
+unsigned long rl_readline_state;
+int _rl_complete_mark_directories;
+rl_icppfunc_t *rl_directory_completion_hook;
+int rl_completion_suppress_append;
+int rl_sort_completion_matches;
+int _rl_completion_prefix_display_length;
+int _rl_echoing_p;
+int history_max_entries;
+char *rl_display_prompt;
 
 /*
  * The current prompt string.
@@ -2437,3 +2447,40 @@ rl_echo_signal_char(int sig)
 		return;
 	re_putc(e, c, 0);
 }
+
+int
+rl_crlf(void)
+{
+	re_putc(e, '\n', 0);
+	return 0;
+}
+
+int
+rl_ding(void)
+{
+	re_putc(e, '\a', 0);
+	return 0;
+}
+
+int
+rl_abort(int count, int key)
+{
+	return count && key ? 0 : 0;
+}
+
+int
+rl_set_keymap_name(const char *name, Keymap k)
+{
+	return name && k ? 0 : 0;
+}
+
+histdata_t
+free_history_entry(HIST_ENTRY *he)
+{
+	return he ? NULL : NULL;
+}
+
+void
+_rl_erase_entire_line(void)
+{
+}

Index: src/lib/libedit/readline/readline.h
diff -u src/lib/libedit/readline/readline.h:1.46 src/lib/libedit/readline/readline.h:1.47
--- src/lib/libedit/readline/readline.h:1.46	Fri Jun  7 11:19:29 2019
+++ src/lib/libedit/readline/readline.h	Sat Aug 21 08:34:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.h,v 1.46 2019/06/07 15:19:29 christos Exp $	*/
+/*	$NetBSD: readline.h,v 1.47 2021/08/21 12:34:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -45,6 +45,7 @@ typedef char	**rl_completion_func_t(cons
 typedef char *rl_compentry_func_t(const char *, int);
 typedef int	  rl_command_func_t(int, int);
 typedef int	  rl_hook_func_t(void);
+typedef int   rl_icppfunc_t(char **);
 
 /* only supports length */
 typedef struct {
@@ -106,6 +107,7 @@ extern char		*rl_line_buffer;
 extern int		 rl_point, rl_end;
 extern int		 history_base, history_length;
 extern int		 max_input_history;
+extern const char	*rl_basic_quote_characters;
 extern const char	*rl_basic_word_break_characters;
 extern char		*rl_completer_word_break_characters;
 extern const char	*rl_completer_quote_characters;
@@ -127,6 +129,7 @@ extern int		rl_done;
 /*
  * The following is not implemented
  */
+extern unsigned long	rl_readline_state;
 extern int		rl_catch_signals;
 extern int		rl_catch_sigwinch;
 extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
@@ -142,6 +145,14 @@ extern VFunction	*rl_deprep_term_functio
 extern rl_hook_func_t	*rl_event_hook;
 extern int		readline_echoing_p;
 extern int		_rl_print_completions_horizontally;
+extern int		_rl_complete_mark_directories;
+extern rl_icppfunc_t	*rl_directory_completion_hook;
+extern int		rl_completion_suppress_append;
+extern int		rl_sort_completion_matches;
+extern int		_rl_completion_prefix_display_length;
+extern int		_rl_echoing_p;
+extern int		history_max_entries;
+extern char		*rl_display_prompt;
 
 /* supported functions */
 char		*readline(const char *);
@@ -213,6 +224,8 @@ int		 rl_set_prompt(const char *);
 int		 rl_on_new_line(void);
 void		 rl_reset_after_signal(void);
 void		 rl_echo_signal_char(int);
+int		 rl_crlf(void);
+int		 rl_ding(void);
 
 /*
  * The following are not implemented
@@ -226,6 +239,10 @@ 

CVS commit: src/lib/libedit

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 12:34:59 UTC 2021

Modified Files:
src/lib/libedit: readline.c
src/lib/libedit/readline: readline.h

Log Message:
Add more api to make gdb-11 happy (but not gdbtui as usual)


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/lib/libedit/readline.c
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/readline/readline.h

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



CVS commit: src/sys/external/isc/libsodium/conf

2021-08-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 21 09:09:39 UTC 2021

Modified Files:
src/sys/external/isc/libsodium/conf: files.libsodium

Log Message:
rename glue.c to sodium_module.c


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/isc/libsodium/conf/files.libsodium

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



  1   2   3   4   5   6   7   8   9   10   >