CVS commit: src/lib/libedit

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 22:22:52 UTC 2021

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

Log Message:
libedit: simplify calls to macro ADD_STRING

The lint comments CONSTCOND and LINTED were not necessary.  It is
simpler to just specify what to free.  GCC optimizes free(NULL) to be a
no-op.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 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.161 src/lib/libedit/readline.c:1.162
--- src/lib/libedit/readline.c:1.161	Sun Aug 15 22:14:45 2021
+++ src/lib/libedit/readline.c	Sun Aug 15 22:22:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $	*/
+/*	$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig 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.161 2021/08/15 22:14:45 rillig Exp $");
+__RCSID("$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -951,10 +951,7 @@ history_expand(char *str, char **output)
 			(size += len + 1) * sizeof(*nresult));	\
 			if (nresult == NULL) {\
 el_free(*output);			\
-if (/*CONSTCOND*/fr) {			\
-	/*LINTED*/			\
-	el_free(tmp);			\
-}	\
+el_free(fr);\
 return 0;\
 			}		\
 			result = nresult;\
@@ -1004,11 +1001,11 @@ loop:
 			goto loop;
 		}
 		len = i - start;
-		ADD_STRING([start], len, 0);
+		ADD_STRING([start], len, NULL);
 
 		if (str[i] == '\0' || str[i] != history_expansion_char) {
 			len = j - i;
-			ADD_STRING([i], len, 0);
+			ADD_STRING([i], len, NULL);
 			if (start == 0)
 ret = 0;
 			else
@@ -1018,7 +1015,7 @@ loop:
 		ret = _history_expand_command (str, i, (j - i), );
 		if (ret > 0 && tmp) {
 			len = strlen(tmp);
-			ADD_STRING(tmp, len, 1);
+			ADD_STRING(tmp, len, tmp);
 		}
 		if (tmp) {
 			el_free(tmp);



CVS commit: src/lib/libedit

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 22:14:45 UTC 2021

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

Log Message:
readline: fix lint warning about effective unconst cast

Calling strchr to avoid the syntactical unconst cast is not necessary
here.  A simple pointer assignment is enough.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 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.160 src/lib/libedit/readline.c:1.161
--- src/lib/libedit/readline.c:1.160	Sun Aug 15 10:06:32 2021
+++ src/lib/libedit/readline.c	Sun Aug 15 22:14:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig 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.160 2021/08/15 10:06:32 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -208,11 +208,10 @@ static void
 _resize_fun(EditLine *el, void *a)
 {
 	const LineInfo *li;
-	char **ap = a;
+	const char **ap = a;
 
 	li = el_line(el);
-	/* a cheesy way to get rid of const cast. */
-	*ap = memchr(li->buffer, *li->buffer, (size_t)1);
+	*ap = li->buffer;
 }
 
 static const char *



CVS commit: src/sys/sys

2021-08-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Aug 15 22:08:01 UTC 2021

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

Log Message:
Define a constant for the size of device_t::dv_xname, rather than just
using 16.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/sys/device.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/device.h
diff -u src/sys/sys/device.h:1.173 src/sys/sys/device.h:1.174
--- src/sys/sys/device.h:1.173	Sat Aug  7 18:16:42 2021
+++ src/sys/sys/device.h	Sun Aug 15 22:08:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.173 2021/08/07 18:16:42 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.174 2021/08/15 22:08:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -252,6 +252,9 @@ struct devhandle_impl {
 	const char *, devhandle_t *);
 };
 
+/* Max size of a device external name (including terminating NUL) */
+#define	DEVICE_XNAME_SIZE	16
+
 struct device {
 	devhandle_t	dv_handle;	/* this device's handle;
 	   new device_t's get INVALID */
@@ -262,7 +265,8 @@ struct device {
 	cfdriver_t	dv_cfdriver;	/* our cfdriver */
 	cfattach_t	dv_cfattach;	/* our cfattach */
 	int		dv_unit;	/* device unit number */
-	char		dv_xname[16];	/* external name (name + unit) */
+	/* external name (name + unit) */
+	char		dv_xname[DEVICE_XNAME_SIZE];
 	device_t	dv_parent;	/* pointer to parent device
 	   (NULL if pseudo- or root node) */
 	int		dv_depth;	/* number of parents until root */



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 21:51:56 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_193.c msg_193.exp

Log Message:
tests/lint: correct interpretation of NOTREACHED

The branch is unconditionally taken, therefore any later code is
unreachable as well.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/msg_193.c \
src/tests/usr.bin/xlint/lint1/msg_193.exp

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.bin/xlint/lint1/msg_193.c
diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.13 src/tests/usr.bin/xlint/lint1/msg_193.c:1.14
--- src/tests/usr.bin/xlint/lint1/msg_193.c:1.13	Sun Aug 15 21:21:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.c	Sun Aug 15 21:51:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_193.c,v 1.13 2021/08/15 21:21:13 rillig Exp $	*/
+/*	$NetBSD: msg_193.c,v 1.14 2021/08/15 21:51:56 rillig Exp $	*/
 # 3 "msg_193.c"
 
 // Test for message: statement not reached [193]
@@ -645,7 +645,12 @@ lint_annotation_NOTREACHED(void)
 		suppressed();
 	}
 
-	/* FIXME: The 'if' statement _is_ reached. */
+	/*
+	 * Since the condition in the 'if' statement is constant, lint knows
+	 * that the branch is unconditionally taken.  The annotation comment
+	 * marks that branch as not reached, which means that any following
+	 * statement cannot be reached as well.
+	 */
 	/* expect+1: warning: statement not reached [193] */
 	if (1)
 		/* NOTREACHED */
Index: src/tests/usr.bin/xlint/lint1/msg_193.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13 src/tests/usr.bin/xlint/lint1/msg_193.exp:1.14
--- src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13	Sun Aug 15 21:21:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.exp	Sun Aug 15 21:51:56 2021
@@ -86,4 +86,4 @@ msg_193.c(580): warning: label 'six' unu
 msg_193.c(597): warning: statement not reached [193]
 msg_193.c(606): warning: statement not reached [193]
 msg_193.c(627): warning: statement not reached [193]
-msg_193.c(650): warning: statement not reached [193]
+msg_193.c(655): warning: statement not reached [193]



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 21:21:14 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_193.c msg_193.exp

Log Message:
tests/lint: test how NOTREACHED affects the unreachable warning

Inspired by lib/libedit/readline.c 1.159 from 2021-08-15.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/msg_193.c \
src/tests/usr.bin/xlint/lint1/msg_193.exp

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.bin/xlint/lint1/msg_193.c
diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.12 src/tests/usr.bin/xlint/lint1/msg_193.c:1.13
--- src/tests/usr.bin/xlint/lint1/msg_193.c:1.12	Sun Jul 11 19:30:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.c	Sun Aug 15 21:21:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_193.c,v 1.12 2021/07/11 19:30:56 rillig Exp $	*/
+/*	$NetBSD: msg_193.c,v 1.13 2021/08/15 21:21:13 rillig Exp $	*/
 # 3 "msg_193.c"
 
 // Test for message: statement not reached [193]
@@ -616,3 +616,38 @@ reachable:
 /* TODO: switch */
 
 /* TODO: system-dependent constant expression (see tn_system_dependent) */
+
+void suppressed(void);
+
+void
+lint_annotation_NOTREACHED(void)
+{
+	if (0) {
+		/* expect+1: warning: statement not reached [193] */
+		unreachable();
+	}
+
+	if (0) {
+		/* NOTREACHED */
+		suppressed();
+	}
+
+	if (0)
+		/* NOTREACHED */
+		suppressed();
+
+	if (1) {
+		reachable();
+	}
+
+	if (1) {
+		/* NOTREACHED */
+		suppressed();
+	}
+
+	/* FIXME: The 'if' statement _is_ reached. */
+	/* expect+1: warning: statement not reached [193] */
+	if (1)
+		/* NOTREACHED */
+		suppressed();
+}
Index: src/tests/usr.bin/xlint/lint1/msg_193.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_193.exp:1.12 src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13
--- src/tests/usr.bin/xlint/lint1/msg_193.exp:1.12	Sun Jul 11 19:30:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.exp	Sun Aug 15 21:21:13 2021
@@ -85,3 +85,5 @@ msg_193.c(540): warning: statement not r
 msg_193.c(580): warning: label 'six' unused in function 'test_goto_numbers_alphabetically' [232]
 msg_193.c(597): warning: statement not reached [193]
 msg_193.c(606): warning: statement not reached [193]
+msg_193.c(627): warning: statement not reached [193]
+msg_193.c(650): warning: statement not reached [193]



CVS commit: src/doc

2021-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 15 17:09:04 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
grep-3.7 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1810 -r1.1811 src/doc/3RDPARTY

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.1810 src/doc/3RDPARTY:1.1811
--- src/doc/3RDPARTY:1.1810	Sat Aug 14 16:20:31 2021
+++ src/doc/3RDPARTY	Sun Aug 15 17:09:03 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1810 2021/08/14 16:20:31 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1811 2021/08/15 17:09:03 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2081,7 +2081,7 @@ we use BSD-licensed implementation from 
 
 Package:	grep
 Version:	2.5.1a (last GPLv2+ version)
-Current Vers:	3.5
+Current Vers:	3.7
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/grep/
 Home Page:	http://www.gnu.org/software/grep/



CVS commit: src/external/cddl/osnet/dev/fbt/x86

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

Modified Files:
src/external/cddl/osnet/dev/fbt/x86: fbt_isa.c

Log Message:
PR/56355: Taylor Campbell: restore strcmp() over strncmp()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.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/cddl/osnet/dev/fbt/x86/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.4 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.5
--- src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.4	Wed Aug 11 07:16:49 2021
+++ src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c	Sun Aug 15 12:33:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.4 2021/08/11 11:16:49 christos Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.5 2021/08/15 16:33:57 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -251,9 +251,9 @@ fbt_provide_module_cb(const char *name, 
 	/*
 	 * Exclude some more symbols which can be called from probe context.
 	 */
-	if (strncmp(name, "trap", 4) ||
-	strncmp(name, "x86_curcpu", 10) == 0 ||
-	strncmp(name, "x86_curlwp", 10) == 0) {
+	if (strcmp(name, "trap") ||
+	strcmp(name, "x86_curcpu") == 0 ||
+	strcmp(name, "x86_curlwp") == 0) {
 		return 0;
 	}
 #endif



CVS commit: src/lib/libcurses

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 15:12:36 UTC 2021

Modified Files:
src/lib/libcurses: get_wstr.c getstr.c in_wchstr.c inchstr.c instr.c
inwstr.c

Log Message:
libcurses: fix usage of __warn_references

Since that macro can expand to an empty token list, it adds its own
semicolon as needed.  Removing the extra semicolon fixes the lint
warnings about empty declarations.  These empty declarations are a GCC
extension.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/get_wstr.c \
src/lib/libcurses/in_wchstr.c src/lib/libcurses/inwstr.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/getstr.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/inchstr.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/instr.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/libcurses/get_wstr.c
diff -u src/lib/libcurses/get_wstr.c:1.8 src/lib/libcurses/get_wstr.c:1.9
--- src/lib/libcurses/get_wstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/get_wstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif		  /* not lint */
 
 #include "curses.h"
@@ -61,7 +61,7 @@ getn_wstr(wchar_t *wstr, int n)
  *	Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(get_wstr,
-	"warning: this program uses get_wstr(), which is unsafe.");
+	"warning: this program uses get_wstr(), which is unsafe.")
 int
 get_wstr(wchar_t *wstr)
 {
@@ -83,7 +83,7 @@ mvgetn_wstr(int y, int x, wchar_t *wstr,
  *	  Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvget_wstr(int y, int x, wchar_t *wstr)
 {
@@ -109,7 +109,7 @@ mvwgetn_wstr(WINDOW *win, int y, int x, 
  *	  Get a string from the given window starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvwget_wstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
@@ -124,7 +124,7 @@ mvwget_wstr(WINDOW *win, int y, int x, w
  *	Get a string starting at (cury, curx).
  */
 __warn_references(wget_wstr,
-	"warning: this program uses wget_wstr(), which is unsafe.");
+	"warning: this program uses wget_wstr(), which is unsafe.")
 int
 wget_wstr(WINDOW *win, wchar_t *wstr)
 {
Index: src/lib/libcurses/in_wchstr.c
diff -u src/lib/libcurses/in_wchstr.c:1.8 src/lib/libcurses/in_wchstr.c:1.9
--- src/lib/libcurses/in_wchstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/in_wchstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif		  /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: in_wchstr.c,v 1.8 2019
  *	Return an array of wide characters at cursor position from stdscr.
  */
 __warn_references(in_wchstr,
-	"warning: this program uses in_wchstr(), which is unsafe.");
+	"warning: this program uses in_wchstr(), which is unsafe.")
 int
 in_wchstr(cchar_t *wchstr)
 {
@@ -65,7 +65,7 @@ in_wchnstr(cchar_t *wchstr, int n)
  *  Return an array of wide characters at position (y, x) from stdscr.
  */
 __warn_references(mvin_wchstr,
-	"warning: this program uses mvin_wchstr(), which is unsafe.");
+	"warning: this program uses mvin_wchstr(), which is unsafe.")
 int
 mvin_wchstr(int y, int x, cchar_t *wchstr)
 {
@@ -83,7 +83,7 @@ mvin_wchnstr(int y, int x, cchar_t *wchs
  *  Return an array wide characters at position (y, x) from the given window.
  */
 __warn_references(mvwin_wchstr,
-	"warning: this program uses mvwin_wchstr(), which is unsafe.");
+	"warning: this program uses mvwin_wchstr(), which is unsafe.")
 int
 mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr)
 {
@@ -107,7 +107,7 @@ mvwin_wchnstr(WINDOW *win, int y, int x,
  *	Return an array of characters at cursor position.
  */
 __warn_references(win_wchstr,
-	"warning: this program uses win_wchstr(), which is unsafe.");
+	"warning: this program uses win_wchstr(), which is unsafe.")
 int
 win_wchstr(WINDOW *win, cchar_t *wchstr)
 {
Index: src/lib/libcurses/inwstr.c
diff -u 

CVS commit: src

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 14:26:40 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_346.c msg_346.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: extend check for unconst functions

The functions memchr, strpbrk, strrchr and strstr effectively remove the
const qualifier of their first argument, just like strchr.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_346.c \
src/tests/usr.bin/xlint/lint1/msg_346.exp
cvs rdiff -u -r1.335 -r1.336 src/usr.bin/xlint/lint1/tree.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.bin/xlint/lint1/msg_346.c
diff -u src/tests/usr.bin/xlint/lint1/msg_346.c:1.2 src/tests/usr.bin/xlint/lint1/msg_346.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_346.c:1.2	Sun Aug 15 14:00:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.c	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_346.c,v 1.2 2021/08/15 14:00:27 rillig Exp $	*/
+/*	$NetBSD: msg_346.c,v 1.3 2021/08/15 14:26:39 rillig Exp $	*/
 # 3 "msg_346.c"
 
 // Test for message: call to '%s' effectively discards 'const' from argument [346]
@@ -40,14 +40,14 @@ example(void)
 void
 all_functions(void)
 {
-	/* TODO: expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(memchr("string", 'c', 7));
 	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strchr("string", 'c'));
-	/* TODO: expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
 	take_char_ptr(strpbrk("string", "c"));
-	/* TODO: expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strrchr("string", 'c'));
-	/* TODO: expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strstr("string", "c"));
 }
Index: src/tests/usr.bin/xlint/lint1/msg_346.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_346.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2	Sun Aug 15 14:00:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.exp	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,8 @@
 msg_346.c(26): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(32): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(37): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(44): warning: call to 'memchr' effectively discards 'const' from argument [346]
 msg_346.c(46): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(48): warning: call to 'strpbrk' effectively discards 'const' from argument [346]
+msg_346.c(50): warning: call to 'strrchr' effectively discards 'const' from argument [346]
+msg_346.c(52): warning: call to 'strstr' effectively discards 'const' from argument [346]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.335 src/usr.bin/xlint/lint1/tree.c:1.336
--- src/usr.bin/xlint/lint1/tree.c:1.335	Sun Aug 15 13:08:19 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $");
 #endif
 
 #include 
@@ -1349,12 +1349,27 @@ check_pointer_comparison(op_t op, const 
 }
 
 static bool
-is_direct_function_call(const tnode_t *tn, const char *name)
+is_direct_function_call(const tnode_t *tn, const char **out_name)
 {
-	return tn->tn_op == CALL &&
-	   tn->tn_left->tn_op == ADDR &&
-	   tn->tn_left->tn_left->tn_op == NAME &&
-	   strcmp(tn->tn_left->tn_left->tn_sym->s_name, name) == 0;
+
+	if (!(tn->tn_op == CALL &&
+	  tn->tn_left->tn_op == ADDR &&
+	  tn->tn_left->tn_left->tn_op == NAME))
+		return false;
+
+	*out_name = tn->tn_left->tn_left->tn_sym->s_name;
+	return true;
+}
+
+static bool
+is_unconst_function(const char *name)
+{
+
+	return strcmp(name, "memchr") == 0 ||
+	   strcmp(name, "strchr") == 0 ||
+	   strcmp(name, "strpbrk") == 0 ||
+	   strcmp(name, "strrchr") == 0 ||
+	   strcmp(name, "strstr") == 0;
 }
 
 static bool
@@ 

CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 14:00:27 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_346.c msg_346.exp

Log Message:
tests/lint: add tests for more unconst functions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_346.c \
src/tests/usr.bin/xlint/lint1/msg_346.exp

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.bin/xlint/lint1/msg_346.c
diff -u src/tests/usr.bin/xlint/lint1/msg_346.c:1.1 src/tests/usr.bin/xlint/lint1/msg_346.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_346.c:1.1	Mon Aug  9 20:07:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.c	Sun Aug 15 14:00:27 2021
@@ -1,9 +1,15 @@
-/*	$NetBSD: msg_346.c,v 1.1 2021/08/09 20:07:24 rillig Exp $	*/
+/*	$NetBSD: msg_346.c,v 1.2 2021/08/15 14:00:27 rillig Exp $	*/
 # 3 "msg_346.c"
 
 // Test for message: call to '%s' effectively discards 'const' from argument [346]
 
-char *strchr(const char *, int);
+typedef unsigned long size_t;
+
+void* memchr(const void *, int, size_t);		/* C99 7.21.5.1 */
+char *strchr(const char *, int);			/* C99 7.21.5.2 */
+char* strpbrk(const char *, const char *);		/* C99 7.21.5.4 */
+char* strrchr(const char *, int);			/* C99 7.21.5.5 */
+char* strstr(const char *, const char *);		/* C99 7.21.5.7 */
 
 void take_const_char_ptr(const char *);
 void take_char_ptr(char *);
@@ -30,3 +36,18 @@ example(void)
 	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strchr("literal", 'c'));
 }
+
+void
+all_functions(void)
+{
+	/* TODO: expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(memchr("string", 'c', 7));
+	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strchr("string", 'c'));
+	/* TODO: expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
+	take_char_ptr(strpbrk("string", "c"));
+	/* TODO: expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strrchr("string", 'c'));
+	/* TODO: expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strstr("string", "c"));
+}
Index: src/tests/usr.bin/xlint/lint1/msg_346.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_346.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_346.exp:1.1	Mon Aug  9 20:07:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.exp	Sun Aug 15 14:00:27 2021
@@ -1,3 +1,4 @@
-msg_346.c(20): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(26): warning: call to 'strchr' effectively discards 'const' from argument [346]
-msg_346.c(31): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(32): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(37): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(46): warning: call to 'strchr' effectively discards 'const' from argument [346]



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:32:44 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: bn.inc

Log Message:
libcrypto: suppress irrelevant lint warnings

The conversion from 'unsigned long' to 'int' in line 805 is due to the
laziness of declaring a carry flag as BN_ULONG, to save an extra
line of declaration.

The constants in conditional context come from the macro 'bn_cp_32'.

The unconst cast is used for initializing local BIGNUM constants; the
struct member is declared as non-const pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc

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/openssl/lib/libcrypto/bn.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.6
--- src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.5	Fri Feb  9 13:35:45 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc	Sun Aug 15 13:32:43 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bn.inc,v 1.5 2018/02/09 13:35:45 christos Exp $
+#	$NetBSD: bn.inc,v 1.6 2021/08/15 13:32:43 rillig Exp $
 #
 #	@(#) Copyright (c) 1995 Simon J. Gerraty
 #
@@ -47,3 +47,7 @@ SRCS += ${BN_SRCS}
 .for cryptosrc in ${BN_SRCS}
 CPPFLAGS.${cryptosrc} = -I${OPENSSLSRC}/crypto/bn ${BNCPPFLAGS}
 .endfor
+
+LINTFLAGS.bn_nist.c+=	-X 132	# conversion from 'unsigned long' to 'int'
+LINTFLAGS.bn_nist.c+=	-X 161	# constant in conditional context
+LINTFLAGS.bn_nist.c+=	-X 275	# cast discards 'const' from type 'pointer to const unsigned long'



CVS commit: src

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:08:20 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix wrong warning about 'unsigned char >> constant'


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_117.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_117.exp
cvs rdiff -u -r1.334 -r1.335 src/usr.bin/xlint/lint1/tree.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.bin/xlint/lint1/msg_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.6 src/tests/usr.bin/xlint/lint1/msg_117.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.6	Sun Aug 15 13:02:20 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c	Sun Aug 15 13:08:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_117.c,v 1.6 2021/08/15 13:02:20 rillig Exp $	*/
+/*	$NetBSD: msg_117.c,v 1.7 2021/08/15 13:08:20 rillig Exp $	*/
 # 3 "msg_117.c"
 
 // Test for message: bitwise '%s' on signed value possibly nonportable [117]
@@ -38,7 +38,10 @@ shr_rhs_constant_negative(int a)
 unsigned int
 shr_unsigned_char(unsigned char uc)
 {
-	/* FIXME: This value cannot actually be negative. */
-	/* expect+1: warning: bitwise '>>' on signed value possibly nonportable [117] */
+	/*
+	 * Even though 'uc' is promoted to 'int', it cannot be negative.
+	 * Before tree.c 1.335 from 2021-08-15, lint wrongly warned that
+	 * 'uc >> 4' might be a bitwise '>>' on signed value.
+	 */
 	return uc >> 4;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_117.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.6
--- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5	Sun Aug 15 13:02:20 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.exp	Sun Aug 15 13:08:20 2021
@@ -4,4 +4,3 @@ msg_117.c(29): warning: bitwise '>>' on 
 msg_117.c(29): warning: shift amount 4660 is greater than bit-size 32 of 'int' [122]
 msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
 msg_117.c(35): warning: negative shift [121]
-msg_117.c(43): warning: bitwise '>>' on signed value possibly nonportable [117]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.334 src/usr.bin/xlint/lint1/tree.c:1.335
--- src/usr.bin/xlint/lint1/tree.c:1.334	Sat Aug 14 13:00:55 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Aug 15 13:08:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $");
 #endif
 
 #include 
@@ -849,7 +849,7 @@ typeok_shr(const mod_t *mp,
 	ort = before_conversion(rn)->tn_type->t_tspec;
 
 	/* operands have integer types (checked above) */
-	if (pflag && !is_uinteger(lt)) {
+	if (pflag && !is_uinteger(olt)) {
 		/*
 		 * The left operand is signed. This means that
 		 * the operation is (possibly) nonportable.



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:02:20 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp

Log Message:
tests/lint: demonstrate wrong warning about signed '>>'

Seen in libdes/ostr2key.c(81).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_117.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_117.exp

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.bin/xlint/lint1/msg_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.5 src/tests/usr.bin/xlint/lint1/msg_117.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.5	Mon Apr  5 01:35:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c	Sun Aug 15 13:02:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_117.c,v 1.5 2021/04/05 01:35:34 rillig Exp $	*/
+/*	$NetBSD: msg_117.c,v 1.6 2021/08/15 13:02:20 rillig Exp $	*/
 # 3 "msg_117.c"
 
 // Test for message: bitwise '%s' on signed value possibly nonportable [117]
@@ -34,3 +34,11 @@ shr_rhs_constant_negative(int a)
 {
 	return a >> -0x1234;		/* expect: 117 *//* expect: 121 */
 }
+
+unsigned int
+shr_unsigned_char(unsigned char uc)
+{
+	/* FIXME: This value cannot actually be negative. */
+	/* expect+1: warning: bitwise '>>' on signed value possibly nonportable [117] */
+	return uc >> 4;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_117.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4	Tue Apr  6 21:32:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.exp	Sun Aug 15 13:02:20 2021
@@ -4,3 +4,4 @@ msg_117.c(29): warning: bitwise '>>' on 
 msg_117.c(29): warning: shift amount 4660 is greater than bit-size 32 of 'int' [122]
 msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
 msg_117.c(35): warning: negative shift [121]
+msg_117.c(43): warning: bitwise '>>' on signed value possibly nonportable [117]



CVS commit: src/crypto/external/bsd/openssl/lib/libdes

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 12:58:02 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/lib/libdes: Makefile

Log Message:
libdes: suppress some selected lint warnings

The type widths are handled carefully, so even if there is some
conversion from 64-bit long to uint32_t, no value bits get lost.

The fallthrough case statements are a variant of Duff's Device.

The bitwise '>>' on signed value is actually on a value of type
'unsigned char', and since all platforms supported by lint have
sizeof(int) == 4, the behavior is well defined.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssl/lib/libdes/Makefile

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/openssl/lib/libdes/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.3 src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.4
--- src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.3	Thu Mar 15 18:40:16 2018
+++ src/crypto/external/bsd/openssl/lib/libdes/Makefile	Sun Aug 15 12:58:01 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2018/03/15 18:40:16 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2021/08/15 12:58:01 rillig Exp $
 
 .include 
 
@@ -16,6 +16,9 @@ SRCS+=	ornd_keys.c
 
 CPPFLAGS+=-DOPENSSL_VERSION_PTEXT="\" based on OpenSSL 0.9.6j 10 Apr 2003\""
 CPPFLAGS+=-DOPENSSL_cleanse=bzero -DOPENSSL_malloc=malloc
+LINTFLAGS+=	-X 117	# bitwise '>>' on signed value possibly nonportable
+LINTFLAGS+=	-X 132	# conversion from 'long' to 'unsigned int'
+LINTFLAGS+=	-X 220	# fallthrough on case statement
 
 INCS=	des.h
 INCSDIR=/usr/include



CVS commit: src/external/bsd/jemalloc/lib

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 12:41:40 UTC 2021

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
jemalloc: suppress two irrelevant lint warnings


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/jemalloc/lib/Makefile.inc

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.14 src/external/bsd/jemalloc/lib/Makefile.inc:1.15
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.14	Tue Jul  6 12:40:24 2021
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sun Aug 15 12:41:40 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2021/07/06 12:40:24 thorpej Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/08/15 12:41:40 rillig Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -44,6 +44,8 @@ witness.c
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD
 COPTS.${i}+= -fvisibility=hidden -funroll-loops
 COPTS.${i}+= ${${ACTIVE_CC} == "clang":? -Wno-atomic-alignment :}
+LINTFLAGS.${i}+=	-X 231	# argument unused
+LINTFLAGS.${i}+=	-X 220	# fallthrough on case statement
 .endfor
 
 COPTS.background_thread.c+=-Wno-error=stack-protector



CVS commit: src/lib/libcurses

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

Modified Files:
src/lib/libcurses: curses_private.h slk.c

Log Message:
This is a mess; always define MB_LEN_MAX so both the regular and libhack
version of curses compiles. Really we should not be defining MB_LEN_MAX here,
and include  in curses_private.h to get it.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/slk.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/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.73 src/lib/libcurses/curses_private.h:1.74
--- src/lib/libcurses/curses_private.h:1.73	Sat Mar 14 21:12:47 2020
+++ src/lib/libcurses/curses_private.h	Sun Aug 15 08:39:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.73 2020/03/15 01:12:47 uwe Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.74 2021/08/15 12:39:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -299,8 +299,14 @@ struct __screen {
 	bool		 slk_hidden;
 	struct __slk_label *slk_labels;
 
-#ifdef HAVE_WCHAR
+/*
+ * XXX: This conflicts with the value in  (32)
+ * which should be used here instead of defining a different value,
+ * but I am not changing it because it is also used in the WCOL()
+ * macro and I don't understand the effects of it.
+ */
 #define MB_LEN_MAX 8
+#ifdef HAVE_WCHAR
 #define MAX_CBUF_SIZE MB_LEN_MAX
 	int		cbuf_head;		/* header to cbuf */
 	int		cbuf_tail;		/* tail to cbuf */

Index: src/lib/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.13 src/lib/libcurses/slk.c:1.14
--- src/lib/libcurses/slk.c:1.13	Sun Aug 15 07:54:12 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 08:39:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $	*/
+/*	$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,13 +31,12 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $");
+__RCSID("$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $");
 #endif/* not lint */
 
 #include 
 #include 
 #include 
-#include 
 #ifdef HAVE_WCHAR
 #include 
 #endif



CVS commit: src/bin/csh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 12:16:02 UTC 2021

Modified Files:
src/bin/csh: set.c

Log Message:
Turn on EL_SAFEREAD


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/csh/set.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/set.c
diff -u src/bin/csh/set.c:1.37 src/bin/csh/set.c:1.38
--- src/bin/csh/set.c:1.37	Sun Jan 12 13:42:41 2020
+++ src/bin/csh/set.c	Sun Aug 15 08:16:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: set.c,v 1.37 2020/01/12 18:42:41 christos Exp $ */
+/* $NetBSD: set.c,v 1.38 2021/08/15 12:16:02 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)set.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: set.c,v 1.37 2020/01/12 18:42:41 christos Exp $");
+__RCSID("$NetBSD: set.c,v 1.38 2021/08/15 12:16:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -158,6 +158,7 @@ update_vars(Char *vp)
 	el_set(el, EL_EDITOR, *vn ? short2str(vn) : "emacs");
 	el_set(el, EL_PROMPT, printpromptstr);
 	el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
+	el_set(el, EL_SAFEREAD, 1);
 	el_set(el, EL_ADDFN, "rl-complete",
 	"ReadLine compatible completion function", _el_fn_complete);
 	el_set(el, EL_BIND, "^I", adrof(STRfilec) ? "rl-complete" : "ed-insert",



CVS commit: src/bin/sh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:57:17 UTC 2021

Modified Files:
src/bin/sh: Makefile

Log Message:
Add -I to find filecomplete.h


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/bin/sh/Makefile

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/Makefile
diff -u src/bin/sh/Makefile:1.116 src/bin/sh/Makefile:1.117
--- src/bin/sh/Makefile:1.116	Wed May 26 16:21:52 2021
+++ src/bin/sh/Makefile	Sun Aug 15 07:57:17 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.116 2021/05/26 20:21:52 christos Exp $
+#	$NetBSD: Makefile,v 1.117 2021/08/15 11:57:17 christos Exp $
 #	@(#)Makefile	8.4 (Berkeley) 5/5/95
 
 .include 
@@ -23,7 +23,7 @@ SCRIPT_ENV= \
 	MKTEMP=${TOOL_MKTEMP:Q} \
 	SED=${TOOL_SED:Q}
 
-CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
+CPPFLAGS+=-DSHELL -I. -I${.CURDIR} -I${NETBSDSRCDIR}/lib/libedit
 CPPFLAGS+= -DUSE_LRAND48
 #XXX: For testing only.
 #CPPFLAGS+=-DDEBUG=1



CVS commit: src/lib/libcurses

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:54:12 UTC 2021

Modified Files:
src/lib/libcurses: slk.c

Log Message:
need limits.h


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libcurses/slk.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/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.12 src/lib/libcurses/slk.c:1.13
--- src/lib/libcurses/slk.c:1.12	Sun Aug 15 07:44:39 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 07:54:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $	*/
+/*	$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,12 +31,13 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $");
+__RCSID("$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $");
 #endif/* not lint */
 
 #include 
 #include 
 #include 
+#include 
 #ifdef HAVE_WCHAR
 #include 
 #endif



CVS commit: src/lib/libcurses

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:44:39 UTC 2021

Modified Files:
src/lib/libcurses: slk.c

Log Message:
Use MBL_LEN_MAX (constant) so that SSP works


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/slk.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/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.11 src/lib/libcurses/slk.c:1.12
--- src/lib/libcurses/slk.c:1.11	Thu Jun 24 11:41:25 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 07:44:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $	*/
+/*	$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $");
+__RCSID("$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $");
 #endif/* not lint */
 
 #include 
@@ -818,7 +818,7 @@ __slk_draw(SCREEN *screen, int labnum)
 {
 	const struct __slk_label *l;
 	int retval, inc, lcnt, tx;
-	char ts[MB_CUR_MAX];
+	char ts[MB_LEN_MAX];
 #ifdef HAVE_WCHAR
 	cchar_t cc;
 	wchar_t wc[2];



CVS commit: src/usr.sbin/catman

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

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

Log Message:
Restore BSD BUGS section


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/catman/catman.8

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

Modified files:

Index: src/usr.sbin/catman/catman.8
diff -u src/usr.sbin/catman/catman.8:1.11 src/usr.sbin/catman/catman.8:1.12
--- src/usr.sbin/catman/catman.8:1.11	Tue Feb 25 05:36:05 2003
+++ src/usr.sbin/catman/catman.8	Sun Aug 15 07:00:43 2021
@@ -27,9 +27,9 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"	$NetBSD: catman.8,v 1.11 2003/02/25 10:36:05 wiz Exp $
+.\"	$NetBSD: catman.8,v 1.12 2021/08/15 11:00:43 christos Exp $
 .\"
-.Dd July 30, 1993
+.Dd August 15, 2021
 .Dt CATMAN 8
 .Os
 .Sh NAME
@@ -104,3 +104,4 @@ Update manual pages in
 .Xr whatis 1
 .Sh BUGS
 Currently does not handle hard links.
+Acts oddly on nights with full moons.



CVS commit: src/bin/kill

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:58:04 UTC 2021

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

Log Message:
restore a bit of history.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/kill/kill.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/kill/kill.1
diff -u src/bin/kill/kill.1:1.33 src/bin/kill/kill.1:1.34
--- src/bin/kill/kill.1:1.33	Sun Aug 30 16:14:07 2020
+++ src/bin/kill/kill.1	Sun Aug 15 06:58:04 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kill.1,v 1.33 2020/08/30 20:14:07 wiz Exp $
+.\"	$NetBSD: kill.1,v 1.34 2021/08/15 10:58:04 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)kill.1	8.2 (Berkeley) 4/28/95
 .\"
-.Dd August 30, 2020
+.Dd August 15, 2021
 .Dt KILL 1
 .Os
 .Sh NAME
@@ -192,3 +192,5 @@ A
 command appeared in
 .At v3
 in section 8 of the manual.
+The original BSD description was: 
+.Sq terminate a process with extreme prejudice .



CVS commit: src/external/bsd/openldap/lib/libldap

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

Modified Files:
src/external/bsd/openldap/lib/libldap: Makefile.libldap

Log Message:
Conditionalize GSSAPI use on USE_KERBEROS


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/bsd/openldap/lib/libldap/Makefile.libldap

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

Modified files:

Index: src/external/bsd/openldap/lib/libldap/Makefile.libldap
diff -u src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.11 src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.12
--- src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.11	Sat Aug 14 12:15:03 2021
+++ src/external/bsd/openldap/lib/libldap/Makefile.libldap	Sun Aug 15 06:33:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libldap,v 1.11 2021/08/14 16:15:03 christos Exp $
+#	$NetBSD: Makefile.libldap,v 1.12 2021/08/15 10:33:58 christos Exp $
 
 .include "../../openldap.mk"
 
@@ -24,7 +24,11 @@ CPPFLAGS+=	-DLDAP_LIBRARY -DHAVE_GSSAPI
 
 LIBDPLIBS+=	lber	${.CURDIR}/../liblber
 
+.if ${USE_KERBEROS} != "no"
+CPPFLAGS+=	-DHAVE_GSSAPI
 LIBDPLIBS+=	gssapi	${NETBSDSRCDIR}/crypto/external/bsd/heimdal/lib/libgssapi
+.endif
+
 LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto
 LIBDPLIBS+=	ssl	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libssl
 



CVS commit: src/share/mk

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:30:39 UTC 2021

Modified Files:
src/share/mk: bsd.prog.mk

Log Message:
Fix sun2 build for ldap/gssapi


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.337 src/share/mk/bsd.prog.mk:1.338
--- src/share/mk/bsd.prog.mk:1.337	Sat Aug 14 12:16:32 2021
+++ src/share/mk/bsd.prog.mk	Sun Aug 15 06:30:39 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.337 2021/08/14 16:16:32 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.338 2021/08/15 10:30:39 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -227,11 +227,13 @@ LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR}
 	${LIBHX509} ${LIBCRYPTO} ${LIBASN1} \
 	${LIBWIND} ${LIBHEIMBASE} ${LIBCOM_ERR} ${LIBROKEN} \
 	${LIBSQLITE3} ${LIBM} ${LIBCRYPT} ${LIBUTIL}
+LIBGSSAPI_LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD}
+LIBGSSAPI_DPADD+= ${LIBGSSAPI} ${LIBHEIMNTLM} ${LIBKRB5_DPADD}
 .endif
 
 .if (${MKLDAP} != "no")
-LIBLDAP_LDADD+= -lldap -llber -lgssapi -lssl -lcrypto 
-LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI} ${LIBSSL} ${LIBCRYPTO}
+LIBLDAP_LDADD+= -lldap -llber ${LIBGSSAPI_LDADD} -lssl -lcrypto 
+LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI_DPADD} ${LIBSSL} ${LIBCRYPTO}
 .endif
 
 # PAM applications, if linked statically, need more libraries



CVS commit: src/bin/sh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:17:55 UTC 2021

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

Log Message:
- Add command completion (from FreeBSD)
- Use EL_SAFEREAD


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/bin/sh/histedit.c
cvs rdiff -u -r1.13 -r1.14 src/bin/sh/myhistedit.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/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.55 src/bin/sh/histedit.c:1.56
--- src/bin/sh/histedit.c:1.55	Sun Feb 10 14:21:52 2019
+++ src/bin/sh/histedit.c	Sun Aug 15 06:17:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.55 2019/02/10 19:21:52 kre Exp $	*/
+/*	$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,11 +37,13 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.55 2019/02/10 19:21:52 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $");
 #endif
 #endif /* not lint */
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -71,13 +73,19 @@ History *hist;	/* history cookie */
 EditLine *el;	/* editline cookie */
 int displayhist;
 static FILE *el_in, *el_out;
-
-STATIC const char *fc_replace(const char *, char *, char *);
+static int curpos;
 
 #ifdef DEBUG
 extern FILE *tracefile;
 #endif
 
+static const char *fc_replace(const char *, char *, char *);
+static int not_fcnumber(const char *);
+static int str_to_event(const char *, int);
+static int comparator(const void *, const void *);
+static char **sh_matches(const char *, int, int);
+static unsigned char sh_complete(EditLine *, int);
+
 /*
  * Set history and editing status.  Called whenever the status may
  * have changed (figures out what to do).
@@ -136,10 +144,11 @@ histedit(void)
 
 set_prompt_lit(lookupvar("PSlit"));
 el_set(el, EL_SIGNAL, 1);
+el_set(el, EL_SAFEREAD, 1);
 el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
 el_set(el, EL_ADDFN, "rl-complete",
 "ReadLine compatible completion function",
-_el_fn_complete);
+sh_complete);
 			} else {
 bad:
 out2str("sh: can't initialize editing\n");
@@ -493,7 +502,7 @@ histcmd(volatile int argc, char ** volat
 	return 0;
 }
 
-STATIC const char *
+static const char *
 fc_replace(const char *s, char *p, char *r)
 {
 	char *dest;
@@ -512,20 +521,123 @@ fc_replace(const char *s, char *p, char 
 	STACKSTRNUL(dest);
 	dest = grabstackstr(dest);
 
-	return (dest);
+	return dest;
 }
 
-int
-not_fcnumber(char *s)
+
+/*
+ * Comparator function for qsort(). The use of curpos here is to skip
+ * characters that we already know to compare equal (common prefix).
+ */
+static int
+comparator(const void *a, const void *b)
+{
+	return strcmp(*(char *const *)a + curpos,
+		*(char *const *)b + curpos);
+}
+
+/*
+ * This function is passed to libedit's fn_complete(). The library will
+ * use it instead of its standard function to find matches, which
+ * searches for files in current directory. If we're at the start of the
+ * line, we want to look for available commands from all paths in $PATH.
+ */
+static char
+**sh_matches(const char *text, int start, int end)
+{
+	char *free_path = NULL, *dirname, *path;
+	char **matches = NULL;
+	size_t i = 0, size = 16;
+
+	if (start > 0)
+		return NULL;
+	curpos = end - start;
+	if ((free_path = path = strdup(pathval())) == NULL)
+		goto out;
+	if ((matches = malloc(size * sizeof(matches[0]))) == NULL)
+		goto out;
+	while ((dirname = strsep(, ":")) != NULL) {
+		struct dirent *entry;
+		DIR *dir;
+		int dfd;
+
+		if ((dir = opendir(dirname)) == NULL)
+			continue;
+		if ((dfd = dirfd(dir)) == -1)
+			continue;
+		while ((entry = readdir(dir)) != NULL) {
+			struct stat statb;
+
+			if (strncmp(entry->d_name, text, curpos) != 0)
+continue;
+			if (entry->d_type == DT_UNKNOWN || entry->d_type == DT_LNK) {
+if (fstatat(dfd, entry->d_name, , 0) == -1)
+	continue;
+if (!S_ISREG(statb.st_mode))
+	continue;
+			} else if (entry->d_type != DT_REG)
+continue;
+			if (++i >= size - 1) {
+size *= 2;
+if (reallocarr(, size,
+sizeof(*matches)))
+{
+	closedir(dir);
+	goto out;
+}
+			}
+			matches[i] = strdup(entry->d_name);
+		}
+		closedir(dir);
+	}
+out:
+	free(free_path);
+	if (i == 0) {
+		free(matches);
+		return NULL;
+	}
+	if (i == 1) {
+		matches[0] = strdup(matches[1]);
+		matches[i + 1] = NULL;
+	} else {
+		size_t j, k;
+
+		qsort(matches + 1, i, sizeof(matches[0]), comparator);
+		for (j = 1, k = 2; k <= i; k++)
+			if (strcmp(matches[j] + curpos, matches[k] + curpos)
+			== 0)
+free(matches[k]);
+			else
+matches[++j] = matches[k];
+		matches[0] = strdup(text);
+		matches[j + 1] = NULL;
+	}
+	return matches;
+}
+
+/*
+ * This is passed to el_set(el, EL_ADDFN, ...) so that it's possible to
+ * bind 

CVS commit: src/lib/libedit

2021-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 15 10:12:55 UTC 2021

Modified Files:
src/lib/libedit: editline.3

Log Message:
Add verb to sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/lib/libedit/editline.3

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/editline.3
diff -u src/lib/libedit/editline.3:1.100 src/lib/libedit/editline.3:1.101
--- src/lib/libedit/editline.3:1.100	Sun Aug 15 10:08:41 2021
+++ src/lib/libedit/editline.3	Sun Aug 15 10:12:54 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.100 2021/08/15 10:08:41 christos Exp $
+.\"	$NetBSD: editline.3,v 1.101 2021/08/15 10:12:54 wiz Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -508,9 +508,9 @@ In unbuffered mode,
 .Fn el_gets
 will return immediately after processing a single character.
 .It Dv EL_SAFEREAD , Fa "int flag"
-If
+If the
 .Fa flag
-argument non zero, then
+argument is non-zero, then
 .Nm editline
 attempts to recover from read errors, ignoring the first interrrupted
 error, and trying to reset the input file descriptor to reset non-blocking I/O.



CVS commit: src/lib/libedit

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

Modified Files:
src/lib/libedit: editline.3 el.c el.h eln.c histedit.h read.c

Log Message:
Disable attempts to handle EINTR and non-blocking I/O by default. It is
confusing to other programs and unexpected behavior. Reported by Ingo Schwarze.
This behavior is now controlled with EL_SAFEREAD.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/lib/libedit/editline.3 src/lib/libedit/el.c
cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/el.h
cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/eln.c
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/histedit.h
cvs rdiff -u -r1.106 -r1.107 src/lib/libedit/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/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.99 src/lib/libedit/editline.3:1.100
--- src/lib/libedit/editline.3:1.99	Sun Nov 18 12:09:39 2018
+++ src/lib/libedit/editline.3	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.99 2018/11/18 17:09:39 christos Exp $
+.\"	$NetBSD: editline.3,v 1.100 2021/08/15 10:08:41 christos Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 9, 2018
+.Dd August 15, 2021
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -507,6 +507,16 @@ unbuffered mode is disabled (the default
 In unbuffered mode,
 .Fn el_gets
 will return immediately after processing a single character.
+.It Dv EL_SAFEREAD , Fa "int flag"
+If
+.Fa flag
+argument non zero, then
+.Nm editline
+attempts to recover from read errors, ignoring the first interrrupted
+error, and trying to reset the input file descriptor to reset non-blocking I/O.
+This is disabled by default, and desirable only when
+.Nm editline
+is used in shell-like applications.
 .It Dv EL_GETCFN , Fa "el_rfunc_t f"
 Whenever reading a character, use the function
 .Bd -ragged -offset indent -compact
@@ -634,6 +644,10 @@ call.
 Set
 .Fa c
 to non-zero if unbuffered mode is enabled.
+.It Dv EL_SAFEREAD , Fa "int *c"
+Set
+.Fa c
+to non-zero if safe read is set.
 .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp"
 Set
 .Fa fp
Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.99 src/lib/libedit/el.c:1.100
--- src/lib/libedit/el.c:1.99	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/el.c	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.100 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c	8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.100 2021/08/15 10:08:41 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -300,6 +300,14 @@ el_wset(EditLine *el, int op, ...)
 		break;
 	}
 
+	case EL_SAFEREAD:
+		if (va_arg(ap, int))
+			el->el_flags |= FIXIO;
+		else
+			el->el_flags &= ~FIXIO;
+		rv = 0;
+		break;
+
 	case EL_EDITMODE:
 		if (va_arg(ap, int))
 			el->el_flags &= ~EDIT_DISABLED;
@@ -429,6 +437,11 @@ el_wget(EditLine *el, int op, ...)
 		rv = 0;
 		break;
 
+	case EL_SAFEREAD:
+		*va_arg(ap, int *) = (el->el_flags & FIXIO);
+		rv = 0;
+		break;
+
 	case EL_TERMINAL:
 		terminal_get(el, va_arg(ap, const char **));
 		rv = 0;

Index: src/lib/libedit/el.h
diff -u src/lib/libedit/el.h:1.45 src/lib/libedit/el.h:1.46
--- src/lib/libedit/el.h:1.45	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/el.h	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.h,v 1.45 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: el.h,v 1.46 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -51,12 +51,13 @@
 
 #define	EL_BUFSIZ	((size_t)1024)	/* Maximum line size		*/
 
-#define	HANDLE_SIGNALS	0x01
-#define	NO_TTY		0x02
-#define	EDIT_DISABLED	0x04
-#define	UNBUFFERED	0x08
-#define	NARROW_HISTORY	0x40
-#define	NO_RESET	0x80
+#define	HANDLE_SIGNALS	0x001
+#define	NO_TTY		0x002
+#define	EDIT_DISABLED	0x004
+#define	UNBUFFERED	0x008
+#define	NARROW_HISTORY	0x040
+#define	NO_RESET	0x080
+#define	FIXIO		0x100
 
 typedef unsigned char el_action_t;	/* Index to command array	*/
 

Index: src/lib/libedit/eln.c
diff -u src/lib/libedit/eln.c:1.35 src/lib/libedit/eln.c:1.36
--- src/lib/libedit/eln.c:1.35	Fri Apr 26 12:56:57 2019
+++ src/lib/libedit/eln.c	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $	*/
+/*	$NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.36 

CVS commit: src/lib/libedit

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:06:32 UTC 2021

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

Log Message:
Add a LINTED comment... Why doesn't NOTREACHED work?


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 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.159 src/lib/libedit/readline.c:1.160
--- src/lib/libedit/readline.c:1.159	Wed Oct  9 10:31:07 2019
+++ src/lib/libedit/readline.c	Sun Aug 15 06:06:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.159 2019/10/09 14:31:07 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 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.159 2019/10/09 14:31:07 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -952,8 +952,10 @@ history_expand(char *str, char **output)
 			(size += len + 1) * sizeof(*nresult));	\
 			if (nresult == NULL) {\
 el_free(*output);			\
-if (/*CONSTCOND*/fr)			\
+if (/*CONSTCOND*/fr) {			\
+	/*LINTED*/			\
 	el_free(tmp);			\
+}	\
 return 0;\
 			}		\
 			result = nresult;\



CVS commit: [netbsd-8] src/doc

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 10:04:53 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1691


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.95 src/doc/CHANGES-8.3:1.1.2.96
--- src/doc/CHANGES-8.3:1.1.2.95	Wed Aug 11 17:25:54 2021
+++ src/doc/CHANGES-8.3	Sun Aug 15 10:04:53 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.95 2021/08/11 17:25:54 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.96 2021/08/15 10:04:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1994,3 +1994,10 @@ sys/netinet6/in6_src.c1.88
 	mapped address.
 	[kardel, ticket #1690]
 
+sys/compat/common/vfs_syscalls_30.c		1.42
+sys/compat/common/vfs_syscalls_43.c		1.67
+sys/compat/common/vfs_syscalls_50.c		1.26
+
+	Fix compat stat(2) syscall kernel memory disclosure.
+	[christos, ticket #1691]
+



CVS commit: [netbsd-8] src/sys/compat/common

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 10:03:46 UTC 2021

Modified Files:
src/sys/compat/common [netbsd-8]: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1691):

sys/compat/common/vfs_syscalls_43.c: revision 1.67
sys/compat/common/vfs_syscalls_50.c: revision 1.26
sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.12.1 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.59.8.2 -r1.59.8.3 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.18 -r1.18.12.1 src/sys/compat/common/vfs_syscalls_50.c

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

Modified files:

Index: src/sys/compat/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.36 src/sys/compat/common/vfs_syscalls_30.c:1.36.12.1
--- src/sys/compat/common/vfs_syscalls_30.c:1.36	Mon Oct 20 11:58:01 2014
+++ src/sys/compat/common/vfs_syscalls_30.c	Sun Aug 15 10:03:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.36 2014/10/20 11:58:01 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.36.12.1 2021/08/15 10:03:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.36 2014/10/20 11:58:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.36.12.1 2021/08/15 10:03:46 martin Exp $");
 
 #include 
 #include 
@@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 
-static void cvtstat(struct stat13 *, const struct stat *);
 
 /*
  * Convert from a new to an old stat structure.
@@ -64,6 +63,8 @@ static void
 cvtstat(struct stat13 *ost, const struct stat *st)
 {
 
+	/* Handle any padding. */
+	memset(ost, 0, sizeof(*ost));
 	ost->st_dev = st->st_dev;
 	ost->st_ino = (uint32_t)st->st_ino;
 	ost->st_mode = st->st_mode;
@@ -101,8 +102,7 @@ compat_30_sys___stat13(struct lwp *l, co
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 
@@ -125,8 +125,7 @@ compat_30_sys___lstat13(struct lwp *l, c
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 /* ARGSUSED */
@@ -140,33 +139,12 @@ compat_30_sys_fhstat(struct lwp *l, cons
 	struct stat sb;
 	struct stat13 osb;
 	int error;
-	struct compat_30_fhandle fh;
-	struct mount *mp;
-	struct vnode *vp;
-
-	/*
-	 * Must be super user
-	 */
-	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
-	0, NULL, NULL, NULL)))
-		return (error);
 
-	if ((error = copyin(SCARG(uap, fhp), , sizeof(fh))) != 0)
-		return (error);
-
-	if ((mp = vfs_getvfs(_fsid)) == NULL)
-		return (ESTALE);
-	if (mp->mnt_op->vfs_fhtovp == NULL)
-		return EOPNOTSUPP;
-	if ((error = VFS_FHTOVP(mp, (struct fid*)_fid, )))
-		return (error);
-	error = vn_stat(vp, );
-	vput(vp);
+	error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), );
 	if (error)
-		return (error);
+		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof(sb));
-	return (error);
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -188,8 +166,7 @@ compat_30_sys___fstat13(struct lwp *l, c
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -265,7 +242,7 @@ again:
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
 		if (reclen & _DIRENT_ALIGN(bdp))
-			panic("netbsd30_getdents: bad reclen %d", reclen);
+			panic("%s: bad reclen %d", __func__, reclen);
 		if (cookie)
 			off = *cookie++; /* each entry points to the next */
 		else
@@ -368,9 +345,8 @@ compat_30_sys_getfh(struct lwp *l, const
 		error = EINVAL;
 	}
 	if (error)
-		return (error);
-	error = copyout(, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
-	return (error);
+		return error;
+	return copyout(, SCARG(uap, fhp), sizeof(fh));
 }
 
 /*
@@ -407,8 +383,7 @@ compat_30_sys___fhstat30(struct lwp *l, 
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap_30, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap_30, sb), sizeof(osb));
 }
 
 /* ARGSUSED */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.59.8.2 src/sys/compat/common/vfs_syscalls_43.c:1.59.8.3
--- src/sys/compat/common/vfs_syscalls_43.c:1.59.8.2	Sun Dec 10 09:36:36 2017
+++ 

CVS commit: [netbsd-9] src/doc

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 09:30:14 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Tickets #1334 -  #1337


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.21 src/doc/CHANGES-9.3:1.1.2.22
--- src/doc/CHANGES-9.3:1.1.2.21	Wed Aug 11 17:23:19 2021
+++ src/doc/CHANGES-9.3	Sun Aug 15 09:30:14 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.21 2021/08/11 17:23:19 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.22 2021/08/15 09:30:14 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -562,3 +562,34 @@ sys/netinet6/in6_src.c1.88
 	mapped address.
 	[kardel, ticket #1332]
 
+distrib/notes/hp300/hardware			1.25,1.26
+
+	Improve HP9000/360 and disk related information, mention
+	working emulated disks.
+	[tsutsui, ticket #1334]
+
+distrib/sun2/miniroot/install.md		1.8,1.9
+distrib/sun3/miniroot/install.md		1.8,1.9
+
+	Don't try to add swap on miniroot.
+	[tsutsui, ticket #1335]
+
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc 1.6
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc 1.7,1.8
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc 1.8
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc 1.1,1.2
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc 1.5
+crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc 1.7
+crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc 1.3
+
+	PR 56318: fix openssl arch specific usage of optimized asm code
+	for mips and sparc.
+	[tsutsui, ticket #1336]
+
+sys/compat/common/vfs_syscalls_30.c		1.42
+sys/compat/common/vfs_syscalls_43.c		1.67
+sys/compat/common/vfs_syscalls_50.c		1.26
+
+	Fix compat stat(2) syscall kernel memory disclosure.
+	[christos, ticket #1337]
+



CVS commit: [netbsd-9] src/sys/compat/common

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 09:27:50 UTC 2021

Modified Files:
src/sys/compat/common [netbsd-9]: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1337):

sys/compat/common/vfs_syscalls_43.c: revision 1.67
sys/compat/common/vfs_syscalls_50.c: revision 1.26
sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.4.1 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.64.4.1 -r1.64.4.2 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 src/sys/compat/common/vfs_syscalls_50.c

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

Modified files:

Index: src/sys/compat/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.38 src/sys/compat/common/vfs_syscalls_30.c:1.38.4.1
--- src/sys/compat/common/vfs_syscalls_30.c:1.38	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/vfs_syscalls_30.c	Sun Aug 15 09:27:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.38 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.38.4.1 2021/08/15 09:27:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.38 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.38.4.1 2021/08/15 09:27:50 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -61,8 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 
-static void cvtstat(struct stat13 *, const struct stat *);
-
 static const struct syscall_package vfs_syscalls_30_syscalls[] = {
 	{ SYS_compat_30___fhstat30, 0, (sy_call_t *)compat_30_sys___fhstat30 },
 	{ SYS_compat_30___fstat13, 0, (sy_call_t *)compat_30_sys___fstat13 },
@@ -83,6 +81,8 @@ static void
 cvtstat(struct stat13 *ost, const struct stat *st)
 {
 
+	/* Handle any padding. */
+	memset(ost, 0, sizeof(*ost));
 	ost->st_dev = st->st_dev;
 	ost->st_ino = (uint32_t)st->st_ino;
 	ost->st_mode = st->st_mode;
@@ -121,8 +121,7 @@ compat_30_sys___stat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 
@@ -146,8 +145,7 @@ compat_30_sys___lstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 /* ARGSUSED */
@@ -162,33 +160,12 @@ compat_30_sys_fhstat(struct lwp *l,
 	struct stat sb;
 	struct stat13 osb;
 	int error;
-	struct compat_30_fhandle fh;
-	struct mount *mp;
-	struct vnode *vp;
-
-	/*
-	 * Must be super user
-	 */
-	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
-	0, NULL, NULL, NULL)))
-		return (error);
 
-	if ((error = copyin(SCARG(uap, fhp), , sizeof(fh))) != 0)
-		return (error);
-
-	if ((mp = vfs_getvfs(_fsid)) == NULL)
-		return (ESTALE);
-	if (mp->mnt_op->vfs_fhtovp == NULL)
-		return EOPNOTSUPP;
-	if ((error = VFS_FHTOVP(mp, (struct fid*)_fid, )))
-		return (error);
-	error = vn_stat(vp, );
-	vput(vp);
+	error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), );
 	if (error)
-		return (error);
+		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof(sb));
-	return (error);
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -211,8 +188,7 @@ compat_30_sys___fstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -289,7 +265,7 @@ again:
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
 		if (reclen & _DIRENT_ALIGN(bdp))
-			panic("netbsd30_getdents: bad reclen %d", reclen);
+			panic("%s: bad reclen %d", __func__, reclen);
 		if (cookie)
 			off = *cookie++; /* each entry points to the next */
 		else
@@ -393,9 +369,8 @@ compat_30_sys_getfh(struct lwp *l, const
 		error = EINVAL;
 	}
 	if (error)
-		return (error);
-	error = copyout(, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
-	return (error);
+		return error;
+	return copyout(, SCARG(uap, fhp), sizeof(fh));
 }
 
 /*
@@ -434,8 +409,7 @@ compat_30_sys___fhstat30(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap_30, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap_30, sb), sizeof(osb));
 }
 
 /* ARGSUSED */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u 

CVS commit: [netbsd-9] src/crypto/external/bsd/openssl/lib/libcrypto/arch

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 08:58:56 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips [netbsd-9]:
aes.inc bn.inc crypto.inc poly1305.inc sha.inc
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc [netbsd-9]:
bn.inc
Added Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips [netbsd-9]:
mips.inc

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1336):

crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc: revision 
1.1
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc: revision 
1.2
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc: revision 1.7
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc: 
revision 1.5
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc: revision 1.8
crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc: revision 
1.3
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc: 
revision 1.8
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc: revision 
1.6
crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc: revision 
1.7

Centralize the logic for endian and 64 bit availability.

Handle the compat builds and both the n64 and non n64 variants

PR/56318: Izumi Tsutsui: Limit bn-sparcv8.S to sparc64; breaks
on sparcstation 2 (sun4c)

PR/56318: Izumi Tsutsui: Don't include mips.S for 32 bit mips because it
does not work for mips1


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.4.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc
cvs rdiff -u -r1.6 -r1.6.4.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc
cvs rdiff -u -r1.7 -r1.7.2.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc
cvs rdiff -u -r0 -r1.2.6.2 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc
cvs rdiff -u -r1.1.38.1 -r1.1.38.2 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc

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/openssl/lib/libcrypto/arch/mips/aes.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5.4.1
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5	Fri Mar  9 21:49:55 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc	Sun Aug 15 08:58:56 2021
@@ -1,7 +1,8 @@
-.if empty(MACHINE_ARCH:M*eb)
+.include "mips.inc"
+.if ${MIPS_LE}
 .PATH.S: ${.PARSEDIR}
 
-#AES_SRCS = aes-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S
+#AES_SRCS = aes-mips${MIPS_64}.S
 #AESCPPFLAGS = -DAES_ASM
 .endif
 

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6.4.1
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6	Fri Mar  9 21:49:55 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc	Sun Aug 15 08:58:56 2021
@@ -1,7 +1,10 @@
-.if empty(MACHINE_ARCH:M*eb)
+.include "mips.inc"
+
+# Don't include mips.S for 32 bit mips because it does not work for mips1
+.if ${MIPS_LE} && ${MIPS_64} == "64"
 .PATH.S: ${.PARSEDIR}
 
-BN_SRCS = mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S
+BN_SRCS = mips${MIPS_64}.S
 .endif
 
 .include "../../bn.inc"
Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6.4.1
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6	Fri Mar  9 21:49:55 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc	Sun Aug 15 08:58:56 2021
@@ -1,9 +1,12 @@
-.if empty(MACHINE_ARCH:M*eb)
+.include "mips.inc"
+
+.if ${MIPS_LE}
 .PATH.S: ${.PARSEDIR}
 
-SHA_SRCS += sha1-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S
-SHA_SRCS += sha512-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S
+SHA_SRCS += sha1-mips${MIPS_64}.S
+SHA_SRCS += sha512-mips${MIPS_64}.S
 
 SHACPPFLAGS = -DSHA1_ASM
 .endif
+
 .include "../../sha.inc"

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7.2.1
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7	Mon Sep 24 11:03:40 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc	Sun 

CVS commit: src/games/fortune/datfiles

2021-08-15 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 15 08:57:01 UTC 2021

Modified Files:
src/games/fortune/datfiles: netbsd-tips

Log Message:
Capitalization police.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/fortune/datfiles/netbsd-tips

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

Modified files:

Index: src/games/fortune/datfiles/netbsd-tips
diff -u src/games/fortune/datfiles/netbsd-tips:1.10 src/games/fortune/datfiles/netbsd-tips:1.11
--- src/games/fortune/datfiles/netbsd-tips:1.10	Fri Jun  4 11:18:31 2021
+++ src/games/fortune/datfiles/netbsd-tips	Sun Aug 15 08:57:01 2021
@@ -120,7 +120,7 @@ and "systat netstat" commands.
 Visit the NetBSD Security website to keep track of advisories:
   http://www.NetBSD.org/support/security/
 Or join the security-announce mailing list for alerts:
-  http://www.netbsd.org/mailinglists/#security-announce
+  http://www.NetBSD.org/mailinglists/#security-announce
 %
 Here's an example of finding what package a file belongs to:
 



CVS commit: [netbsd-9] src/distrib

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 08:44:39 UTC 2021

Modified Files:
src/distrib/sun2/miniroot [netbsd-9]: install.md
src/distrib/sun3/miniroot [netbsd-9]: install.md

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1335):

distrib/sun3/miniroot/install.md: revision 1.8
distrib/sun3/miniroot/install.md: revision 1.9
distrib/sun2/miniroot/install.md: revision 1.8
distrib/sun2/miniroot/install.md: revision 1.9

Don't try to add swap on miniroot.

Check if /tmp is writable to see whether the rootdev is already mounted.

Creating a dummy /tmp/root_writable file and after mountroot and
checking it on the second installation could be problematic if
users retry to installation after reboot without reinstalling miniroot.

Taken from amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/distrib/sun2/miniroot/install.md
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/distrib/sun3/miniroot/install.md

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

Modified files:

Index: src/distrib/sun2/miniroot/install.md
diff -u src/distrib/sun2/miniroot/install.md:1.5.2.1 src/distrib/sun2/miniroot/install.md:1.5.2.2
--- src/distrib/sun2/miniroot/install.md:1.5.2.1	Mon Dec 14 17:26:37 2020
+++ src/distrib/sun2/miniroot/install.md	Sun Aug 15 08:44:39 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $
+#	$NetBSD: install.md,v 1.5.2.2 2021/08/15 08:44:39 martin Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,12 +49,10 @@ md_set_term() {
 
 md_makerootwritable() {
 	# Just remount the root device read-write.
-	if [ ! -e /tmp/root_writable ]; then
+	if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u -t ffs /kern/rootdev /
-		swapctl -a /kern/rootdev
-		cp /dev/null /tmp/root_writable
 	fi
 }
 

Index: src/distrib/sun3/miniroot/install.md
diff -u src/distrib/sun3/miniroot/install.md:1.5.2.1 src/distrib/sun3/miniroot/install.md:1.5.2.2
--- src/distrib/sun3/miniroot/install.md:1.5.2.1	Mon Dec 14 17:26:37 2020
+++ src/distrib/sun3/miniroot/install.md	Sun Aug 15 08:44:39 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $
+#	$NetBSD: install.md,v 1.5.2.2 2021/08/15 08:44:39 martin Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,12 +49,10 @@ md_set_term() {
 
 md_makerootwritable() {
 	# Just remount the root device read-write.
-	if [ ! -e /tmp/root_writable ]; then
+	if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u /kern/rootdev /
-		swapctl -a /kern/rootdev
-		cp /dev/null /tmp/root_writable
 	fi
 }
 



CVS commit: [netbsd-9] src/distrib/notes/hp300

2021-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 15 08:41:47 UTC 2021

Modified Files:
src/distrib/notes/hp300 [netbsd-9]: hardware

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1334):

distrib/notes/hp300/hardware: revision 1.25
distrib/notes/hp300/hardware: revision 1.26

HP9000/360 can have up to 16 MB RAM, not 48 MB.

Per Service Information Manual HP 9000 Series 300 Computers Models 360/370.

Mention that emulated disks by HPDisk and HPDrive work.
Also add more HP-IB disk models per recent changes.


To generate a diff of this commit:
cvs rdiff -u -r1.20.14.1 -r1.20.14.2 src/distrib/notes/hp300/hardware

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

Modified files:

Index: src/distrib/notes/hp300/hardware
diff -u src/distrib/notes/hp300/hardware:1.20.14.1 src/distrib/notes/hp300/hardware:1.20.14.2
--- src/distrib/notes/hp300/hardware:1.20.14.1	Mon Dec 28 20:15:16 2020
+++ src/distrib/notes/hp300/hardware	Sun Aug 15 08:41:47 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: hardware,v 1.20.14.1 2020/12/28 20:15:16 martin Exp $
+.\"	$NetBSD: hardware,v 1.20.14.2 2021/08/15 08:41:47 martin Exp $
 .
 .Nx*M
 \*V will run on most HP 9000/300- and 400-series machines.
@@ -31,7 +31,7 @@ CPUs
 .br
 .Em "Requires Human Interface board"
 .It
-360 (25 MHz 68030, with 4 MB RAM built-in, up to 48 MB RAM)
+360 (25 MHz 68030, with 4 MB RAM built-in, up to 16 MB RAM)
 .br
 .Em "Requires System Interface board"
 .It
@@ -73,8 +73,14 @@ up to 128 MB RAM)
 HP-IB devices
 .(bullet -compact
 .Em rd ;
-CS80 disks: 2200, 2203, 7912, 7914, 7933, 7936, 7937, 7945, 7946,
-7957, 7958, and 7959
+CS80 disks: 2200, 2202, 2203, 7908, 7911, 7912, 7914, 7933, 7936, 7937, 7941,
+7945, 7946, 7957, 7958, and 7959
+.br
+.Em "Emulated CS80 disks by"
+.Lk http://www.dalton.ax/hpdisk/ HPDisk
+.Em and
+.Lk https://www.hp9845.net/9845/projects/hpdrive/ HPDrive
+.Em "also work."
 .It
 .Em rd ;
 CS80 floppy disks: 9122, 9134 (possibly others)



CVS commit: src/sys/compat/common

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 07:57:46 UTC 2021

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/common/vfs_syscalls_50.c

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

Modified files:

Index: src/sys/compat/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.41 src/sys/compat/common/vfs_syscalls_30.c:1.42
--- src/sys/compat/common/vfs_syscalls_30.c:1.41	Fri Jan 31 04:01:23 2020
+++ src/sys/compat/common/vfs_syscalls_30.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 
-static void cvtstat(struct stat13 *, const struct stat *);
-
 static const struct syscall_package vfs_syscalls_30_syscalls[] = {
 	{ SYS_compat_30___fhstat30, 0, (sy_call_t *)compat_30_sys___fhstat30 },
 	{ SYS_compat_30___fstat13, 0, (sy_call_t *)compat_30_sys___fstat13 },
@@ -85,6 +83,8 @@ static void
 cvtstat(struct stat13 *ost, const struct stat *st)
 {
 
+	/* Handle any padding. */
+	memset(ost, 0, sizeof(*ost));
 	ost->st_dev = st->st_dev;
 	ost->st_ino = (uint32_t)st->st_ino;
 	ost->st_mode = st->st_mode;
@@ -123,8 +123,7 @@ compat_30_sys___stat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 
@@ -148,8 +147,7 @@ compat_30_sys___lstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 /* ARGSUSED */
@@ -164,34 +162,12 @@ compat_30_sys_fhstat(struct lwp *l,
 	struct stat sb;
 	struct stat13 osb;
 	int error;
-	struct compat_30_fhandle fh;
-	struct mount *mp;
-	struct vnode *vp;
-
-	/*
-	 * Must be super user
-	 */
-	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
-	0, NULL, NULL, NULL)))
-		return (error);
 
-	if ((error = copyin(SCARG(uap, fhp), , sizeof(fh))) != 0)
-		return (error);
-
-	if ((mp = vfs_getvfs(_fsid)) == NULL)
-		return (ESTALE);
-	if (mp->mnt_op->vfs_fhtovp == NULL)
-		return EOPNOTSUPP;
-	error = VFS_FHTOVP(mp, (struct fid*)_fid, LK_EXCLUSIVE, );
-	if (error != 0)
-		return (error);
-	error = vn_stat(vp, );
-	vput(vp);
+	error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), );
 	if (error)
-		return (error);
+		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof(osb));
-	return (error);
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -214,8 +190,7 @@ compat_30_sys___fstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -292,7 +267,7 @@ again:
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
 		if (reclen & _DIRENT_ALIGN(bdp))
-			panic("netbsd30_getdents: bad reclen %d", reclen);
+			panic("%s: bad reclen %d", __func__, reclen);
 		if (cookie)
 			off = *cookie++; /* each entry points to the next */
 		else
@@ -396,9 +371,8 @@ compat_30_sys_getfh(struct lwp *l, const
 		error = EINVAL;
 	}
 	if (error)
-		return (error);
-	error = copyout(, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
-	return (error);
+		return error;
+	return copyout(, SCARG(uap, fhp), sizeof(fh));
 }
 
 /*
@@ -437,8 +411,7 @@ compat_30_sys___fhstat30(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap_30, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap_30, sb), sizeof(osb));
 }
 
 /* ARGSUSED */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.66 src/sys/compat/common/vfs_syscalls_43.c:1.67
--- src/sys/compat/common/vfs_syscalls_43.c:1.66	Wed Jun 24 06:28:16 2020
+++ src/sys/compat/common/vfs_syscalls_43.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.66