CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
@@ -330,6 +464,12 @@ main(int argc, char **argv ENVP_ARG)
 tio.c_cflag |= CS8;
 tio.c_cc[VMIN] = 6;
 tio.c_cc[VTIME] = 1;
+#else /* not USE_TERMIOS */
+rc = ioctl(tty, TIOCGETP, &sgorig);
+sg = sgorig;
+sg.sg_flags |= RAW;
+UIntClr(sg.sg_flags, ECHO);
+#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */
 if (rc != 0)
 	failed("get tty settings");
 
@@ -337,7 +477,13 @@ main(int argc, char **argv ENVP_ARG)
 signal(SIGQUIT, onintr);
 signal(SIGTERM, onintr);
 
+#ifdef USE_ANY_SYSV_TERMIO
+rc = ioctl(tty, TCSETAW, &tio);
+#elif defined(USE_TERMIOS)
 rc = tcsetattr(tty, TCSADRAIN, &tio);
+#else /* not USE_TERMIOS */
+rc = ioctl(tty, TIOCSETP, &sg);
+#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */
 if (rc != 0)
 	failed("set tty settings");
 
@@ -364,8 +510,38 @@ main(int argc, char **argv ENVP_ARG)
 }
 if (restore[emu])
 	IGNORE_RC(write(tty, restore[emu], strlen(restore[emu])));
-
+#if defined(USE_STRUCT_WINSIZE)
+/* finally, set the tty's window size */
+if (getwsize[emu]) {
+	/* get the window size in pixels */
+	IGNORE_RC(write(tty, getwsize[emu], strlen(getwsize[emu])));
+	readstring(ttyfp, buf, wsize[emu]);
+	if (sscanf(buf, wsize[emu], &ts.ws_xpixel, &ts.ws_ypixel) != 2) {
+	fprintf(stderr, "%s: Can't get window size\r\n", myname);
+	onintr(0);
+	}
+	setup_winsize(ts, rows, cols, 0, 0);
+	SET_TTYSIZE(tty, ts);
+} else if (ioctl(tty, TIOCGWINSZ, &ts) != -1) {
+	/* we don't have any way of directly finding out
+	   the current height & width of the window in pixels.  We try
+	   our best by computing the font height and width from the "old"
+	   window-size values, and multiplying by these ratios... */
+#define scaled(old,new,len) (old)?((unsigned)(new)*(len)/(old)):(len)
+	setup_winsize(ts, rows, cols,
+		  scaled(TTYSIZE_ROWS(ts), rows, ts.ws_ypixel),
+		  scaled(TTYSIZE_COLS(ts), cols, ts.ws_xpixel));
+	SET_TTYSIZE(tty, ts);
+}
+#endif /* USE_STRUCT_WINSIZE */
+
+#ifdef USE_ANY_SYSV_TERMIO
+rc = ioctl(tty, TCSETAW, &tioorig);
+#elif defined(USE_TERMIOS)
 rc = tcsetattr(tty, TCSADRAIN, &tioorig);
+#else /* not USE_TERMIOS */
+rc = ioctl(tty, TIOCSETP, &sgorig);
+#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */
 if (rc != 0)
 	failed("set tty settings");
 
@@ -373,16 +549,62 @@ main(int argc, char **argv ENVP_ARG)
 signal(SIGQUIT, SIG_DFL);
 signal(SIGTERM, SIG_DFL);
 
+#ifdef USE_TERMCAP
+if (ok_tcap) {
+	/* update termcap string */
+	/* first do columns */
+	if ((ptr = x_strindex(termcap, "co#")) == NULL) {
+	fprintf(stderr, "%s: No `co#'\n", myname);
+	exit(EXIT_FAILURE);
+	}
+
+	i = (int) (ptr - termcap) + 3;
+	strncpy(newtc, termcap, (size_t) i);
+	sprintf(newtc + i, "%d", cols);
+	if ((ptr = strchr(ptr, ':')) != 0)
+	strcat(newtc, ptr);
+
+	/* now do lines */
+	if ((ptr = x_strindex(newtc, "li#")) == NULL) {
+	fprintf(stderr, "%s: No `li#'\n", myname);
+	exit(EXIT_FAILURE);
+	}
+
+	i = (int) (ptr - newtc) + 3;
+	strncpy(termcap, newtc, (size_t) i);
+	sprintf(termcap + i, "%d", rows);
+	if ((ptr = strchr(ptr, ':')) != 0)
+	strcat(termcap, ptr);
+}
+#endif /* USE_TERMCAP */
 
 if (SHELL_BOURNE == shell_type) {
 
+#ifdef USE_TERMCAP
+	if (ok_tcap) {
+	printf("%sTERMCAP=", setname);
+	print_termcap(termcap);
+	printf(";\nexport TERMCAP;\n");
+	}
+#endif /* USE_TERMCAP */
+#ifdef USE_TERMINFO
 	printf("%sCOLUMNS=%d;\nLINES=%d;\nexport COLUMNS LINES;\n",
 	   setname, cols, rows);
+#endif /* USE_TERMINFO */
 
 } else {			/* not Bourne shell */
 
+#ifdef USE_TERMCAP
+	if (ok_tcap) {
+	printf("set noglob;\n%ssetenv TERMCAP ", setname);
+	print_termcap(termcap);
+	printf(";\nunset noglob;\n");
+	}
+#endif /* USE_TERMCAP */
+#ifdef USE_TERMINFO
 	printf("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n",
 	   setname, cols, rows);
+#endif /* USE_TERMINFO */
 }
 exit(EXIT_SUCCESS);
 }

Added files:

Index: src/usr.bin/resize/resize.h
diff -u /dev/null src/usr.bin/resize/resize.h:1.1
--- /dev/null	Sat Feb 27 10:36:40 2021
+++ src/usr.bin/resize/resize.h	Sat Feb 27 10:36:39 2021
@@ -0,0 +1,92 @@
+/*	$NetBSD: resize.h,v 1.1 2021/02/27 15:36:39 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following discl

CVS commit: src/lib/libc/stdlib

2021-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 19:25:12 UTC 2021

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

Log Message:
arrange for tools build


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdlib/reallocarray.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/reallocarray.c
diff -u src/lib/libc/stdlib/reallocarray.c:1.10 src/lib/libc/stdlib/reallocarray.c:1.11
--- src/lib/libc/stdlib/reallocarray.c:1.10	Thu Jan  4 15:57:29 2018
+++ src/lib/libc/stdlib/reallocarray.c	Fri Feb 26 14:25:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: reallocarray.c,v 1.10 2018/01/04 20:57:29 kamil Exp $	*/
+/*	$NetBSD: reallocarray.c,v 1.11 2021/02/26 19:25:12 christos Exp $	*/
 /*	$OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $	*/
 
 /*-
@@ -30,8 +30,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif /* HAVE_NBTOOL_CONFIG_H */
+
 #include 
-__RCSID("$NetBSD: reallocarray.c,v 1.10 2018/01/04 20:57:29 kamil Exp $");
+__RCSID("$NetBSD: reallocarray.c,v 1.11 2021/02/26 19:25:12 christos Exp $");
 
 #include "namespace.h"
 



CVS commit: src/lib/libc/regex

2021-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 19:24:48 UTC 2021

Modified Files:
src/lib/libc/regex: regcomp.c regerror.c regexec.c regfree.c

Log Message:
Arrange for tools build


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/regex/regcomp.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/regex/regerror.c
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/regex/regexec.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/regex/regfree.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/regex/regcomp.c
diff -u src/lib/libc/regex/regcomp.c:1.44 src/lib/libc/regex/regcomp.c:1.45
--- src/lib/libc/regex/regcomp.c:1.44	Thu Feb 25 16:59:27 2021
+++ src/lib/libc/regex/regcomp.c	Fri Feb 26 14:24:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.44 2021/02/25 21:59:27 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.45 2021/02/26 19:24:47 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -42,12 +42,16 @@
  *	@(#)regcomp.c	8.5 (Berkeley) 3/20/94
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if 0
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
 #endif
-__RCSID("$NetBSD: regcomp.c,v 1.44 2021/02/25 21:59:27 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.45 2021/02/26 19:24:47 christos Exp $");
 
 #define _OPENBSD_SOURCE
 

Index: src/lib/libc/regex/regerror.c
diff -u src/lib/libc/regex/regerror.c:1.24 src/lib/libc/regex/regerror.c:1.25
--- src/lib/libc/regex/regerror.c:1.24	Tue Feb 23 17:14:59 2021
+++ src/lib/libc/regex/regerror.c	Fri Feb 26 14:24:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regerror.c,v 1.24 2021/02/23 22:14:59 christos Exp $	*/
+/*	$NetBSD: regerror.c,v 1.25 2021/02/26 19:24:47 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -37,12 +37,16 @@
  *	@(#)regerror.c	8.4 (Berkeley) 3/20/94
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if 0
 static char sccsid[] = "@(#)regerror.c	8.4 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regerror.c 326025 2017-11-20 19:49:47Z pfg $");
 #endif
-__RCSID("$NetBSD: regerror.c,v 1.24 2021/02/23 22:14:59 christos Exp $");
+__RCSID("$NetBSD: regerror.c,v 1.25 2021/02/26 19:24:47 christos Exp $");
 
 #include "namespace.h"
 #include 

Index: src/lib/libc/regex/regexec.c
diff -u src/lib/libc/regex/regexec.c:1.25 src/lib/libc/regex/regexec.c:1.26
--- src/lib/libc/regex/regexec.c:1.25	Thu Feb 25 16:28:40 2021
+++ src/lib/libc/regex/regexec.c	Fri Feb 26 14:24:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regexec.c,v 1.25 2021/02/25 21:28:40 christos Exp $	*/
+/*	$NetBSD: regexec.c,v 1.26 2021/02/26 19:24:47 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -37,12 +37,16 @@
  *	@(#)regexec.c	8.3 (Berkeley) 3/20/94
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if 0
 static char sccsid[] = "@(#)regexec.c	8.3 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regexec.c 326025 2017-11-20 19:49:47Z pfg $");
 #endif
-__RCSID("$NetBSD: regexec.c,v 1.25 2021/02/25 21:28:40 christos Exp $");
+__RCSID("$NetBSD: regexec.c,v 1.26 2021/02/26 19:24:47 christos Exp $");
 
 /*
  * the outer shell of regexec()

Index: src/lib/libc/regex/regfree.c
diff -u src/lib/libc/regex/regfree.c:1.18 src/lib/libc/regex/regfree.c:1.19
--- src/lib/libc/regex/regfree.c:1.18	Thu Feb 25 16:28:40 2021
+++ src/lib/libc/regex/regfree.c	Fri Feb 26 14:24:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regfree.c,v 1.18 2021/02/25 21:28:40 christos Exp $	*/
+/*	$NetBSD: regfree.c,v 1.19 2021/02/26 19:24:47 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -37,12 +37,16 @@
  *	@(#)regfree.c	8.3 (Berkeley) 3/20/94
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if 0
 static char sccsid[] = "@(#)regfree.c	8.3 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regfree.c 326025 2017-11-20 19:49:47Z pfg $");
 #endif
-__RCSID("$NetBSD: regfree.c,v 1.18 2021/02/25 21:28:40 christos Exp $");
+__RCSID("$NetBSD: regfree.c,v 1.19 2021/02/26 19:24:47 christos Exp $");
 
 #include "namespace.h"
 #include 



CVS commit: src/lib/libc/gen

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 03:19:34 UTC 2021

Modified Files:
src/lib/libc/gen: Makefile.inc

Log Message:
put back line accidentally removed.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/lib/libc/gen/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/lib/libc/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.207 src/lib/libc/gen/Makefile.inc:1.208
--- src/lib/libc/gen/Makefile.inc:1.207	Thu Feb 25 22:05:01 2021
+++ src/lib/libc/gen/Makefile.inc	Thu Feb 25 22:19:34 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.207 2021/02/26 03:05:01 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.208 2021/02/26 03:19:34 christos Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -145,6 +145,7 @@ MLINKS+=getpwent.3 endpwent.3 getpwent.3
 MLINKS+=getpwent.3 getpwnam_r.3 getpwent.3 getpwuid_r.3 getpwent.3 getpwent_r.3
 # getpwent.3 setpwfile.3 - deprecated
 MLINKS+=getttyent.3 endttyent.3 getttyent.3 getttynam.3 \
+	getttyent.3 setttyent.3 getttyent.3 setttyentpath.3
 MLINKS+=getusershell.3 endusershell.3 getusershell.3 setusershell.3
 MLINKS+=glob.3 globfree.3
 MLINKS+=glob.3 glob_pattern_p.3



CVS commit: src/distrib/sets/lists/comp

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 03:08:25 UTC 2021

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Add utmp man pages


To generate a diff of this commit:
cvs rdiff -u -r1.2374 -r1.2375 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2374 src/distrib/sets/lists/comp/mi:1.2375
--- src/distrib/sets/lists/comp/mi:1.2374	Mon Feb 15 09:38:06 2021
+++ src/distrib/sets/lists/comp/mi	Thu Feb 25 22:08:25 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2374 2021/02/15 14:38:06 christos Exp $
+#	$NetBSD: mi,v 1.2375 2021/02/26 03:08:25 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -6992,6 +6992,7 @@
 ./usr/share/man/cat3/endservent.0		comp-c-catman		.cat
 ./usr/share/man/cat3/endttyent.0		comp-c-catman		.cat
 ./usr/share/man/cat3/endusershell.0		comp-c-catman		.cat
+./usr/share/man/cat3/endutent.0			comp-c-catman		.cat
 ./usr/share/man/cat3/endutxent.0		comp-c-catman		.cat
 ./usr/share/man/cat3/endwin.0			comp-c-catman		.cat
 ./usr/share/man/cat3/erand48.0			comp-c-catman		.cat
@@ -7512,6 +7513,8 @@
 ./usr/share/man/cat3/getusershell.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getutmp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getutmpx.0			comp-c-catman		.cat
+./usr/share/man/cat3/getutent.0			comp-c-catman		.cat
+./usr/share/man/cat3/getutline.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getutxent.0		comp-c-catman		.cat
 ./usr/share/man/cat3/getutxid.0			comp-c-catman		.cat
 ./usr/share/man/cat3/getutxline.0		comp-c-catman		.cat
@@ -9532,6 +9535,7 @@
 ./usr/share/man/cat3/putenv.0			comp-c-catman		.cat
 ./usr/share/man/cat3/putp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/puts.0			comp-c-catman		.cat
+./usr/share/man/cat3/pututline.0		comp-c-catman		.cat
 ./usr/share/man/cat3/pututxline.0		comp-c-catman		.cat
 ./usr/share/man/cat3/putw.0			comp-c-catman		.cat
 ./usr/share/man/cat3/putwc.0			comp-c-catman		.cat
@@ -9941,6 +9945,7 @@
 ./usr/share/man/cat3/setupterm.0		comp-c-catman		.cat
 ./usr/share/man/cat3/setusercontext.0		comp-c-catman		.cat
 ./usr/share/man/cat3/setusershell.0		comp-c-catman		.cat
+./usr/share/man/cat3/setutent.0			comp-c-catman		.cat
 ./usr/share/man/cat3/setutxent.0		comp-c-catman		.cat
 ./usr/share/man/cat3/setvbuf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sha.0			comp-obsolete		obsolete
@@ -15261,6 +15266,7 @@
 ./usr/share/man/html3/endservent.html		comp-c-htmlman		html
 ./usr/share/man/html3/endttyent.html		comp-c-htmlman		html
 ./usr/share/man/html3/endusershell.html		comp-c-htmlman		html
+./usr/share/man/html3/endutent.html		comp-c-htmlman		html
 ./usr/share/man/html3/endutxent.html		comp-c-htmlman		html
 ./usr/share/man/html3/endwin.html		comp-c-htmlman		html
 ./usr/share/man/html3/erand48.html		comp-c-htmlman		html
@@ -15778,6 +15784,8 @@
 ./usr/share/man/html3/getusershell.html		comp-c-htmlman		html
 ./usr/share/man/html3/getutmp.html		comp-c-htmlman		html
 ./usr/share/man/html3/getutmpx.html		comp-c-htmlman		html
+./usr/share/man/html3/getutent.html		comp-c-htmlman		html
+./usr/share/man/html3/getutline.html		comp-c-htmlman		html
 ./usr/share/man/html3/getutxent.html		comp-c-htmlman		html
 ./usr/share/man/html3/getutxid.html		comp-c-htmlman		html
 ./usr/share/man/html3/getutxline.html		comp-c-htmlman		html
@@ -17783,6 +17791,7 @@
 ./usr/share/man/html3/putenv.html		comp-c-htmlman		html
 ./usr/share/man/html3/putp.html			comp-c-htmlman		html
 ./usr/share/man/html3/puts.html			comp-c-htmlman		html
+./usr/share/man/html3/pututline.html		comp-c-htmlman		html
 ./usr/share/man/html3/pututxline.html		comp-c-htmlman		html
 ./usr/share/man/html3/putw.html			comp-c-htmlman		html
 ./usr/share/man/html3/putwc.html		comp-c-htmlman		html
@@ -18183,6 +18192,7 @@
 ./usr/share/man/html3/setupterm.html		comp-c-htmlman		html
 ./usr/share/man/html3/setusercontext.html	comp-c-htmlman		html
 ./usr/share/man/html3/setusershell.html		comp-c-htmlman		html
+./usr/share/man/html3/setutent.html		comp-c-htmlman		html
 ./usr/share/man/html3/setutxent.html		comp-c-htmlman		html
 ./usr/share/man/html3/setvbuf.html		comp-c-htmlman		html
 ./usr/share/man/html3/sha1.html			comp-c-htmlman		html
@@ -23465,6 +23475,7 @@
 ./usr/share/man/man3/endservent.3		comp-c-man		.man
 ./usr/share/man/man3/endttyent.3		comp-c-man		.man
 ./usr/share/man/man3/endusershell.3		comp-c-man		.man
+./usr/share/man/man3/endutent.3			comp-c-man		.man
 ./usr/share/man/man3/endutxent.3		comp-c-man		.man
 ./usr/share/man/man3/endwin.3			comp-c-man		.man
 ./usr/share/man/man3/erand48.3			comp-c-man		.man
@@ -23985,6 +23996,8 @@
 ./usr/share/man/man3/getusershell.3		comp-c-man		.man
 ./usr/share/man/man3/getutmp.3			comp-c-man		.man
 ./usr/share/man/man3/getutmpx.3			comp-c-man		.man
+./usr/share/man/man3/getut

CVS commit: src/lib/libc/gen

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 03:05:01 UTC 2021

Modified Files:
src/lib/libc/gen: Makefile.inc
Added Files:
src/lib/libc/gen: endutent.3

Log Message:
PR/56012: Kouichi Hashikawa: getutent(3) man page is missing


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/lib/libc/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/gen/endutent.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/libc/gen/Makefile.inc
diff -u src/lib/libc/gen/Makefile.inc:1.206 src/lib/libc/gen/Makefile.inc:1.207
--- src/lib/libc/gen/Makefile.inc:1.206	Tue Sep 22 17:37:47 2020
+++ src/lib/libc/gen/Makefile.inc	Thu Feb 25 22:05:01 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.206 2020/09/22 21:37:47 nia Exp $
+#	$NetBSD: Makefile.inc,v 1.207 2021/02/26 03:05:01 christos Exp $
 #	from: @(#)Makefile.inc	8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -98,6 +98,8 @@ MLINKS+=directory.3 closedir.3 directory
 MLINKS+=endutxent.3 getutxent.3 endutxent.3 getutxid.3 \
 	endutxent.3 getutxline.3 endutxent.3 pututxline.3 \
 	endutxent.3 setutxent.3
+MLINKS+=endutent.3 getutent.3 endutent.3 getutline.3 endutent.3 pututline.3 \
+	endutent.3 setutent.3
 MLINKS+=err.3 verr.3 err.3 errx.3 err.3 verrx.3 err.3 warn.3 err.3 vwarn.3 \
 err.3 warnx.3 err.3 vwarnx.3 err.3 errc.3 err.3 verrc.3 err.3 warnc.3 \
 	err.3 vwarnc.3
@@ -143,7 +145,6 @@ MLINKS+=getpwent.3 endpwent.3 getpwent.3
 MLINKS+=getpwent.3 getpwnam_r.3 getpwent.3 getpwuid_r.3 getpwent.3 getpwent_r.3
 # getpwent.3 setpwfile.3 - deprecated
 MLINKS+=getttyent.3 endttyent.3 getttyent.3 getttynam.3 \
-	getttyent.3 setttyent.3 getttyent.3 setttyentpath.3
 MLINKS+=getusershell.3 endusershell.3 getusershell.3 setusershell.3
 MLINKS+=glob.3 globfree.3
 MLINKS+=glob.3 glob_pattern_p.3

Added files:

Index: src/lib/libc/gen/endutent.3
diff -u /dev/null src/lib/libc/gen/endutent.3:1.1
--- /dev/null	Thu Feb 25 22:05:01 2021
+++ src/lib/libc/gen/endutent.3	Thu Feb 25 22:05:01 2021
@@ -0,0 +1,123 @@
+.\"	$NetBSD: endutent.3,v 1.1 2021/02/26 03:05:01 christos Exp $
+.\"
+.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Thomas Klausner.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd February 25, 2021
+.Dt ENDUTENT 3
+.Os
+.Sh NAME
+.Nm endutent ,
+.Nm getutent ,
+.Nm getutline ,
+.Nm pututline ,
+.Nm setutent
+.Nd user accounting database functions
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In utmp.h
+.Ft void
+.Fn endutent void
+.Ft struct utmp *
+.Fn getutent void
+.Ft struct utmpx *
+.Fn getutline "const struct utmp *"
+.Ft struct utmp *
+.Fn pututline "const struct utmp *"
+.Ft void
+.Fn setutent void
+.Sh DESCRIPTION
+These functions provide access to the
+.Xr utmp 5
+user accounting database.
+.Pp
+These interfaces are only provided for compatibility purpuses and
+have been superseeded by
+.Xr endutent 3 ,
+.Xr utmpx 5 .
+.Pp
+.Fn getutent
+reads the next entry from the database;
+if the database was not yet open, it also opens it.
+.Fn setutent
+resets the database, so that the next
+.Fn getutent
+call will get the first entry.
+.Fn endutent
+closes the database.
+.Pp
+.Fn getutline
+returns the next
+entry which has the same name as specified in the
+.Va ut_line
+field, or
+.Dv NULL
+if no match is found.
+.Pp
+.Fn pututline
+adds the argument
+.Xr utmp 5
+entry line to the accounting database, replacing a previous entry for
+the same user if it exists.
+.Ss The utmp structure
+The
+.Nm utmp
+structure has the following def

CVS commit: src/usr.bin/who

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 02:45:43 UTC 2021

Modified Files:
src/usr.bin/who: utmpentry.c

Log Message:
PR/56013: Kouichi Hashikawa: Move setutent/setutxent right before the loops.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/who/utmpentry.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/who/utmpentry.c
diff -u src/usr.bin/who/utmpentry.c:1.21 src/usr.bin/who/utmpentry.c:1.22
--- src/usr.bin/who/utmpentry.c:1.21	Sat Oct  5 19:35:57 2019
+++ src/usr.bin/who/utmpentry.c	Thu Feb 25 21:45:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: utmpentry.c,v 1.21 2019/10/05 23:35:57 mrg Exp $	*/
+/*	$NetBSD: utmpentry.c,v 1.22 2021/02/26 02:45:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: utmpentry.c,v 1.21 2019/10/05 23:35:57 mrg Exp $");
+__RCSID("$NetBSD: utmpentry.c,v 1.22 2021/02/26 02:45:43 christos Exp $");
 #endif
 
 #include 
@@ -95,14 +95,7 @@ setup(const char *fname)
 	struct stat st;
 	const char *sfname;
 
-	if (fname == NULL) {
-#ifdef SUPPORT_UTMPX
-		setutxent();
-#endif
-#ifdef SUPPORT_UTMP
-		setutent();
-#endif
-	} else {
+	if (fname != NULL) {
 		size_t len = strlen(fname);
 		if (len == 0)
 			errx(1, "Filename cannot be 0 length.");
@@ -133,9 +126,9 @@ setup(const char *fname)
 			what &= ~1;
 		} else {
 			if (timespeccmp(&st.st_mtimespec, &utmpxtime, >))
-			utmpxtime = st.st_mtimespec;
+utmpxtime = st.st_mtimespec;
 			else
-			what &= ~1;
+what &= ~1;
 		}
 	}
 #endif
@@ -204,10 +197,11 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMPX
+	setutxent();
 	while ((what & 1) && (utx = getutxent()) != NULL) {
 		if (fname == NULL && ((1 << utx->ut_type) & etype) == 0)
 			continue;
-		if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) {
+		if ((ep = calloc(1, sizeof(*ep))) == NULL) {
 			warn(NULL);
 			return 0;
 		}
@@ -218,6 +212,7 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMP
+	setutent();
 	if ((etype & (1 << USER_PROCESS)) != 0) {
 		while ((what & 2) && (ut = getutent()) != NULL) {
 			if (fname == NULL && (*ut->ut_name == '\0' ||



CVS commit: src/external/bsd/nvi/usr.bin/nvi

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 00:41:56 UTC 2021

Modified Files:
src/external/bsd/nvi/usr.bin/nvi: Makefile

Log Message:
Put back local regex (thanks Rin)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/nvi/usr.bin/nvi/Makefile

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/nvi/usr.bin/nvi/Makefile
diff -u src/external/bsd/nvi/usr.bin/nvi/Makefile:1.23 src/external/bsd/nvi/usr.bin/nvi/Makefile:1.24
--- src/external/bsd/nvi/usr.bin/nvi/Makefile:1.23	Thu Feb 25 16:56:35 2021
+++ src/external/bsd/nvi/usr.bin/nvi/Makefile	Thu Feb 25 19:41:56 2021
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile,v 1.23 2021/02/25 21:56:35 christos Exp $
+#	$NetBSD: Makefile,v 1.24 2021/02/26 00:41:56 christos Exp $
 
 .include 
 
 USE_WIDECHAR?=yes
-USE_BUILTIN_REGEX?=no	# Our regex supports widechar
+USE_BUILTIN_REGEX?=yes	# Although our regex supports widechar nvi requires
+			# a non-standard API
 
 WARNS=	5
 



CVS commit: src/tests/lib/libc/regex

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 22:37:37 UTC 2021

Modified Files:
src/tests/lib/libc/regex: Makefile debug.c

Log Message:
Adjust for conditional NLS


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/regex/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/regex/debug.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/lib/libc/regex/Makefile
diff -u src/tests/lib/libc/regex/Makefile:1.10 src/tests/lib/libc/regex/Makefile:1.11
--- src/tests/lib/libc/regex/Makefile:1.10	Thu Aug 25 21:31:43 2016
+++ src/tests/lib/libc/regex/Makefile	Thu Feb 25 17:37:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2016/08/26 01:31:43 darcy Exp $
+# $NetBSD: Makefile,v 1.11 2021/02/25 22:37:36 christos Exp $
 
 NOMAN=
 
@@ -10,7 +10,7 @@ IMPLEMENTATION?=	-DREGEX_SPENCER -DSKIP_
 BINDIR=		${TESTSDIR}
 PROGS?=		h_regex
 SRCS.h_regex=	main.c split.c debug.c
-CPPFLAGS+=	-I${NETBSDSRCDIR}/lib/libc/regex ${IMPLEMENTATION}
+CPPFLAGS+=	-I${NETBSDSRCDIR}/lib/libc/regex ${IMPLEMENTATION} -DNLS
 
 TESTS_SH?=	t_regex
 TESTS_C=	t_regex_att

Index: src/tests/lib/libc/regex/debug.c
diff -u src/tests/lib/libc/regex/debug.c:1.6 src/tests/lib/libc/regex/debug.c:1.7
--- src/tests/lib/libc/regex/debug.c:1.6	Wed Feb 24 13:18:53 2021
+++ src/tests/lib/libc/regex/debug.c	Thu Feb 25 17:37:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.6 2021/02/24 18:18:53 christos Exp $	*/
+/*	$NetBSD: debug.c,v 1.7 2021/02/25 22:37:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -33,8 +33,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #ifndef __linux__
 /* Don't sort these! */



CVS commit: src/lib/libc/regex

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 21:59:27 UTC 2021

Modified Files:
src/lib/libc/regex: regcomp.c

Log Message:
add missing _


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/regex/regcomp.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/regex/regcomp.c
diff -u src/lib/libc/regex/regcomp.c:1.43 src/lib/libc/regex/regcomp.c:1.44
--- src/lib/libc/regex/regcomp.c:1.43	Thu Feb 25 16:47:46 2021
+++ src/lib/libc/regex/regcomp.c	Thu Feb 25 16:59:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.43 2021/02/25 21:47:46 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.44 2021/02/25 21:59:27 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
 #endif
-__RCSID("$NetBSD: regcomp.c,v 1.43 2021/02/25 21:47:46 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.44 2021/02/25 21:59:27 christos Exp $");
 
 #define _OPENBSD_SOURCE
 
@@ -65,7 +65,7 @@ __RCSID("$NetBSD: regcomp.c,v 1.43 2021/
 #include 
 #include 
 
-#if defined(_weak_alias) && !defined(LIBHACK)
+#if defined(__weak_alias) && !defined(LIBHACK)
 __weak_alias(regcomp,_regcomp)
 #endif
 



CVS commit: src/external/bsd/nvi/usr.bin/nvi

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 21:56:35 UTC 2021

Modified Files:
src/external/bsd/nvi/usr.bin/nvi: Makefile

Log Message:
we don't need the extra copy wide-regex anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/nvi/usr.bin/nvi/Makefile

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/nvi/usr.bin/nvi/Makefile
diff -u src/external/bsd/nvi/usr.bin/nvi/Makefile:1.22 src/external/bsd/nvi/usr.bin/nvi/Makefile:1.23
--- src/external/bsd/nvi/usr.bin/nvi/Makefile:1.22	Mon Apr 20 09:04:10 2020
+++ src/external/bsd/nvi/usr.bin/nvi/Makefile	Thu Feb 25 16:56:35 2021
@@ -1,18 +1,15 @@
-#	$NetBSD: Makefile,v 1.22 2020/04/20 13:04:10 joerg Exp $
+#	$NetBSD: Makefile,v 1.23 2021/02/25 21:56:35 christos Exp $
 
 .include 
 
 USE_WIDECHAR?=yes
+USE_BUILTIN_REGEX?=no	# Our regex supports widechar
 
 WARNS=	5
 
 COPTS.exf.c+=		-Wno-format-nonliteral
 COPTS.msg.c+=		-Wno-format-nonliteral
-.if ${USE_WIDECHAR} == "yes"
-.if ${ACTIVE_CC} == "gcc"
-COPTS.regexec.c+=	-Wno-old-style-definition
-.endif
-.else
+.if ${USE_WIDECHAR} != "yes"
 COPTS.v_increment.c+=	-Wno-format-nonliteral
 CWARNFLAGS.gcc+=	-Wno-unused
 CWARNFLAGS.clang+=	-Wno-unsequenced
@@ -57,7 +54,10 @@ NOTUSED=ip_funcs.c ip_read.c ip_screen.c
 	ip_run.c ip_send.c ip_trans.c ipc_cmd.c ipc_method.c
 
 # For wide char support
-.if ${USE_WIDECHAR} == "yes"
+.if ${USE_BUILTIN_REGEX} == "yes"
+.if ${ACTIVE_CC} == "gcc"
+COPTS.regexec.c+=	-Wno-old-style-definition
+.endif
 SRCS+=	regcomp.c regerror.c regexec.c regfree.c
 CPPFLAGS+=-I${DIST}/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR
 .endif



CVS commit: src/lib/libc/regex

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 21:47:46 UTC 2021

Modified Files:
src/lib/libc/regex: engine.c regcomp.c

Log Message:
fix NLS compilation


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/regex/engine.c
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/regex/regcomp.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/regex/engine.c
diff -u src/lib/libc/regex/engine.c:1.28 src/lib/libc/regex/engine.c:1.29
--- src/lib/libc/regex/engine.c:1.28	Thu Feb 25 16:28:40 2021
+++ src/lib/libc/regex/engine.c	Thu Feb 25 16:47:46 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: engine.c,v 1.28 2021/02/25 21:28:40 christos Exp $ */
+/* $NetBSD: engine.c,v 1.29 2021/02/25 21:47:46 christos Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -41,7 +41,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/lib/libc/regex/engine.c 368358 2020-12-05 03:16:05Z kevans $");
 #endif
-__RCSID("$NetBSD: engine.c,v 1.28 2021/02/25 21:28:40 christos Exp $");
+__RCSID("$NetBSD: engine.c,v 1.29 2021/02/25 21:47:46 christos Exp $");
 
 #include 
 
@@ -187,9 +187,8 @@ stepback(const char *start, const char *
 
 	return (ret);
 out:
-#else
-	return (cur - nchar) > start ? cur - nchar : NULL;
 #endif
+	return (cur - nchar) > start ? cur - nchar : NULL;
 }
 
 /*

Index: src/lib/libc/regex/regcomp.c
diff -u src/lib/libc/regex/regcomp.c:1.42 src/lib/libc/regex/regcomp.c:1.43
--- src/lib/libc/regex/regcomp.c:1.42	Thu Feb 25 16:28:40 2021
+++ src/lib/libc/regex/regcomp.c	Thu Feb 25 16:47:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.42 2021/02/25 21:28:40 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.43 2021/02/25 21:47:46 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
 #endif
-__RCSID("$NetBSD: regcomp.c,v 1.42 2021/02/25 21:28:40 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.43 2021/02/25 21:47:46 christos Exp $");
 
 #define _OPENBSD_SOURCE
 
@@ -2130,7 +2130,7 @@ findmust(struct parse *p, struct re_guts
 		while (OP(s = *scan++) != OCHAR)
 			continue;
 #ifdef NLS
-		clen = wcrtomb(cp, (int)OPND(s), &mbs);
+		size_t clen = wcrtomb(cp, (int)OPND(s), &mbs);
 		assert(clen != (size_t)-1);
 		cp += clen;
 #else



CVS commit: src/lib/libc/regex

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 21:28:40 UTC 2021

Modified Files:
src/lib/libc/regex: engine.c regcomp.c regexec.c regfree.c utils.h

Log Message:
Add glue to disable locale code in order to be smaller.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/regex/engine.c
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/regex/regcomp.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/regex/regexec.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/regex/regfree.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/regex/utils.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/libc/regex/engine.c
diff -u src/lib/libc/regex/engine.c:1.27 src/lib/libc/regex/engine.c:1.28
--- src/lib/libc/regex/engine.c:1.27	Wed Feb 24 13:13:21 2021
+++ src/lib/libc/regex/engine.c	Thu Feb 25 16:28:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: engine.c,v 1.27 2021/02/24 18:13:21 christos Exp $ */
+/* $NetBSD: engine.c,v 1.28 2021/02/25 21:28:40 christos Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -41,7 +41,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/lib/libc/regex/engine.c 368358 2020-12-05 03:16:05Z kevans $");
 #endif
-__RCSID("$NetBSD: engine.c,v 1.27 2021/02/24 18:13:21 christos Exp $");
+__RCSID("$NetBSD: engine.c,v 1.28 2021/02/25 21:28:40 christos Exp $");
 
 #include 
 
@@ -161,13 +161,14 @@ static const char *pchar(int ch);
 static const char *
 stepback(const char *start, const char *cur, int nchar)
 {
+#ifdef NLS
 	const char *ret;
 	size_t wc, mbc;
 	mbstate_t mbs;
 	size_t clen;
 
 	if (MB_CUR_MAX == 1)
-		return ((cur - nchar) > start ? cur - nchar : NULL);
+		goto out;
 
 	ret = cur;
 	for (wc = nchar; wc > 0; wc--) {
@@ -185,6 +186,10 @@ stepback(const char *start, const char *
 	}
 
 	return (ret);
+out:
+#else
+	return (cur - nchar) > start ? cur - nchar : NULL;
+#endif
 }
 
 /*

Index: src/lib/libc/regex/regcomp.c
diff -u src/lib/libc/regex/regcomp.c:1.41 src/lib/libc/regex/regcomp.c:1.42
--- src/lib/libc/regex/regcomp.c:1.41	Thu Feb 25 08:42:16 2021
+++ src/lib/libc/regex/regcomp.c	Thu Feb 25 16:28:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.41 2021/02/25 13:42:16 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.42 2021/02/25 21:28:40 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -47,12 +47,15 @@
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
 #endif
-__RCSID("$NetBSD: regcomp.c,v 1.41 2021/02/25 13:42:16 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.42 2021/02/25 21:28:40 christos Exp $");
 
 #define _OPENBSD_SOURCE
+
+#ifndef LIBHACK
 #define REGEX_GNU_EXTENSIONS
 
 #include "namespace.h"
+#endif
 #include 
 #include 
 #include 
@@ -61,10 +64,8 @@ __RCSID("$NetBSD: regcomp.c,v 1.41 2021/
 #include 
 #include 
 #include 
-#include 
-#include 
 
-#ifdef __weak_alias
+#if defined(_weak_alias) && !defined(LIBHACK)
 __weak_alias(regcomp,_regcomp)
 #endif
 
@@ -222,6 +223,46 @@ static char nuls[10];		/* place to point
 #define MIN(a,b)	((a)<(b)?(a):(b))
 #endif
 
+#ifndef NLS
+static const struct {
+	const char *name;
+	int (*func)(int);
+} wctypes[] = {
+#define ADD(x) { .name = # x, .func = is ## x }
+	ADD(alnum),
+	ADD(alpha),
+	ADD(blank),
+	ADD(cntrl),
+	ADD(digit),
+	ADD(graph),
+	ADD(lower),
+	ADD(print),
+	ADD(punct),
+	ADD(space),
+	ADD(upper),
+	ADD(xdigit),
+#undef ADD
+};
+
+wctype_t
+__regex_wctype(const char *str)
+{
+	for (size_t i = 0; i < __arraycount(wctypes); i++) {
+		if (strcmp(wctypes[i].name, str) == 0)
+			return (wctype_t)(i + 1);
+	}
+	return (wctype_t)0;
+}
+
+int
+__regex_iswctype(wint_t c, wctype_t ct)
+{
+	if (ct == 0)
+		return 0;
+	return (*wctypes[ct - 1].func)(c);
+}
+#endif
+
 static int/* 0 success, otherwise REG_something */
 regcomp_internal(regex_t * __restrict preg,
 	const char * __restrict pattern,
@@ -1063,7 +1104,7 @@ p_range_cmp(wchar_t c1, wchar_t c2)
 {
 #ifdef REGEX_LIBC_COLLATE
 	return __wcollate_range_cmp(c1, c2);
-#else
+#elif defined(NLS)
 	/* Copied from libc/collate __wcollate_range_cmp */
 	wchar_t s1[2], s2[2];
 
@@ -1071,7 +1112,15 @@ p_range_cmp(wchar_t c1, wchar_t c2)
 	s1[1] = L'\0';
 	s2[0] = c2;
 	s2[1] = L'\0';
-	return (wcscoll(s1, s2));
+	return wcscoll(s1, s2);
+#else
+	char s1[2], s2[2];
+
+	s1[0] = (char)c1;
+	s1[1] = '\0';
+	s2[0] = (char)c2;
+	s2[1] = '\0';
+	return strcoll(s1, s2);
 #endif
 }
 
@@ -1219,6 +1268,7 @@ p_b_cclass(struct parse *p, cset *cs)
 
 	p_b_cclass_named(p, cs, clname);
 }
+
 /*
  - p_b_cclass_named - deal with a named character class
  == static void p_b_cclass_named(struct parse *p, cset *cs, const char []);
@@ -1283,9 +1333,7 @@ p_b_coll_elem(struct parse *p,
 {
 	const char *sp = p->next;
 	struct cname *cp;
-	mbstate_t mbs;
-	wchar_t wc;
-	size_t clen, len;
+	size_t len;
 
 	_DIAGASSERT(p != NULL);
 
@@ -1299,6 +1347,11 @@ p_b_coll_elem(str

CVS commit: src/distrib/utils/libhack

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 21:24:00 UTC 2021

Modified Files:
src/distrib/utils/libhack: Makefile.inc

Log Message:
Add regcomp.c and regexec.c so that we get a version that does not use NLS
and brings in all the locale code.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/distrib/utils/libhack/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/distrib/utils/libhack/Makefile.inc
diff -u src/distrib/utils/libhack/Makefile.inc:1.36 src/distrib/utils/libhack/Makefile.inc:1.37
--- src/distrib/utils/libhack/Makefile.inc:1.36	Fri Apr 17 10:55:24 2020
+++ src/distrib/utils/libhack/Makefile.inc	Thu Feb 25 16:24:00 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.36 2020/04/17 14:55:24 jdolecek Exp $
+# $NetBSD: Makefile.inc,v 1.37 2021/02/25 21:24:00 christos Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -25,7 +25,7 @@ HACKOBJS+=	getcap.o getgrent.o getnet.o 
 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
 		nl_langinfo.o strcasecmp.o \
 		strerror.o strsignal.o syslog.o utmp.o fmtcheck.o \
-	aligned_alloc.o
+		aligned_alloc.o regcomp.o regexec.o
 
 .if (${USE_YP} != "no")
 HACKOBJS+=	yplib.o
@@ -78,9 +78,12 @@ libhack.o: ${HACKOBJS}
 	${HACKSRC} \
 	${HACKSRC}/../../../lib/libc/gen \
 	${HACKSRC}/../../../lib/libc/locale \
+	${HACKSRC}/../../../lib/libc/regex \
 	${HACKSRC}/../../../lib/libc/stdlib
 .else
 # XXX .PATH won't work here, because of crunchgen used by various builds
+regcomp.o:	${HACKSRC}/../../../lib/libc/regex/regcomp.c
+regexec.o:	${HACKSRC}/../../../lib/libc/regex/regexec.c
 getcap.o:	${HACKSRC}/../../../lib/libc/gen/getcap.c
 getgrent.o:	${HACKSRC}/getgrent.c
 gethost.o:	${HACKSRC}/gethost.c



CVS commit: src/lib/libc/regex

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 13:42:16 UTC 2021

Modified Files:
src/lib/libc/regex: regcomp.c

Log Message:
protect MIN from re-definition


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/regex/regcomp.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/regex/regcomp.c
diff -u src/lib/libc/regex/regcomp.c:1.40 src/lib/libc/regex/regcomp.c:1.41
--- src/lib/libc/regex/regcomp.c:1.40	Wed Feb 24 13:13:21 2021
+++ src/lib/libc/regex/regcomp.c	Thu Feb 25 08:42:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.40 2021/02/24 18:13:21 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.41 2021/02/25 13:42:16 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 __FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
 #endif
-__RCSID("$NetBSD: regcomp.c,v 1.40 2021/02/24 18:13:21 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.41 2021/02/25 13:42:16 christos Exp $");
 
 #define _OPENBSD_SOURCE
 #define REGEX_GNU_EXTENSIONS
@@ -218,7 +218,9 @@ static char nuls[10];		/* place to point
 #define	DROP(n)	(p->slen -= (n))
 
 /* Macro used by computejump()/computematchjump() */
+#ifndef MIN
 #define MIN(a,b)	((a)<(b)?(a):(b))
+#endif
 
 static int/* 0 success, otherwise REG_something */
 regcomp_internal(regex_t * __restrict preg,



CVS commit: src/tools/compat

2021-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 25 13:41:58 UTC 2021

Modified Files:
src/tools/compat: Makefile compat_defs.h configure configure.ac
nbtool_config.h.in

Log Message:
Add reallocarray; this is used by the new regex code and we don't want to
convert it to reallocarr so the code is kept similar with the original from
FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/tools/compat/Makefile
cvs rdiff -u -r1.117 -r1.118 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.98 -r1.99 src/tools/compat/configure \
src/tools/compat/configure.ac
cvs rdiff -u -r1.52 -r1.53 src/tools/compat/nbtool_config.h.in

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

Modified files:

Index: src/tools/compat/Makefile
diff -u src/tools/compat/Makefile:1.88 src/tools/compat/Makefile:1.89
--- src/tools/compat/Makefile:1.88	Sat Jun 13 06:49:17 2020
+++ src/tools/compat/Makefile	Thu Feb 25 08:41:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.88 2020/06/13 10:49:17 lukem Exp $
+#	$NetBSD: Makefile,v 1.89 2021/02/25 13:41:58 christos Exp $
 
 HOSTLIB=	nbcompat
 
@@ -13,7 +13,8 @@ SRCS=		atoll.c basename.c cdbr.c cdbw.c 
 		mi_vector_hash.c mkdtemp.c \
 		mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
 		pw_scan.c \
-		raise_default_signal.c rb.c reallocarr.c rmd160.c rmd160hl.c \
+		raise_default_signal.c rb.c reallocarr.c reallocarray.c \
+		rmd160.c rmd160hl.c \
 		regcomp.c regerror.c regexec.c regfree.c \
 		setenv.c setgroupent.c \
 		setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.117 src/tools/compat/compat_defs.h:1.118
--- src/tools/compat/compat_defs.h:1.117	Tue Feb 23 11:03:00 2021
+++ src/tools/compat/compat_defs.h	Thu Feb 25 08:41:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.117 2021/02/23 16:03:00 rin Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.118 2021/02/25 13:41:58 christos Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -556,6 +556,10 @@ int raise_default_signal(int);
 int reallocarr(void *, size_t, size_t);
 #endif
 
+#if !HAVE_DECL_REALLOCARRAY
+void *reallocarray(void *, size_t, size_t);
+#endif
+
 #if !HAVE_DECL_SETENV
 int setenv(const char *, const char *, int);
 #endif

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.98 src/tools/compat/configure:1.99
--- src/tools/compat/configure:1.98	Wed Jun 24 10:44:44 2020
+++ src/tools/compat/configure	Thu Feb 25 08:41:58 2021
@@ -4832,6 +4832,19 @@ fi
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_REALLOCARR $ac_have_decl
 _ACEOF
+ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "
+#include 
+
+"
+if test "x$ac_cv_have_decl_reallocarray" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_REALLOCARRAY $ac_have_decl
+_ACEOF
 ac_fn_c_check_decl "$LINENO" "getsubopt" "ac_cv_have_decl_getsubopt" "
 #include 
 
@@ -5285,7 +5298,7 @@ for ac_func in atoll asprintf asnprintf 
 	getopt getopt_long group_from_gid gid_from_group \
 	heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
 	mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
-	pwrite raise_default_signal random reallocarr setenv \
+	pwrite raise_default_signal random reallocarr reallocarray setenv \
 	setgroupent setprogname setpassent \
 	snprintb_m snprintf strlcat strlcpy strmode \
 	strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \
Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.98 src/tools/compat/configure.ac:1.99
--- src/tools/compat/configure.ac:1.98	Wed Jun 24 10:39:01 2020
+++ src/tools/compat/configure.ac	Thu Feb 25 08:41:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.98 2020/06/24 14:39:01 uwe Exp $
+#	$NetBSD: configure.ac,v 1.99 2021/02/25 13:41:58 christos Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -179,8 +179,9 @@ AC_CHECK_DECLS([asprintf, asnprintf, vas
 #include 
 ])
 
-AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, getsubopt,
-	setenv, strtoi, strtoll, strtou, setprogname, getprogname],,, [
+AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, reallocarray,
+	getsubopt, setenv, strtoi, strtoll, strtou, setprogname,
+	getprogname],,, [
 #include 
 ])
 
@@ -223,7 +224,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf 
 	getopt getopt_long group_from_gid gid_from_group \
 	heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
 	mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
-	pwrite raise_default_signal random reallocarr setenv \
+	pwrite raise_default_signal random reallocarr reallocarray setenv \
 	setgroupent setprogname setpassent \
 	snprintb_m snprintf strlcat strlcpy strmode \
 	strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \

Index: src/tools/compat/nbto

CVS commit: src/tests/lib/libc/regex

2021-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 18:18:53 UTC 2021

Modified Files:
src/tests/lib/libc/regex: debug.c

Log Message:
remove casts


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/regex/debug.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/lib/libc/regex/debug.c
diff -u src/tests/lib/libc/regex/debug.c:1.5 src/tests/lib/libc/regex/debug.c:1.6
--- src/tests/lib/libc/regex/debug.c:1.5	Tue Feb 23 21:33:56 2021
+++ src/tests/lib/libc/regex/debug.c	Wed Feb 24 13:18:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.5 2021/02/24 02:33:56 christos Exp $	*/
+/*	$NetBSD: debug.c,v 1.6 2021/02/24 18:18:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -64,9 +64,7 @@ regprint(regex_t *r, FILE *d)
 #ifndef REGEX_NODEBUG
 	struct re_guts *g = r->re_g;
 
-	fprintf(d, "%ld states, %zu ncsets", (long)g->nstates, g->ncsets);
-	fprintf(d, ", first %ld last %ld", (long)g->firststate,
-		(long)g->laststate);
+	fprintf(d, ", first %u last %u", g->firststate, g->laststate);
 	if (g->iflags&USEBOL)
 		fprintf(d, ", USEBOL");
 	if (g->iflags&USEEOL)
@@ -74,14 +72,13 @@ regprint(regex_t *r, FILE *d)
 	if (g->iflags&BAD)
 		fprintf(d, ", BAD");
 	if (g->nsub > 0)
-		fprintf(d, ", nsub=%ld", (long)g->nsub);
+		fprintf(d, ", nsub=%zu", g->nsub);
 	if (g->must != NULL)
-		fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen,
-g->must);
+		fprintf(d, ", must(%zu) `%*s'", g->mlen, (int)g->mlen, g->must);
 	if (g->backrefs)
 		fprintf(d, ", backrefs");
 	if (g->nplus > 0)
-		fprintf(d, ", nplus %ld", (long)g->nplus);
+		fprintf(d, ", nplus %u", g->nplus);
 	fprintf(d, "\n");
 	s_print(g, d);
 	fprintf(d, "\n");
@@ -144,63 +141,63 @@ s_print(struct re_guts *g, FILE *d)
 			fprintf(d, ".");
 			break;
 		case OANYOF:
-			fprintf(d, "[(%ld)", (long)opnd);
+			fprintf(d, "[(%u)", opnd);
 			fprintf(d, "]");
 			break;
 		case OBACK_:
-			fprintf(d, "(\\<%ld>", (long)opnd);
+			fprintf(d, "(\\<%u>", opnd);
 			break;
 		case O_BACK:
-			fprintf(d, "<%ld>\\)", (long)opnd);
+			fprintf(d, "<%u>\\)", opnd);
 			break;
 		case OPLUS_:
 			fprintf(d, "(+");
 			if (OP(*(s+opnd)) != O_PLUS)
-fprintf(d, "<%ld>", (long)opnd);
+fprintf(d, "<%u>", opnd);
 			break;
 		case O_PLUS:
 			if (OP(*(s-opnd)) != OPLUS_)
-fprintf(d, "<%ld>", (long)opnd);
+fprintf(d, "<%u>", opnd);
 			fprintf(d, "+)");
 			break;
 		case OQUEST_:
 			fprintf(d, "(?");
 			if (OP(*(s+opnd)) != O_QUEST)
-fprintf(d, "<%ld>", (long)opnd);
+fprintf(d, "<%u>", opnd);
 			break;
 		case O_QUEST:
 			if (OP(*(s-opnd)) != OQUEST_)
-fprintf(d, "<%ld>", (long)opnd);
+fprintf(d, "<%u>", opnd);
 			fprintf(d, "?)");
 			break;
 		case OLPAREN:
-			fprintf(d, "((<%ld>", (long)opnd);
+			fprintf(d, "((<%u>", opnd);
 			break;
 		case ORPAREN:
-			fprintf(d, "<%ld>))", (long)opnd);
+			fprintf(d, "<%u>))", opnd);
 			break;
 		case OCH_:
 			fprintf(d, "<");
-			if (OP(*(s+opnd)) != (sop)OOR2)
-fprintf(d, "<%ld>", (long)opnd);
+			if (OP(*(s+opnd)) != OOR2)
+fprintf(d, "<%u>", opnd);
 			break;
 		case OOR1:
-			if (OP(*(s-opnd)) != (sop)OOR1 && OP(*(s-opnd)) != (sop)OCH_)
-fprintf(d, "<%ld>", (long)opnd);
+			if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_)
+fprintf(d, "<%u>", opnd);
 			fprintf(d, "|");
 			break;
 		case OOR2:
 			fprintf(d, "|");
-			if (OP(*(s+opnd)) != (sop)OOR2 && OP(*(s+opnd)) != (sop)O_CH)
-fprintf(d, "<%ld>", (long)opnd);
+			if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH)
+fprintf(d, "<%u>", opnd);
 			break;
 		case O_CH:
-			if (OP(*(s-opnd)) != (sop)OOR1)
-fprintf(d, "<%ld>", (long)opnd);
+			if (OP(*(s-opnd)) != OOR1)
+fprintf(d, "<%u>", opnd);
 			fprintf(d, ">");
 			break;
 		default:
-			fprintf(d, "!%ld(%ld)!", (long)OP(*s), (long)opnd);
+			fprintf(d, "!%u(%u)!", OP(*s), opnd);
 			break;
 		}
 		if (!done)



CVS commit: src/lib/libc/regex

2021-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 18:13:21 UTC 2021

Modified Files:
src/lib/libc/regex: engine.c regcomp.c regex2.h regexec.c regfree.c

Log Message:
reduce casts


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/regex/engine.c
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/regex/regcomp.c
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/regex/regex2.h
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/regex/regexec.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/regex/regfree.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/regex/engine.c
diff -u src/lib/libc/regex/engine.c:1.26 src/lib/libc/regex/engine.c:1.27
--- src/lib/libc/regex/engine.c:1.26	Wed Feb 24 04:10:12 2021
+++ src/lib/libc/regex/engine.c	Wed Feb 24 13:13:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: engine.c,v 1.26 2021/02/24 09:10:12 wiz Exp $ */
+/* $NetBSD: engine.c,v 1.27 2021/02/24 18:13:21 christos Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
@@ -41,7 +41,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/lib/libc/regex/engine.c 368358 2020-12-05 03:16:05Z kevans $");
 #endif
-__RCSID("$NetBSD: engine.c,v 1.26 2021/02/24 09:10:12 wiz Exp $");
+__RCSID("$NetBSD: engine.c,v 1.27 2021/02/24 18:13:21 christos Exp $");
 
 #include 
 
@@ -210,7 +210,7 @@ matcher(struct re_guts *g,
 	const char *stop;
 	/* Boyer-Moore algorithms variables */
 	const char *pp;
-	int cj, mj;
+	size_t cj, mj;
 	const char *mustfirst;
 	const char *mustlast;
 	size_t *matchjump;
@@ -325,7 +325,7 @@ matcher(struct re_guts *g,
 break;
 			assert(m->coldp < m->endp);
 			m->coldp += XMBRTOWC(NULL, m->coldp,
-			m->endp - m->coldp, &m->mbs, 0);
+			(size_t)(m->endp - m->coldp), &m->mbs, 0);
 		}
 		if (nmatch == 1 && !g->backrefs)
 			break;		/* no further info needed */
@@ -385,7 +385,7 @@ matcher(struct re_guts *g,
 		NOTE("false alarm");
 		/* recycle starting later */
 		start = m->coldp + XMBRTOWC(NULL, m->coldp,
-		stop - m->coldp, &m->mbs, 0);
+		(size_t)(stop - m->coldp), &m->mbs, 0);
 		assert(start <= stop);
 	}
 
@@ -412,7 +412,7 @@ done:
 		m->pmatch = NULL;
 	}
 	if (m->lastpos != NULL) {
-		free((char *)m->lastpos);
+		free(__UNCONST(m->lastpos));
 		m->lastpos = NULL;
 	}
 	STATETEARDOWN(m);
@@ -461,7 +461,7 @@ dissect(
 			es += OPND(m->g->strip[es]);
 			break;
 		case OCH_:
-			while (OP(m->g->strip[es]) != (sop)O_CH)
+			while (OP(m->g->strip[es]) != O_CH)
 es += OPND(m->g->strip[es]);
 			break;
 		}
@@ -473,7 +473,8 @@ dissect(
 			assert(nope);
 			break;
 		case OCHAR:
-			sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
+			sp += XMBRTOWC(NULL, sp, (size_t)(stop - start),
+			&m->mbs, 0);
 			break;
 		case OBOL:
 		case OEOL:
@@ -486,7 +487,8 @@ dissect(
 			break;
 		case OANY:
 		case OANYOF:
-			sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
+			sp += XMBRTOWC(NULL, sp, (size_t)(stop - start),
+			&m->mbs, 0);
 			break;
 		case OBACK_:
 		case O_BACK:
@@ -579,7 +581,7 @@ dissect(
 assert(OP(m->g->strip[esub]) == OOR2);
 ssub = esub + 1;
 esub += OPND(m->g->strip[esub]);
-if (OP(m->g->strip[esub]) == (sop)OOR2)
+if (OP(m->g->strip[esub]) == OOR2)
 	esub--;
 else
 	assert(OP(m->g->strip[esub]) == O_CH);
@@ -669,14 +671,16 @@ backref(
 		case OCHAR:
 			if (sp == stop)
 return(NULL);
-			sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
+			sp += XMBRTOWC(&wc, sp, (size_t)(stop - sp),
+			&m->mbs, BADCHAR);
 			if (wc != (wint_t)OPND(s))
 return(NULL);
 			break;
 		case OANY:
 			if (sp == stop)
 return(NULL);
-			sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
+			sp += XMBRTOWC(&wc, sp, (size_t)(stop - sp),
+			&m->mbs, BADCHAR);
 			if (wc == BADCHAR)
 return (NULL);
 			break;
@@ -684,7 +688,8 @@ backref(
 			if (sp == stop)
 return (NULL);
 			cs = &m->g->sets[OPND(s)];
-			sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
+			sp += XMBRTOWC(&wc, sp, (size_t)(stop - sp),
+			&m->mbs, BADCHAR);
 			if (wc == BADCHAR || !CHIN(cs, wc))
 return(NULL);
 			break;
@@ -751,7 +756,7 @@ backref(
 			do {
 assert(OP(s) == OOR2);
 ss += OPND(s);
-			} while (OP(s = m->g->strip[ss]) != (sop)O_CH);
+			} while (OP(s = m->g->strip[ss]) != O_CH);
 			/* note that the ss++ gets us past the O_CH */
 			break;
 		default:	/* have to make a choice */
@@ -784,7 +789,7 @@ backref(
 		ssp = m->offp + m->pmatch[i].rm_so;
 		if (memcmp(sp, ssp, len) != 0)
 			return(NULL);
-		while (m->g->strip[ss] != (sop)SOP(O_BACK, i))
+		while (m->g->strip[ss] != SOP(O_BACK, i))
 			ss++;
 		return(backref(m, sp+len, stop, ss+1, stopst, lev, rec));
 	case OQUEST_:		/* to null or not */
@@ -816,13 +821,13 @@ backref(
 			if (dp != NULL)
 return(dp);
 			/* that one missed, try next one */
-			if (OP(m->g->strip[esub]) == (sop)O_CH)
+			if (OP(m->g->strip[esub]) == O_CH)
 return(NULL);	/* there

CVS commit: src/tests/lib/libc/regex

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 02:33:56 UTC 2021

Modified Files:
src/tests/lib/libc/regex: debug.c

Log Message:
minimal fix to match the library code (really make the constants unsigned
instead)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/regex/debug.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/lib/libc/regex/debug.c
diff -u src/tests/lib/libc/regex/debug.c:1.4 src/tests/lib/libc/regex/debug.c:1.5
--- src/tests/lib/libc/regex/debug.c:1.4	Tue Feb 23 09:59:09 2021
+++ src/tests/lib/libc/regex/debug.c	Tue Feb 23 21:33:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.4 2021/02/23 14:59:09 christos Exp $	*/
+/*	$NetBSD: debug.c,v 1.5 2021/02/24 02:33:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -181,21 +181,21 @@ s_print(struct re_guts *g, FILE *d)
 			break;
 		case OCH_:
 			fprintf(d, "<");
-			if (OP(*(s+opnd)) != OOR2)
+			if (OP(*(s+opnd)) != (sop)OOR2)
 fprintf(d, "<%ld>", (long)opnd);
 			break;
 		case OOR1:
-			if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_)
+			if (OP(*(s-opnd)) != (sop)OOR1 && OP(*(s-opnd)) != (sop)OCH_)
 fprintf(d, "<%ld>", (long)opnd);
 			fprintf(d, "|");
 			break;
 		case OOR2:
 			fprintf(d, "|");
-			if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH)
+			if (OP(*(s+opnd)) != (sop)OOR2 && OP(*(s+opnd)) != (sop)O_CH)
 fprintf(d, "<%ld>", (long)opnd);
 			break;
 		case O_CH:
-			if (OP(*(s-opnd)) != OOR1)
+			if (OP(*(s-opnd)) != (sop)OOR1)
 fprintf(d, "<%ld>", (long)opnd);
 			fprintf(d, ">");
 			break;



CVS commit: src/tests/usr.bin/sed

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 21:09:15 UTC 2021

Modified Files:
src/tests/usr.bin/sed: t_sed.sh

Log Message:
Will be fixed with regex update


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/sed/t_sed.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/usr.bin/sed/t_sed.sh
diff -u src/tests/usr.bin/sed/t_sed.sh:1.7 src/tests/usr.bin/sed/t_sed.sh:1.8
--- src/tests/usr.bin/sed/t_sed.sh:1.7	Sat Oct  5 16:24:16 2019
+++ src/tests/usr.bin/sed/t_sed.sh	Tue Feb 23 16:09:14 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_sed.sh,v 1.7 2019/10/05 20:24:16 christos Exp $
+# $NetBSD: t_sed.sh,v 1.8 2021/02/23 21:09:14 christos Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -42,8 +42,7 @@ c2048_body() {
 
 atf_test_case emptybackref
 emptybackref_head() {
-	atf_set "descr" "Test that sed(1) handles " \
-			"empty back references (PR bin/28126)"
+	atf_set "descr" "Test that sed(1) handles empty back references"
 }
 
 emptybackref_body() {
@@ -51,8 +50,6 @@ emptybackref_body() {
 	atf_check -o inline:"foo1bar1\n" \
 		-x "echo foo1bar1 | sed -ne '/foo\(.*\)bar\1/p'"
 
-	atf_expect_fail "PR bin/28126"
-
 	atf_check -o inline:"foobar\n" \
 		-x "echo foobar | sed -ne '/foo\(.*\)bar\1/p'"
 }



CVS commit: src/include

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 17:14:42 UTC 2021

Modified Files:
src/include: regex.h

Log Message:
- Replace REG_ENOSYS (unused) with REG_ILLSEQ.
- Add REG_GNU


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/include/regex.h

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

Modified files:

Index: src/include/regex.h
diff -u src/include/regex.h:1.15 src/include/regex.h:1.16
--- src/include/regex.h:1.15	Thu Jan 14 16:45:18 2016
+++ src/include/regex.h	Tue Feb 23 12:14:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.h,v 1.15 2016/01/14 21:45:18 christos Exp $	*/
+/*	$NetBSD: regex.h,v 1.16 2021/02/23 17:14:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -101,6 +101,7 @@ typedef struct {
 #define	REG_NOSPEC	0020
 #define	REG_PEND	0040
 #define	REG_DUMP	0200
+#define	REG_GNU		0400
 
 /* regerror() flags */
 #define	REG_NOMATCH	 1
@@ -119,7 +120,7 @@ typedef struct {
 #define	REG_EMPTY	14
 #define	REG_ASSERT	15
 #define	REG_INVARG	16
-#define	REG_ENOSYS	17
+#define	REG_ILLSEQ  17
 #define	REG_ATOI	255	/* convert name to number (!) */
 #define	REG_ITOA	0400	/* convert number to name (!) */
 



CVS commit: src/tests/lib/libc/regex

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 17:13:44 UTC 2021

Modified Files:
src/tests/lib/libc/regex: main.c

Log Message:
Add REG_GNU


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/regex/main.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/lib/libc/regex/main.c
diff -u src/tests/lib/libc/regex/main.c:1.3 src/tests/lib/libc/regex/main.c:1.4
--- src/tests/lib/libc/regex/main.c:1.3	Tue Feb 23 10:00:01 2021
+++ src/tests/lib/libc/regex/main.c	Tue Feb 23 12:13:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.3 2021/02/23 15:00:01 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.4 2021/02/23 17:13:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -352,7 +352,7 @@ options(int type, char *s)
 {
 	char *p;
 	int o = (type == 'c') ? copts : eopts;
-	const char *legal = (type == 'c') ? "bisnmpP" : "^$#tl";
+	const char *legal = (type == 'c') ? "bisnmpg" : "^$#tl";
 
 	for (p = s; *p != '\0'; p++)
 		if (strchr(legal, *p) != NULL)
@@ -376,8 +376,8 @@ options(int type, char *s)
 			case 'p':
 o |= REG_PEND;
 break;
-			case 'P':
-o |= REG_POSIX;
+			case 'g':
+o |= REG_GNU;
 break;
 			case '^':
 o |= REG_NOTBOL;



CVS commit: src/tests/lib/libc/regex

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 16:00:37 UTC 2021

Modified Files:
src/tests/lib/libc/regex: t_regex_att.c

Log Message:
Add support for ENOSYS (was never set)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/regex/t_regex_att.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/lib/libc/regex/t_regex_att.c
diff -u src/tests/lib/libc/regex/t_regex_att.c:1.3 src/tests/lib/libc/regex/t_regex_att.c:1.4
--- src/tests/lib/libc/regex/t_regex_att.c:1.3	Sat Jan 14 15:59:23 2017
+++ src/tests/lib/libc/regex/t_regex_att.c	Tue Feb 23 11:00:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $	*/
+/*	$NetBSD: t_regex_att.c,v 1.4 2021/02/23 16:00:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $");
+__RCSID("$NetBSD: t_regex_att.c,v 1.4 2021/02/23 16:00:37 christos Exp $");
 
 #include 
 
@@ -284,7 +284,12 @@ geterror(const char *s, int *comp, int *
 		_DO(EMPTY, COMP)
 		_DO(ASSERT, COMP)
 		_DO(INVARG, COMP)
+#ifdef REG_ENOSYS
 		_DO(ENOSYS, COMP)
+#endif
+#ifdef REG_ILLSEQ
+		_DO(ILLSEQ, COMP)
+#endif
 #undef _DO
 	};
 	*comp = 0;



CVS commit: src/tests/lib/libc/regex

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 15:00:01 UTC 2021

Modified Files:
src/tests/lib/libc/regex: main.c

Log Message:
Add REG_POSIX, and make compile on linux where we don't have a lot of the
internal flags.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/regex/main.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/lib/libc/regex/main.c
diff -u src/tests/lib/libc/regex/main.c:1.2 src/tests/lib/libc/regex/main.c:1.3
--- src/tests/lib/libc/regex/main.c:1.2	Fri Sep 16 12:13:18 2011
+++ src/tests/lib/libc/regex/main.c	Tue Feb 23 10:00:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.2 2011/09/16 16:13:18 plunky Exp $	*/
+/*	$NetBSD: main.c,v 1.3 2021/02/23 15:00:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -52,6 +52,16 @@ static char empty = '\0';
 static char *eprint(int);
 static int efind(char *);
 
+#ifndef REG_ATOI
+#define REG_ATOI 0
+#define REG_ITOA 0
+#define REG_PEND 0
+#define REG_TRACE 0
+#define REG_BACKR 0
+#define REG_NOSPEC 0
+#define REG_LARGE 0
+#endif
+
 /*
  * main - do the simple case, hand off to regress() for regression
  */
@@ -72,7 +82,7 @@ main(int argc, char *argv[])
 
 	progname = argv[0];
 
-	while ((c = getopt(argc, argv, "c:e:S:E:x")) != -1)
+	while ((c = getopt(argc, argv, "c:E:e:S:x")) != -1)
 		switch (c) {
 		case 'c':	/* compile options */
 			copts = options('c', optarg);
@@ -80,12 +90,12 @@ main(int argc, char *argv[])
 		case 'e':	/* execute options */
 			eopts = options('e', optarg);
 			break;
-		case 'S':	/* start offset */
-			startoff = (regoff_t)atoi(optarg);
-			break;
 		case 'E':	/* end offset */
 			endoff = (regoff_t)atoi(optarg);
 			break;
+		case 'S':	/* start offset */
+			startoff = (regoff_t)atoi(optarg);
+			break;
 		case 'x':	/* Debugging. */
 			debug++;
 			break;
@@ -211,7 +221,9 @@ regress(FILE *in)
 		erbuf, bpname);
 		status = 1;
 	}
+#if REG_ATOI
 	re.re_endp = bpname;
+#endif
 	ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf));
 	if (atoi(erbuf) != (int)REG_BADPAT) {
 		fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n",
@@ -247,7 +259,9 @@ try(char *f0, char *f1, char *f2, char *
 	char f2copy[1000];
 
 	strcpy(f0copy, f0);
+#if REG_ATOI
 	re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL;
+#endif
 	fixstr(f0copy);
 	err = regcomp(&re, f0copy, opts);
 	if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
@@ -338,7 +352,7 @@ options(int type, char *s)
 {
 	char *p;
 	int o = (type == 'c') ? copts : eopts;
-	const char *legal = (type == 'c') ? "bisnmp" : "^$#tl";
+	const char *legal = (type == 'c') ? "bisnmpP" : "^$#tl";
 
 	for (p = s; *p != '\0'; p++)
 		if (strchr(legal, *p) != NULL)
@@ -362,6 +376,9 @@ options(int type, char *s)
 			case 'p':
 o |= REG_PEND;
 break;
+			case 'P':
+o |= REG_POSIX;
+break;
 			case '^':
 o |= REG_NOTBOL;
 break;
@@ -517,7 +534,9 @@ efind(char *name)
 
 	sprintf(efbuf, "REG_%s", name);
 	assert(strlen(efbuf) < sizeof(efbuf));
+#if REG_ATOI
 	re.re_endp = efbuf;
+#endif
 	(void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf));
 	return(atoi(efbuf));
 }



CVS commit: src/tests/lib/libc/regex

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 14:59:09 UTC 2021

Modified Files:
src/tests/lib/libc/regex: debug.c

Log Message:
Delete category stuff that has changed with the new regex; make compile
on linux and with TRE


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/regex/debug.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/lib/libc/regex/debug.c
diff -u src/tests/lib/libc/regex/debug.c:1.3 src/tests/lib/libc/regex/debug.c:1.4
--- src/tests/lib/libc/regex/debug.c:1.3	Fri Jan 13 19:50:56 2017
+++ src/tests/lib/libc/regex/debug.c	Tue Feb 23 09:59:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.3 2017/01/14 00:50:56 christos Exp $	*/
+/*	$NetBSD: debug.c,v 1.4 2021/02/23 14:59:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993 The NetBSD Foundation, Inc.
@@ -36,14 +36,24 @@
 #include 
 #include 
 
+#ifndef __linux__
 /* Don't sort these! */
 #include "utils.h"
 #include "regex2.h"
+#else
+#define REGEX_NODEBUG
+#endif
+
+#ifdef REGEX_TRE
+#define REGEX_NODEBUG
+#endif
 
 #include "test_regex.h"
 
+#ifndef REGEX_NODEBUG
 static void s_print(struct re_guts *, FILE *);
 static char *regchar(int);
+#endif
 
 /*
  * regprint - print a regexp for debugging
@@ -51,13 +61,10 @@ static char *regchar(int);
 void
 regprint(regex_t *r, FILE *d)
 {
+#ifndef REGEX_NODEBUG
 	struct re_guts *g = r->re_g;
-	int c;
-	int last;
-	int nincat[NC];
 
-	fprintf(d, "%ld states, %zu categories", (long)g->nstates,
-			g->ncategories);
+	fprintf(d, "%ld states, %zu ncsets", (long)g->nstates, g->ncsets);
 	fprintf(d, ", first %ld last %ld", (long)g->firststate,
 		(long)g->laststate);
 	if (g->iflags&USEBOL)
@@ -77,43 +84,11 @@ regprint(regex_t *r, FILE *d)
 		fprintf(d, ", nplus %ld", (long)g->nplus);
 	fprintf(d, "\n");
 	s_print(g, d);
-	for (size_t i = 0; i < g->ncategories; i++) {
-		nincat[i] = 0;
-		for (c = CHAR_MIN; c <= CHAR_MAX; c++)
-			if (g->categories[c] == i)
-nincat[i]++;
-	}
-	fprintf(d, "cc0#%d", nincat[0]);
-	for (size_t i = 1; i < g->ncategories; i++)
-		if (nincat[i] == 1) {
-			for (c = CHAR_MIN; c <= CHAR_MAX; c++)
-if (g->categories[c] == i)
-	break;
-			fprintf(d, ", %zu=%s", i, regchar(c));
-		}
 	fprintf(d, "\n");
-	for (size_t i = 1; i < g->ncategories; i++)
-		if (nincat[i] != 1) {
-			fprintf(d, "cc%zu\t", i);
-			last = -1;
-			for (c = CHAR_MIN; c <= CHAR_MAX+1; c++)	/* +1 does flush */
-if (c <= CHAR_MAX && g->categories[c] == i) {
-	if (last < 0) {
-		fprintf(d, "%s", regchar(c));
-		last = c;
-	}
-} else {
-	if (last >= 0) {
-		if (last != c-1)
-			fprintf(d, "-%s",
-regchar(c-1));
-		last = -1;
-	}
-}
-			fprintf(d, "\n");
-		}
+#endif
 }
 
+#ifndef REGEX_NODEBUG
 /*
  * s_print - print the strip for debugging
  */
@@ -121,11 +96,9 @@ static void
 s_print(struct re_guts *g, FILE *d)
 {
 	sop *s;
-	cset *cs;
 	int done = 0;
 	sop opnd;
 	int col = 0;
-	ssize_t last;
 	sopno offset = 2;
 #	define	GAP()	{	if (offset % 5 == 0) { \
 	if (col > 40) { \
@@ -172,22 +145,6 @@ s_print(struct re_guts *g, FILE *d)
 			break;
 		case OANYOF:
 			fprintf(d, "[(%ld)", (long)opnd);
-			cs = &g->sets[opnd];
-			last = -1;
-			for (size_t i = 0; i < g->csetsize+1; i++)	/* +1 flushes */
-if (CHIN(cs, i) && i < g->csetsize) {
-	if (last < 0) {
-		fprintf(d, "%s", regchar(i));
-		last = i;
-	}
-} else {
-	if (last >= 0) {
-		if (last != (ssize_t)i - 1)
-			fprintf(d, "-%s",
-			regchar(i - 1));
-		last = -1;
-	}
-}
 			fprintf(d, "]");
 			break;
 		case OBACK_:
@@ -243,7 +200,7 @@ s_print(struct re_guts *g, FILE *d)
 			fprintf(d, ">");
 			break;
 		default:
-			fprintf(d, "!%d(%d)!", OP(*s), opnd);
+			fprintf(d, "!%ld(%ld)!", (long)OP(*s), (long)opnd);
 			break;
 		}
 		if (!done)
@@ -265,3 +222,4 @@ regchar(int ch)
 		sprintf(buf, "\\%o", ch);
 	return(buf);
 }
+#endif



CVS commit: src/tests/lib/libc/regex/data

2021-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 14:57:16 UTC 2021

Modified Files:
src/tests/lib/libc/regex/data: meta.in repet_bounded.in repet_multi.in

Log Message:
Comment out tests that the new stricter regex does not like


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/regex/data/meta.in \
src/tests/lib/libc/regex/data/repet_bounded.in \
src/tests/lib/libc/regex/data/repet_multi.in

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/libc/regex/data/meta.in
diff -u src/tests/lib/libc/regex/data/meta.in:1.1 src/tests/lib/libc/regex/data/meta.in:1.2
--- src/tests/lib/libc/regex/data/meta.in:1.1	Sat Jan  8 13:10:32 2011
+++ src/tests/lib/libc/regex/data/meta.in	Tue Feb 23 09:57:16 2021
@@ -4,7 +4,8 @@ a[bc]d		&	abd	abd
 a\*c		&	a*c	a*c
 a\\b		&	a\b	a\b
 a\\\*b		&	a\*b	a\*b
-a\bc		&	abc	abc
+# legacy escape
+#a\bc		&	abc	abc
 a\		&C	EESCAPE
 a\\bc		&	a\bc	a\bc
 \{		bC	BADRPT
Index: src/tests/lib/libc/regex/data/repet_bounded.in
diff -u src/tests/lib/libc/regex/data/repet_bounded.in:1.1 src/tests/lib/libc/regex/data/repet_bounded.in:1.2
--- src/tests/lib/libc/regex/data/repet_bounded.in:1.1	Sat Jan  8 13:10:32 2011
+++ src/tests/lib/libc/regex/data/repet_bounded.in	Tue Feb 23 09:57:16 2021
@@ -1,9 +1,10 @@
 # the dreaded bounded repetitions
-{		&	{	{
-{abc		&	{abc	{abc
+# unclosed and with missing values are now errors
+#{		&	{	{
+#{abc		&	{abc	{abc
 {1		C	BADRPT
 {1}		C	BADRPT
-a{b		&	a{b	a{b
+#a{b		&	a{b	a{b
 a{1}b		-	ab	ab
 a\{1\}b		b	ab	ab
 a{1,}b		-	ab	ab
@@ -16,9 +17,9 @@ a{1a		C	EBRACE
 a\{1a		bC	EBRACE
 a{1a}		C	BADBR
 a\{1a\}		bC	BADBR
-a{,2}		-	a{,2}	a{,2}
+#a{,2}		-	a{,2}	a{,2}
 a\{,2\}		bC	BADBR
-a{,}		-	a{,}	a{,}
+#a{,}		-	a{,}	a{,}
 a\{,\}		bC	BADBR
 a{1,x}		C	BADBR
 a\{1,x\}	bC	BADBR
Index: src/tests/lib/libc/regex/data/repet_multi.in
diff -u src/tests/lib/libc/regex/data/repet_multi.in:1.1 src/tests/lib/libc/regex/data/repet_multi.in:1.2
--- src/tests/lib/libc/regex/data/repet_multi.in:1.1	Sat Jan  8 13:10:32 2011
+++ src/tests/lib/libc/regex/data/repet_multi.in	Tue Feb 23 09:57:16 2021
@@ -15,7 +15,8 @@ a?{1}		C	BADRPT
 a{1}*		C	BADRPT
 a{1}+		C	BADRPT
 a{1}?		C	BADRPT
-a*{b}		-	a{b}	a{b}
+# repetition needs to be a number
+#a*{b}		-	a{b}	a{b}
 a\{1\}\{1\}	bC	BADRPT
 a*\{1\}		bC	BADRPT
 a\{1\}*		bC	BADRPT



CVS commit: src/bin/ksh

2021-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 01:31:30 UTC 2021

Modified Files:
src/bin/ksh: siglist.sh

Log Message:
PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/siglist.sh

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

Modified files:

Index: src/bin/ksh/siglist.sh
diff -u src/bin/ksh/siglist.sh:1.12 src/bin/ksh/siglist.sh:1.13
--- src/bin/ksh/siglist.sh:1.12	Thu Mar 17 09:59:02 2016
+++ src/bin/ksh/siglist.sh	Mon Feb 22 20:31:30 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: siglist.sh,v 1.12 2016/03/17 13:59:02 christos Exp $
+#	$NetBSD: siglist.sh,v 1.13 2021/02/23 01:31:30 christos Exp $
 #
 # Script to generate a sorted, complete list of signals, suitable
 # for inclusion in trap.c as array initializer.
@@ -21,16 +21,17 @@ CPP="${1-cc -E}"
 # The trap here to make up for a bug in bash (1.14.3(1)) that calls the trap
 (trap $trapsigs;
  echo '#include "sh.h"';
- echo '	{ QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },';
+ echo ' { QwErTy /* dummy for sed sillies */ },';
  ${SED} -e '/^[	 ]*#/d' -e 's/^[	 ]*\([^ 	][^ 	]*\)[	 ][	 ]*\(.*[^ 	]\)[ 	]*$/#ifdef SIG\1\
 	{ QwErTy .signal = SIG\1 , .name = "\1", .mess = "\2" },\
 #endif/') > $in
-# work around for gcc 5
+echo '	{ QwErTy .signal = SIGNALS , .name = "DUMMY", .mess = "hook to expand array to total signals" },' >> $in
+# work around for gcc > 5
 $CPP $in | grep -v '^#' | tr -d '\n' | ${SED} 's/},/},\
 /g' > $out
 ${SED} -n 's/{ QwErTy/{/p' < $out | ${AWK} '{print NR, $0}' | sort -k 5n -k 1n |
-${SED} 's/^[0-9]* //' |
-${AWK} 'BEGIN { last=0; nsigs=0; }
+${SED} -E -e 's/^[0-9]* //' -e 's/ +/ /' |
+${AWK} 'BEGIN { last=0; }
 	{
 	if ($4 ~ /^[0-9][0-9]*$/ && $5 == ",") {
 		n = $4;



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2021-02-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 22 01:31:52 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Locking protocol changed again, adjust.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mpl/bind/dist/lib/isc/unix/socket.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/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.19 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.20
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.19	Fri Feb 19 11:42:20 2021
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sun Feb 21 20:31:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.19 2021/02/19 16:42:20 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.20 2021/02/22 01:31:51 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3214,8 +3214,6 @@ internal_fdwatch_write(isc__socket_t *so
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_WRITE);
-
-	UNLOCK(&sock->lock);
 }
 
 static void
@@ -3242,8 +3240,6 @@ internal_fdwatch_read(isc__socket_t *soc
 	if (more_data)
 		select_poke(sock->manager, sock->threadid, sock->fd,
 		SELECT_POKE_READ);
-
-	UNLOCK(&sock->lock);
 }
 
 /*



CVS commit: src/distrib/sets/lists

2021-02-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 21 02:29:57 UTC 2021

Modified Files:
src/distrib/sets/lists/xbase: md.evbarm
src/distrib/sets/lists/xdebug: md.evbarm

Log Message:
Add missing compatx11file


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/xbase/md.evbarm
cvs rdiff -u -r1.28 -r1.29 src/distrib/sets/lists/xdebug/md.evbarm

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/xbase/md.evbarm
diff -u src/distrib/sets/lists/xbase/md.evbarm:1.6 src/distrib/sets/lists/xbase/md.evbarm:1.7
--- src/distrib/sets/lists/xbase/md.evbarm:1.6	Sat Jan 18 19:58:13 2020
+++ src/distrib/sets/lists/xbase/md.evbarm	Sat Feb 20 21:29:56 2021
@@ -1,10 +1,10 @@
-# $NetBSD: md.evbarm,v 1.6 2020/01/19 00:58:13 jmcneill Exp $
+# $NetBSD: md.evbarm,v 1.7 2021/02/21 02:29:56 christos Exp $
 ./usr/X11R7/lib/libdrm_amdgpu.so		xbase-libdrm_amdgpu-lib		xorg,compatx11file
 ./usr/X11R7/lib/libdrm_amdgpu.so.1		xbase-libdrm_amdgpu-lib		xorg,compatx11file
 ./usr/X11R7/lib/libdrm_amdgpu.so.1.0		xbase-libdrm_amdgpu-lib		xorg,compatx11file
-./usr/X11R7/lib/libdrm_nouveau.so		xbase-libdrm_nouveau-lib		xorg
-./usr/X11R7/lib/libdrm_nouveau.so.3		xbase-libdrm_nouveau-lib		xorg
-./usr/X11R7/lib/libdrm_nouveau.so.3.0		xbase-libdrm_nouveau-lib		xorg
+./usr/X11R7/lib/libdrm_nouveau.so		xbase-libdrm_nouveau-lib		xorg,compatx11file
+./usr/X11R7/lib/libdrm_nouveau.so.3		xbase-libdrm_nouveau-lib		xorg,compatx11file
+./usr/X11R7/lib/libdrm_nouveau.so.3.0		xbase-libdrm_nouveau-lib		xorg,compatx11file
 ./usr/X11R7/lib/libvdpau.so			xbase-libvdpau-lib		xorg,compatx11file
 ./usr/X11R7/lib/libvdpau.so.1			xbase-libvdpau-lib		xorg,compatx11file
 ./usr/X11R7/lib/libvdpau.so.1.0			xbase-libvdpau-lib		xorg,compatx11file

Index: src/distrib/sets/lists/xdebug/md.evbarm
diff -u src/distrib/sets/lists/xdebug/md.evbarm:1.28 src/distrib/sets/lists/xdebug/md.evbarm:1.29
--- src/distrib/sets/lists/xdebug/md.evbarm:1.28	Thu Aug 27 11:32:00 2020
+++ src/distrib/sets/lists/xdebug/md.evbarm	Sat Feb 20 21:29:57 2021
@@ -1,7 +1,7 @@
-# $NetBSD: md.evbarm,v 1.28 2020/08/27 15:32:00 riastradh Exp $
+# $NetBSD: md.evbarm,v 1.29 2021/02/21 02:29:57 christos Exp $
 ./usr/X11R7/lib/libdrm_amdgpu_g.a			xdebug-libdrm_amdgpu-debuglib	xorg,debuglib,compatx11file
-./usr/X11R7/lib/libdrm_nouveau_g.a			xdebug-libdrm_nouveau-debuglib	xorg,debuglib
-./usr/X11R7/lib/libvdpau_g.axdebug-libvdpau-debuglib	xorg,debuglib
+./usr/X11R7/lib/libdrm_nouveau_g.a			xdebug-libdrm_nouveau-debuglib	xorg,debuglib,compatx11file
+./usr/X11R7/lib/libvdpau_g.axdebug-libvdpau-debuglib	xorg,debuglib,compatx11file
 ./usr/X11R7/lib/modules/extensions/libdbe_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libdri2_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libdri_g.a		xdebug-obsolete	xorg,obsolete
@@ -21,8 +21,8 @@
 ./usr/libdata/debug/usr/X11R7/bin/cvt.debug	xdebug-xorg-server-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/bin/gtf.debug	xdebug-xorg-server-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/libdrm_amdgpu.so.1.0.debug	xdebug-libdrm_amdgpu-debug		xorg,debug,compatx11file
-./usr/libdata/debug/usr/X11R7/lib/libdrm_nouveau.so.3.0.debug	xdebug-libdrm_nouveau-debug		xorg,debug
-./usr/libdata/debug/usr/X11R7/lib/libvdpau.so.1.0.debug		xdebug-libvdpau-debug		xorg,debug
+./usr/libdata/debug/usr/X11R7/lib/libdrm_nouveau.so.3.0.debug	xdebug-libdrm_nouveau-debug		xorg,debug,compatx11file
+./usr/libdata/debug/usr/X11R7/lib/libvdpau.so.1.0.debug		xdebug-libvdpau-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/mesa_dri_drivers.so.0.debug	xdebug-dri-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/nouveau_dri.so.0.debug	xdebug-xf86-video-nouveau-debug		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/r200_dri.so.0.debug	xdebug-dri-debug		xorg,debug



CVS commit: src/external/bsd/byacc/dist

2021-02-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 21 00:36:06 UTC 2021

Modified Files:
src/external/bsd/byacc/dist: main.c

Log Message:
set explicit_file_name when we use getopt.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/byacc/dist/main.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/bsd/byacc/dist/main.c
diff -u src/external/bsd/byacc/dist/main.c:1.19 src/external/bsd/byacc/dist/main.c:1.20
--- src/external/bsd/byacc/dist/main.c:1.19	Sat Feb 20 17:57:56 2021
+++ src/external/bsd/byacc/dist/main.c	Sat Feb 20 19:36:06 2021
@@ -1,9 +1,9 @@
-/*	$NetBSD: main.c,v 1.19 2021/02/20 22:57:56 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.20 2021/02/21 00:36:06 christos Exp $	*/
 
 #include "defs.h"
 
 #include 
-__RCSID("$NetBSD: main.c,v 1.19 2021/02/20 22:57:56 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2021/02/21 00:36:06 christos Exp $");
 /* Id: main.c,v 1.70 2020/09/10 17:32:55 tom Exp  */
 
 #include 
@@ -336,6 +336,7 @@ getargs(int argc, char *argv[])
 	break;
 	case 'o':
 	output_file_name = optarg;
+	explicit_file_name = 1;
 	break;
 	case 'p':
 	symbol_prefix = optarg;



CVS commit: src/doc

2021-02-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 22:59:37 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new byacc


To generate a diff of this commit:
cvs rdiff -u -r1.1779 -r1.1780 src/doc/3RDPARTY
cvs rdiff -u -r1.2781 -r1.2782 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.1779 src/doc/3RDPARTY:1.1780
--- src/doc/3RDPARTY:1.1779	Fri Feb 19 22:25:35 2021
+++ src/doc/3RDPARTY	Sat Feb 20 17:59:37 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1779 2021/02/20 03:25:35 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1780 2021/02/20 22:59:37 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -236,12 +236,12 @@ is a FreeBSD committer who has been help
 in the past.
 
 Package:	byacc
-Version:	20190617
-Current Vers:	20200330
+Version:	20210109
+Current Vers:	20210109
 Maintainer:	Thomas Dickey 
 Archive Site:	http://www.invisible-island.net/byacc/byacc.html
 Home Page:	http://www.invisible-island.net/byacc/byacc.html
-Date:		2020-06-13
+Date:		2021-02-20
 Mailing List:
 Responsible:	christos
 License:	Public Domain

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2781 src/doc/CHANGES:1.2782
--- src/doc/CHANGES:1.2781	Fri Feb 19 22:25:36 2021
+++ src/doc/CHANGES	Sat Feb 20 17:59:37 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2781 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2782 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -334,3 +334,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[tsutsui 20210207]
 	bind: Import version 9.16.12. [christos 20210219]
 	OpenSSL: Imported 1.1.1j. [christos 20210219]
+	byacc: Update to 20210109. [christos 20210220]



CVS import: src/external/bsd/byacc/dist

2021-02-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 20:30:16 UTC 2021

Update of /cvsroot/src/external/bsd/byacc/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv8719

Log Message:
2021-01-09  Thomas E. Dickey  

* package/debian/copyright, VERSION, package/byacc.spec, 
package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
bump

2021-01-05  Thomas E. Dickey  

* configure: regen

* aclocal.m4: resync with my-autoconf

2020-09-22  Thomas E. Dickey  

* closure.c, warshall.c:
fix undefined-behavior diagnosed with gcc -fsanitize=undefined (report 
by
Alexander Richardson)

2020-09-10  Thomas E. Dickey  

* LICENSE: RCS_BASE

* reader.c, output.c: cppcheck -- reduce scope

* defs.h: update to 2.0

* test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, 
test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, 
test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, 
test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, 
test/btyacc/calc_code_all.tab.c, test/btyacc/calc_code_default.tab.c, 
test/btyacc/calc_code_imports.tab.c, test/btyacc/calc_code_provides.tab.c, 
test/btyacc/calc_code_requires.tab.c, test/btyacc/calc_code_top.tab.c, 
test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, 
test/btyacc/defines1.calc.c, test/btyacc/defines2.calc.c, 
test/btyacc/defines3.calc.c, test/btyacc/empty.tab.c, 
test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, 
test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, 
test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, 
test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, 
test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/
err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, 
test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, 
test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, 
test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, 
test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, 
test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, 
test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, 
test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, 
test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, 
test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, 
test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, 
test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, 
test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, 
test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, 
test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, 
test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.
 tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, 
test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, 
test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, 
test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, 
test/btyacc/quote_calc4.tab.c, test/btyacc/rename_debug.c, 
test/btyacc/stdin1.calc.c, test/btyacc/stdin2.calc.c, 
test/btyacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, 
test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/calc_code_all.tab.c, 
test/yacc/calc_code_default.tab.c, test/yacc/calc_code_imports.tab.c, 
test/yacc/calc_code_provides.tab.c, test/yacc/calc_code_requires.tab.c, 
test/yacc/calc_code_top.tab.c, test/yacc/code_calc.code.c, 
test/yacc/code_error.code.c, test/yacc/defines1.calc.c, 
test/yacc/defines2.calc.c, test/yacc/defines3.calc.c, test/yacc/empty.tab.c, 
test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, 
test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_
 syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, 
test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, 
test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, 
test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, 
test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, 
test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, 
test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, 
test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, 
test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, 
test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, 
test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, 
test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, 
test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/expr.oxout.tab.c, 
test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, 
test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, 
test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-
 s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, 
test/yacc/quote_calc3.tab.c, test/yacc/quote_cal

CVS import: external/bsd/byacc/dist

2021-02-20 Thread Christos Zoulas
Module Name:external
Committed By:   christos
Date:   Sat Feb 20 20:28:12 UTC 2021

Update of /cvsroot/external/bsd/byacc/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv24788

Log Message:
2021-01-09  Thomas E. Dickey  

* package/debian/copyright, VERSION, package/byacc.spec, 
package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
bump

2021-01-05  Thomas E. Dickey  

* configure: regen

* aclocal.m4: resync with my-autoconf

2020-09-22  Thomas E. Dickey  

* closure.c, warshall.c:
fix undefined-behavior diagnosed with gcc -fsanitize=undefined (report 
by
Alexander Richardson)

2020-09-10  Thomas E. Dickey  

* LICENSE: RCS_BASE

* reader.c, output.c: cppcheck -- reduce scope

* defs.h: update to 2.0

* test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, 
test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, 
test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, 
test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, 
test/btyacc/calc_code_all.tab.c, test/btyacc/calc_code_default.tab.c, 
test/btyacc/calc_code_imports.tab.c, test/btyacc/calc_code_provides.tab.c, 
test/btyacc/calc_code_requires.tab.c, test/btyacc/calc_code_top.tab.c, 
test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, 
test/btyacc/defines1.calc.c, test/btyacc/defines2.calc.c, 
test/btyacc/defines3.calc.c, test/btyacc/empty.tab.c, 
test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, 
test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, 
test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, 
test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, 
test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/
err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, 
test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, 
test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, 
test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, 
test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, 
test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, 
test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, 
test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, 
test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, 
test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, 
test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, 
test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, 
test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, 
test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, 
test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, 
test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.
 tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, 
test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, 
test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, 
test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, 
test/btyacc/quote_calc4.tab.c, test/btyacc/rename_debug.c, 
test/btyacc/stdin1.calc.c, test/btyacc/stdin2.calc.c, 
test/btyacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, 
test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/calc_code_all.tab.c, 
test/yacc/calc_code_default.tab.c, test/yacc/calc_code_imports.tab.c, 
test/yacc/calc_code_provides.tab.c, test/yacc/calc_code_requires.tab.c, 
test/yacc/calc_code_top.tab.c, test/yacc/code_calc.code.c, 
test/yacc/code_error.code.c, test/yacc/defines1.calc.c, 
test/yacc/defines2.calc.c, test/yacc/defines3.calc.c, test/yacc/empty.tab.c, 
test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, 
test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_
 syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, 
test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, 
test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, 
test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, 
test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, 
test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, 
test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, 
test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, 
test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, 
test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, 
test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, 
test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, 
test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/expr.oxout.tab.c, 
test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, 
test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, 
test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-
 s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, 
test/yacc/quote_calc3.tab.c, test/yacc/quote_c

CVS commit: src/doc

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 03:25:36 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1778 -r1.1779 src/doc/3RDPARTY
cvs rdiff -u -r1.2780 -r1.2781 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.1778 src/doc/3RDPARTY:1.1779
--- src/doc/3RDPARTY:1.1778	Fri Feb 19 12:09:35 2021
+++ src/doc/3RDPARTY	Fri Feb 19 22:25:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1778 2021/02/19 17:09:35 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1779 2021/02/20 03:25:35 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1113,12 +1113,12 @@ markus is very cooperative about it):
 - adjust the DEFAULT_PKCS11_WHITELIST for ssh-agent
 
 Package:	OpenSSL
-Version:	1.0.2o/1.1.1i
-Current Vers:	1.0.2t/1.1.1i
+Version:	1.0.2o/1.1.1j
+Current Vers:	1.0.2t/1.1.1j
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/
-Date:		2020-06-13
+Date:		2021-02-19
 Mailing List:	openssl-annou...@openssl.org
 Responsible:	christos, mjf, tls, riastradh, spz
 License:	OpenSSL and SSLeay license (both BSD-like)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2780 src/doc/CHANGES:1.2781
--- src/doc/CHANGES:1.2780	Fri Feb 19 12:08:22 2021
+++ src/doc/CHANGES	Fri Feb 19 22:25:36 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2780 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2781 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -333,3 +333,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	x68k: Add Emulate3Buttons support to X68k Xorg based monolithic server.
 		[tsutsui 20210207]
 	bind: Import version 9.16.12. [christos 20210219]
+	OpenSSL: Imported 1.1.1j. [christos 20210219]



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

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 03:22:14 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/dist: CHANGES Configure NEWS README
src/crypto/external/bsd/openssl/dist/apps: ca.c
src/crypto/external/bsd/openssl/dist/crypto: armcap.c ppccap.c
src/crypto/external/bsd/openssl/dist/crypto/conf: conf_def.c
src/crypto/external/bsd/openssl/dist/crypto/evp: evp_enc.c
src/crypto/external/bsd/openssl/dist/crypto/x509: x509_vfy.c
src/crypto/external/bsd/openssl/dist/ssl: d1_lib.c
src/crypto/external/bsd/openssl/dist/test: rsa_test.c

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssl/dist/CHANGES \
src/crypto/external/bsd/openssl/dist/NEWS \
src/crypto/external/bsd/openssl/dist/README
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssl/dist/Configure
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssl/dist/apps/ca.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/dist/crypto/armcap.c
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/openssl/dist/crypto/ppccap.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/dist/crypto/conf/conf_def.c
cvs rdiff -u -r1.11 -r1.12 \
src/crypto/external/bsd/openssl/dist/crypto/evp/evp_enc.c
cvs rdiff -u -r1.21 -r1.22 \
src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
cvs rdiff -u -r1.10 -r1.11 src/crypto/external/bsd/openssl/dist/ssl/d1_lib.c
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssl/dist/test/rsa_test.c

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/dist/CHANGES
diff -u src/crypto/external/bsd/openssl/dist/CHANGES:1.25 src/crypto/external/bsd/openssl/dist/CHANGES:1.26
--- src/crypto/external/bsd/openssl/dist/CHANGES:1.25	Wed Dec  9 19:33:08 2020
+++ src/crypto/external/bsd/openssl/dist/CHANGES	Fri Feb 19 22:22:13 2021
@@ -7,6 +7,43 @@
  https://github.com/openssl/openssl/commits/ and pick the appropriate
  release branch.
 
+ Changes between 1.1.1i and 1.1.1j [16 Feb 2021]
+
+  *) Fixed the X509_issuer_and_serial_hash() function. It attempts to
+ create a unique hash value based on the issuer and serial number data
+ contained within an X509 certificate. However it was failing to correctly
+ handle any errors that may occur while parsing the issuer field (which might
+ occur if the issuer field is maliciously constructed). This may subsequently
+ result in a NULL pointer deref and a crash leading to a potential denial of
+ service attack.
+ (CVE-2021-23841)
+ [Matt Caswell]
+
+  *) Fixed the RSA_padding_check_SSLv23() function and the RSA_SSLV23_PADDING
+ padding mode to correctly check for rollback attacks. This is considered a
+ bug in OpenSSL 1.1.1 because it does not support SSLv2. In 1.0.2 this is
+ CVE-2021-23839.
+ [Matt Caswell]
+
+  *) Fixed the EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate
+ functions. Previously they could overflow the output length argument in some
+ cases where the input length is close to the maximum permissable length for
+ an integer on the platform. In such cases the return value from the function
+ call would be 1 (indicating success), but the output length value would be
+ negative. This could cause applications to behave incorrectly or crash.
+ (CVE-2021-23840)
+ [Matt Caswell]
+
+  *) Fixed SRP_Calc_client_key so that it runs in constant time. The previous
+ implementation called BN_mod_exp without setting BN_FLG_CONSTTIME. This
+ could be exploited in a side channel attack to recover the password. Since
+ the attack is local host only this is outside of the current OpenSSL
+ threat model and therefore no CVE is assigned.
+
+ Thanks to Mohammed Sabt and Daniel De Almeida Braga for reporting this
+ issue.
+ [Matt Caswell]
+
  Changes between 1.1.1h and 1.1.1i [8 Dec 2020]
 
   *) Fixed NULL pointer deref in the GENERAL_NAME_cmp function
Index: src/crypto/external/bsd/openssl/dist/NEWS
diff -u src/crypto/external/bsd/openssl/dist/NEWS:1.25 src/crypto/external/bsd/openssl/dist/NEWS:1.26
--- src/crypto/external/bsd/openssl/dist/NEWS:1.25	Wed Dec  9 19:33:08 2020
+++ src/crypto/external/bsd/openssl/dist/NEWS	Fri Feb 19 22:22:13 2021
@@ -5,6 +5,16 @@
   This file gives a brief overview of the major changes between each OpenSSL
   release. For more details please read the CHANGES file.
 
+  Major changes between OpenSSL 1.1.1i and OpenSSL 1.1.1j [16 Feb 2021]
+
+  o Fixed a NULL pointer deref in the X509_issuer_and_serial_hash()
+function (CVE-2021-23841)
+  o Fixed the RSA_padding_check_SSLv23() function and the RSA_SSLV23_PADDING
+padding mode to correctly check for rollback attacks
+  o Fixed an overflow in the EVP_Ci

CVS commit: src/external/mpl/dhcp

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 01:43:04 UTC 2021

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
libisc needs libssl now


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mpl/dhcp/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/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.8 src/external/mpl/dhcp/Makefile.inc:1.9
--- src/external/mpl/dhcp/Makefile.inc:1.8	Sat May 30 16:47:59 2020
+++ src/external/mpl/dhcp/Makefile.inc	Fri Feb 19 20:43:04 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.8 2020/05/30 20:47:59 christos Exp $
+# $NetBSD: Makefile.inc,v 1.9 2021/02/20 01:43:04 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -54,8 +54,8 @@ DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} 
 .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
-LDADD+= -lcrypto -lipsec -lcrypt
-DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
+LDADD+= -lssl -lcrypto -lipsec -lcrypt
+DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
 .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif



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

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 01:18:03 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: ckgetopt.c

Log Message:
Prevent crashing when options are NULL in libc while linting
src/lib/libc/posix1e/acl_from_text.c


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/xlint/lint1/ckgetopt.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/lint1/ckgetopt.c
diff -u src/usr.bin/xlint/lint1/ckgetopt.c:1.2 src/usr.bin/xlint/lint1/ckgetopt.c:1.3
--- src/usr.bin/xlint/lint1/ckgetopt.c:1.2	Fri Feb 19 09:44:29 2021
+++ src/usr.bin/xlint/lint1/ckgetopt.c	Fri Feb 19 20:18:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ckgetopt.c,v 1.2 2021/02/19 14:44:29 rillig Exp $ */
+/* $NetBSD: ckgetopt.c,v 1.3 2021/02/20 01:18:02 christos Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: ckgetopt.c,v 1.2 2021/02/19 14:44:29 rillig Exp $");
+__RCSID("$NetBSD: ckgetopt.c,v 1.3 2021/02/20 01:18:02 christos Exp $");
 #endif
 
 #include 
@@ -100,7 +100,7 @@ is_getopt_call(const tnode_t *tn, char *
 static void
 check_unlisted_option(char opt)
 {
-	if (opt == '?')
+	if (opt == '?' || ck.options == NULL)
 		return;
 
 	const char *optptr = strchr(ck.options, opt);
@@ -116,6 +116,9 @@ check_unlisted_option(char opt)
 static void
 check_unhandled_option(void)
 {
+	if (ck.unhandled_options == NULL)
+		return;
+
 	for (const char *opt = ck.unhandled_options; *opt != '\0'; opt++) {
 		if (*opt == ' ' || *opt == ':')
 			continue;



CVS commit: src/doc

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 17:09:35 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
update the date for bind


To generate a diff of this commit:
cvs rdiff -u -r1.1777 -r1.1778 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.1777 src/doc/3RDPARTY:1.1778
--- src/doc/3RDPARTY:1.1777	Fri Feb 19 12:08:22 2021
+++ src/doc/3RDPARTY	Fri Feb 19 12:09:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1777 2021/02/19 17:08:22 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1778 2021/02/19 17:09:35 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -125,7 +125,7 @@ Current Vers:	9.16.12/MPL 9.17.10/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/
-Date:		2020-08-02
+Date:		2021-02-19
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-announce
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-users
 Responsible:	christos



CVS commit: src/doc

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 17:08:22 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1776 -r1.1777 src/doc/3RDPARTY
cvs rdiff -u -r1.2779 -r1.2780 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.1776 src/doc/3RDPARTY:1.1777
--- src/doc/3RDPARTY:1.1776	Thu Feb  4 22:27:58 2021
+++ src/doc/3RDPARTY	Fri Feb 19 12:08:22 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1776 2021/02/05 03:27:58 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.1777 2021/02/19 17:08:22 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -120,8 +120,8 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.16.5/MPL
-Current Vers:	9.16.5/MPL 9.17.3/MPL
+Version:	9.16.12/MPL
+Current Vers:	9.16.12/MPL 9.17.10/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2779 src/doc/CHANGES:1.2780
--- src/doc/CHANGES:1.2779	Sun Feb  7 11:58:53 2021
+++ src/doc/CHANGES	Fri Feb 19 12:08:22 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2779 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2780 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -332,3 +332,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbmips: Add support for QEMU "mipssim" emulator. [simonb 20210127]
 	x68k: Add Emulate3Buttons support to X68k Xorg based monolithic server.
 		[tsutsui 20210207]
+	bind: Import version 9.16.12. [christos 20210219]



CVS commit: src/distrib/sets/lists

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 17:06:26 UTC 2021

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

Log Message:
bump bind libraries


To generate a diff of this commit:
cvs rdiff -u -r1.910 -r1.911 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.269 -r1.270 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.910 src/distrib/sets/lists/base/shl.mi:1.911
--- src/distrib/sets/lists/base/shl.mi:1.910	Fri Dec  4 13:43:47 2020
+++ src/distrib/sets/lists/base/shl.mi	Fri Feb 19 12:06:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.910 2020/12/04 18:43:47 christos Exp $
+# $NetBSD: shl.mi,v 1.911 2021/02/19 17:06:26 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -232,8 +232,8 @@
 ./usr/lib/libbfd.so.17base-sys-shlib		compatfile,binutils=234
 ./usr/lib/libbfd.so.17.0			base-sys-shlib		compatfile,binutils=234
 ./usr/lib/libbind9.sobase-bind-shlib		compatfile
-./usr/lib/libbind9.so.15base-bind-shlib		compatfile
-./usr/lib/libbind9.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libbind9.so.16			base-bind-shlib		compatfile
+./usr/lib/libbind9.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libblacklist.so			base-obsolete		obsolete,compatfile
 ./usr/lib/libblacklist.so.0			base-obsolete		obsolete,compatfile
 ./usr/lib/libblacklist.so.0.0			base-obsolete		obsolete,compatfile
@@ -298,8 +298,8 @@
 ./usr/lib/libdm.so.0base-sys-shlib		compatfile
 ./usr/lib/libdm.so.0.0base-sys-shlib		compatfile
 ./usr/lib/libdns.sobase-bind-shlib		compatfile
-./usr/lib/libdns.so.15base-bind-shlib		compatfile
-./usr/lib/libdns.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libdns.so.16base-bind-shlib		compatfile
+./usr/lib/libdns.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libdns_sd.sobase-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0			base-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0.0			base-mdns-shlib		compatfile,mdns
@@ -374,17 +374,17 @@
 ./usr/lib/libipsec.so.3base-net-shlib		compatfile
 ./usr/lib/libipsec.so.3.0			base-net-shlib		compatfile
 ./usr/lib/libirs.sobase-bind-shlib		compatfile
-./usr/lib/libirs.so.15base-bind-shlib		compatfile
-./usr/lib/libirs.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libirs.so.16base-bind-shlib		compatfile
+./usr/lib/libirs.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libisc.sobase-bind-shlib		compatfile
-./usr/lib/libisc.so.15base-bind-shlib		compatfile
-./usr/lib/libisc.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libisc.so.16base-bind-shlib		compatfile
+./usr/lib/libisc.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libisccc.sobase-bind-shlib		compatfile
-./usr/lib/libisccc.so.15			base-bind-shlib		compatfile
-./usr/lib/libisccc.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libisccc.so.16			base-bind-shlib		compatfile
+./usr/lib/libisccc.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libisccfg.sobase-bind-shlib		compatfile
-./usr/lib/libisccfg.so.15			base-bind-shlib		compatfile
-./usr/lib/libisccfg.so.15.0			base-bind-shlib		compatfile
+./usr/lib/libisccfg.so.16			base-bind-shlib		compatfile
+./usr/lib/libisccfg.so.16.0			base-bind-shlib		compatfile
 ./usr/lib/libiscsi.sobase-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2base-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2.0			base-iscsi-shlib	iscsi,compatfile
@@ -469,8 +469,8 @@
 ./usr/lib/libnpf.so.0base-npf-shlib		npf,compatfile
 ./usr/lib/libnpf.so.0.1base-npf-shlib		npf,compatfile
 ./usr/lib/libns.sobase-bind-shlib		compatfile
-./usr/lib/libns.so.15base-bind-shlib		compatfile
-./usr/lib/libns.so.15.0base-bind-shlib		compatfile
+./usr/lib/libns.so.16base-bind-shlib		compatfile
+./usr/lib/libns.so.16.0base-bind-shlib		compatfile
 ./usr/lib/libnvmm.sobase-sys-shlib		nvmm,pic
 ./usr/lib/libnvmm.so.0base-sys-shlib		nvmm,pic
 ./usr/lib/libnvmm.so.0.1			base-sys-shlib		nvmm,pic

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.269 src/distrib/sets/lists/debug/shl.mi:1.270
--- src/distrib/sets/lists/debug/shl.mi:1.269	Fri Dec  4 13:43:47 2020
+++ src/distrib/sets/lists/debug/shl.mi	Fri Feb 19 12:06:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.269 2020/12/04 18:43:47 christos Exp $
+# $NetBSD: shl.mi,v 1.270 2021/02/19 17:06:26 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
@@ -77,7 +77,7 @@
 ./usr/libdata/debug/usr/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,compatfil

CVS commit: src/external/mpl/bind

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 16:42:24 UTC 2021

Modified Files:
src/external/mpl/bind: Makefile.inc
src/external/mpl/bind/bin/named: Makefile
src/external/mpl/bind/dist: Makefile.in config.h.in configure
src/external/mpl/bind/dist/bin/check: check-tool.c check-tool.h
named-checkconf.c named-checkzone.c
src/external/mpl/bind/dist/bin/confgen: ddns-confgen.c keygen.c
keygen.h rndc-confgen.c util.c util.h
src/external/mpl/bind/dist/bin/confgen/include/confgen: os.h
src/external/mpl/bind/dist/bin/confgen/unix: os.c
src/external/mpl/bind/dist/bin/confgen/win32: os.c
src/external/mpl/bind/dist/bin/delv: delv.c
src/external/mpl/bind/dist/bin/dig: dig.c dighost.c host.c nslookup.c
src/external/mpl/bind/dist/bin/dig/include/dig: dig.h
src/external/mpl/bind/dist/bin/dnssec: dnssec-cds.c dnssec-dsfromkey.c
dnssec-importkey.c dnssec-keyfromlabel.c dnssec-keygen.c
dnssec-revoke.c dnssec-settime.c dnssec-signzone.c dnssec-verify.c
dnssectool.c dnssectool.h
src/external/mpl/bind/dist/bin/named: bind9.xsl.h builtin.c config.c
control.c controlconf.c fuzz.c geoip.c log.c logconf.c main.c
server.c statschannel.c tkeyconf.c tsigconf.c zoneconf.c
src/external/mpl/bind/dist/bin/named/include/dlz: dlz_dlopen_driver.h
src/external/mpl/bind/dist/bin/named/include/named: builtin.h config.h
control.h fuzz.h geoip.h globals.h log.h logconf.h main.h server.h
smf_globals.h statschannel.h tkeyconf.h tsigconf.h types.h
zoneconf.h
src/external/mpl/bind/dist/bin/named/unix: dlz_dlopen_driver.c os.c
src/external/mpl/bind/dist/bin/named/unix/include/named: os.h
src/external/mpl/bind/dist/bin/named/win32: dlz_dlopen_driver.c
ntservice.c os.c
src/external/mpl/bind/dist/bin/named/win32/include/named: ntservice.h
os.h
src/external/mpl/bind/dist/bin/nsupdate: nsupdate.c
src/external/mpl/bind/dist/bin/pkcs11: pkcs11-list.c pkcs11-tokens.c
src/external/mpl/bind/dist/bin/plugins: filter-.c
src/external/mpl/bind/dist/bin/rndc: rndc.c util.c util.h
src/external/mpl/bind/dist/bin/rndc/include/rndc: os.h
src/external/mpl/bind/dist/bin/tests: cfg_test.c makejournal.c
wire_test.c
src/external/mpl/bind/dist/bin/tests/optional: adb_test.c
backtrace_test.c byaddr_test.c byname_test.c db_test.c
fsaccess_test.c gsstest.c inter_test.c lex_test.c lfsr_test.c
log_test.c master_test.c mempool_test.c name_test.c nsecify.c
ratelimiter_test.c rbt_test.c rwlock_test.c serial_test.c
shutdown_test.c sig0_test.c sock_test.c sym_test.c task_test.c
timer_test.c zone_test.c
src/external/mpl/bind/dist/bin/tests/pkcs11/benchmarks: create.c find.c
genrsa.c login.c privrsa.c pubrsa.c session.c sha1.c sign.c
verify.c
src/external/mpl/bind/dist/bin/tests/system: feature-test.c

src/external/mpl/bind/dist/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d:
10.53.0.1
src/external/mpl/bind/dist/bin/tests/system/dlzexternal: driver.c
driver.h
src/external/mpl/bind/dist/bin/tests/system/dyndb/driver: db.c
src/external/mpl/bind/dist/bin/tests/system/pipelined: pipequeries.c
src/external/mpl/bind/dist/bin/tests/system/rndc: gencheck.c
src/external/mpl/bind/dist/bin/tests/system/rpz: dnsrps.c
src/external/mpl/bind/dist/bin/tests/system/rsabigexponent: bigkey.c
src/external/mpl/bind/dist/bin/tests/system/tkey: keycreate.c
keydelete.c
src/external/mpl/bind/dist/bin/tools: arpaname.c dnstap-read.c mdig.c
named-journalprint.c named-nzd2nzf.c named-rrchecker.c nsec3hash.c
src/external/mpl/bind/dist/bin/win32/BINDInstall: AccountInfo.h
BINDInstall.h BINDInstallDlg.h DirBrowse.h
src/external/mpl/bind/dist/doc/arm: isc-logo.pdf
src/external/mpl/bind/dist/fuzz: dns_name_fromtext_target.c
dns_rdata_fromwire_text.c fuzz.h main.c
src/external/mpl/bind/dist/lib/bind9: check.c getaddresses.c version.c
src/external/mpl/bind/dist/lib/bind9/include/bind9: check.h
getaddresses.h version.h
src/external/mpl/bind/dist/lib/bind9/win32: DLLMain.c version.c
src/external/mpl/bind/dist/lib/dns: acl.c adb.c badcache.c byaddr.c
cache.c callbacks.c catz.c client.c clientinfo.c compress.c db.c
dbiterator.c dbtable.c diff.c dispatch.c dlz.c dns64.c dnsrps.c
dnssec.c dnstap.c ds.c dst_api.c dst_internal.h dst_openssl.h
dst_parse.c dst_parse.h dst_pkcs11.h dst_result.c dyndb.c ecdb.c
ecs.c fixedname.c forward.c gen-unix.h gen-win32.h gen.

CVS commit: src/sys

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 14:52:00 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_bridge.c
src/sys/netinet: if_arp.c in_l2tp.c ip_flow.c ip_input.c ip_private.h
tcp_input.c tcp_private.h udp_private.h udp_usrreq.c
src/sys/netinet6: icmp6.c in6_l2tp.c ip6_flow.c ip6_input.c
ip6_private.h udp6_usrreq.c
src/sys/sys: mbuf.h param.h

Log Message:
- Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is more
  correct because it works with non-primitive types and provides the ABI
  alignment for the type the compiler will use.
- Remove all the *_HDR_ALIGNMENT macros and asserts
- Replace POINTER_ALIGNED_P with ACCESSIBLE_POINTER which is identical to
  ALIGNED_POINTER, but returns that the pointer is always aligned if the
  CPU supports unaligned accesses.
[ as proposed in tech-kern ]


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/net/if_arp.h
cvs rdiff -u -r1.178 -r1.179 src/sys/net/if_bridge.c
cvs rdiff -u -r1.306 -r1.307 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.19 -r1.20 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.84 -r1.85 src/sys/netinet/ip_flow.c
cvs rdiff -u -r1.398 -r1.399 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netinet/ip_private.h \
src/sys/netinet/tcp_private.h src/sys/netinet/udp_private.h
cvs rdiff -u -r1.425 -r1.426 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.260 -r1.261 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.249 -r1.250 src/sys/netinet6/icmp6.c
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet6/in6_l2tp.c
cvs rdiff -u -r1.41 -r1.42 src/sys/netinet6/ip6_flow.c
cvs rdiff -u -r1.223 -r1.224 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netinet6/ip6_private.h
cvs rdiff -u -r1.149 -r1.150 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.231 -r1.232 src/sys/sys/mbuf.h
cvs rdiff -u -r1.689 -r1.690 src/sys/sys/param.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.42 src/sys/net/if_arp.h:1.43
--- src/sys/net/if_arp.h:1.42	Wed Feb 17 17:32:04 2021
+++ src/sys/net/if_arp.h	Fri Feb 19 09:51:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.42 2021/02/17 22:32:04 christos Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.43 2021/02/19 14:51:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -72,8 +72,6 @@ struct	arphdr {
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
 };
-#define	ARP_HDR_ALIGNMENT	__alignof(struct arphdr)
-__CTASSERT(ARP_HDR_ALIGNMENT == 2);
 
 static __inline uint8_t *
 ar_data(struct arphdr *ap)

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.178 src/sys/net/if_bridge.c:1.179
--- src/sys/net/if_bridge.c:1.178	Sun Feb 14 15:58:34 2021
+++ src/sys/net/if_bridge.c	Fri Feb 19 09:51:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.178 2021/02/14 20:58:34 christos Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.179 2021/02/19 14:51:59 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.178 2021/02/14 20:58:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.179 2021/02/19 14:51:59 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2806,7 +2806,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
 	if (*mp == NULL)
 		return -1;
 
-	if (m_get_aligned_hdr(&m, IP_HDR_ALIGNMENT, sizeof(*ip), true) != 0) {
+	if (M_GET_ALIGNED_HDR(&m, struct ip, true) != 0) {
 		/* XXXJRT new stat, please */
 		ip_statinc(IP_STAT_TOOSMALL);
 		goto bad;
@@ -2900,7 +2900,7 @@ bridge_ip6_checkbasic(struct mbuf **mp)
 	 * it.  Otherwise, if it is aligned, make sure the entire base
 	 * IPv6 header is in the first mbuf of the chain.
 	 */
-	if (m_get_aligned_hdr(&m, IP6_HDR_ALIGNMENT, sizeof(*ip6), true) != 0) {
+	if (M_GET_ALIGNED_HDR(&m, struct ip6_hdr, true) != 0) {
 		struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
 		/* XXXJRT new stat, please */
 		ip6_statinc(IP6_STAT_TOOSMALL);

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.306 src/sys/netinet/if_arp.c:1.307
--- src/sys/netinet/if_arp.c:1.306	Tue Feb 16 05:22:52 2021
+++ src/sys/netinet/if_arp.c	Fri Feb 19 09:51:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.306 2021/02/16 10:22:52 martin Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.307 2021/02/19 14:51:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.306 2021/02/16 10:22:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.307 2021/02/19 14:51:59 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -706,7 +706,7 @@ arpintr(void)
 goto badlen;
 		}
 		ar = mtod(m, struct arphdr *);
-		KASSERT(POINTER_ALIGNED_P(ar, ARP_HDR_ALIGNMENT));
+		KASSERT(ACCESSIBLE_POINTER(ar, struct arphdr));
 
 		rcvif = m_get_rcvif(m, &

CVS commit: src/sys/arch/x86/x86

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 03:28:53 UTC 2021

Modified Files:
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
It is not VirtualBo give some more space.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/x86/x86/x86_machdep.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/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.147 src/sys/arch/x86/x86/x86_machdep.c:1.148
--- src/sys/arch/x86/x86/x86_machdep.c:1.147	Thu Feb 18 21:18:09 2021
+++ src/sys/arch/x86/x86/x86_machdep.c	Thu Feb 18 22:28:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -1329,7 +1329,7 @@ sysctl_machdep_hypervisor(SYSCTLFN_ARGS)
 {
 	struct sysctlnode node;
 	const char *t = NULL;
-	char buf[10];
+	char buf[64];
 
 	node = *rnode;
 	node.sysctl_data = buf;



CVS commit: src/sys/arch/x86/x86

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 02:18:10 UTC 2021

Modified Files:
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
add VirtualBox


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/x86/x86/x86_machdep.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/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.146 src/sys/arch/x86/x86/x86_machdep.c:1.147
--- src/sys/arch/x86/x86/x86_machdep.c:1.146	Sun Aug  9 11:32:44 2020
+++ src/sys/arch/x86/x86/x86_machdep.c	Thu Feb 18 21:18:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -1321,6 +1321,7 @@ static const char * const vm_guest_name[
 	[VM_GUEST_HV] =		"Hyper-V",
 	[VM_GUEST_VMWARE] =	"VMware",
 	[VM_GUEST_KVM] =	"KVM",
+	[VM_GUEST_VIRTUALBOX] =	"VirtualBox",
 };
 
 static int



CVS commit: src/sys/arch/x86/x86

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 02:15:58 UTC 2021

Modified Files:
src/sys/arch/x86/x86: tsc.c

Log Message:
Penalize TSC on VirtualBox because it is not accurate enough.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/x86/tsc.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/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.53 src/sys/arch/x86/x86/tsc.c:1.54
--- src/sys/arch/x86/x86/tsc.c:1.53	Wed Feb 17 01:33:47 2021
+++ src/sys/arch/x86/x86/tsc.c	Thu Feb 18 21:15:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $	*/
+/*	$NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $");
 
 #include 
 #include 
@@ -224,6 +224,8 @@ tsc_tc_init(void)
 		invariant = false;
 	} else if (vm_guest == VM_GUEST_NO) {
 		delay_func = tsc_delay;
+	} else if (vm_guest == VM_GUEST_VIRTUALBOX) {
+		tsc_timecounter.tc_quality = -100;
 	}
 
 	if (tsc_freq != 0) {



CVS commit: src/sys/arch/x86

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 19 02:15:24 UTC 2021

Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: identcpu.c

Log Message:
Identify VirtualBox as a separate guest type.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/x86/x86/identcpu.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/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.129 src/sys/arch/x86/include/cpu.h:1.130
--- src/sys/arch/x86/include/cpu.h:1.129	Sat Aug  8 15:08:48 2020
+++ src/sys/arch/x86/include/cpu.h	Thu Feb 18 21:15:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.129 2020/08/08 19:08:48 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.130 2021/02/19 02:15:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -503,6 +503,7 @@ typedef enum vm_guest {
 	VM_GUEST_HV,
 	VM_GUEST_VMWARE,
 	VM_GUEST_KVM,
+	VM_GUEST_VIRTUALBOX,
 	VM_LAST
 } vm_guest_t;
 extern vm_guest_t vm_guest;

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.118 src/sys/arch/x86/x86/identcpu.c:1.119
--- src/sys/arch/x86/x86/identcpu.c:1.118	Tue Oct 27 04:57:11 2020
+++ src/sys/arch/x86/x86/identcpu.c	Thu Feb 18 21:15:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.118 2020/10/27 08:57:11 ryo Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.118 2020/10/27 08:57:11 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $");
 
 #include "opt_xen.h"
 
@@ -1104,21 +1104,27 @@ cpu_identify(struct cpu_info *ci)
  */
 vm_guest_t vm_guest = VM_GUEST_NO;
 
-static const char * const vm_bios_vendors[] = {
-	"QEMU",/* QEMU */
-	"Plex86",			/* Plex86 */
-	"Bochs",			/* Bochs */
-	"Xen",/* Xen */
-	"BHYVE",			/* bhyve */
-	"Seabios",			/* KVM */
+struct vm_name_guest {
+	const char *name;
+	vm_guest_t guest;
 };
 
-static const char * const vm_system_products[] = {
-	"VMware Virtual Platform",	/* VMWare VM */
-	"Virtual Machine",		/* Microsoft VirtualPC */
-	"VirtualBox",			/* Sun xVM VirtualBox */
-	"Parallels Virtual Platform",	/* Parallels VM */
-	"KVM",/* KVM */
+static const struct vm_name_guest vm_bios_vendors[] = {
+	{ "QEMU", VM_GUEST_VM },			/* QEMU */
+	{ "Plex86", VM_GUEST_VM },			/* Plex86 */
+	{ "Bochs", VM_GUEST_VM },			/* Bochs */
+	{ "Xen", VM_GUEST_VM },/* Xen */
+	{ "BHYVE", VM_GUEST_VM },			/* bhyve */
+	{ "Seabios", VM_GUEST_VM },			/* KVM */
+	{ "innotek GmbH", VM_GUEST_VIRTUALBOX },	/* Oracle VirtualBox */
+};
+
+static const struct vm_name_guest vm_system_products[] = {
+	{ "VMware Virtual Platform", VM_GUEST_VM },	/* VMWare VM */
+	{ "Virtual Machine", VM_GUEST_VM },		/* Microsoft VirtualPC */
+	{ "VirtualBox", VM_GUEST_VIRTUALBOX },		/* Sun xVM VirtualBox */
+	{ "Parallels Virtual Platform", VM_GUEST_VM },	/* Parallels VM */
+	{ "KVM", VM_GUEST_VM },/* KVM */
 };
 
 void
@@ -1129,8 +1135,18 @@ identify_hypervisor(void)
 	const char *p;
 	int i;
 
+#if 0	
+	/* 
+	 * This is called from cpu_probe() and cpu_configure()
+	 * During cpu_probe() we have not called platform_init()
+	 * yet, so the bios tables have not been loaded.
+	 * We allow this to be called twice in order to override
+	 * the cpuid setting because some hypervisors don't return
+	 * specific enough info with cpuid it.
+	 */
 	if (vm_guest != VM_GUEST_NO)
 		return;
+#endif
 
 	/*
 	 * [RFC] CPUID usage for interaction between Hypervisors and Linux.
@@ -1162,7 +1178,9 @@ identify_hypervisor(void)
 			/* OpenBSD vmm:   "OpenBSDVMM58" */
 			/* NetBSD nvmm:   "___ NVMM ___" */
 		}
-		return;
+		// VirtualBox returns KVM, so keep going.
+		if (vm_guest != VM_GUEST_KVM)
+			return;
 	}
 
 	/*
@@ -1181,8 +1199,8 @@ identify_hypervisor(void)
 	p = pmf_get_platform("bios-vendor");
 	if (p != NULL) {
 		for (i = 0; i < __arraycount(vm_bios_vendors); i++) {
-			if (strcmp(p, vm_bios_vendors[i]) == 0) {
-vm_guest = VM_GUEST_VM;
+			if (strcmp(p, vm_bios_vendors[i].name) == 0) {
+vm_guest = vm_bios_vendors[i].guest;
 return;
 			}
 		}
@@ -1190,8 +1208,8 @@ identify_hypervisor(void)
 	p = pmf_get_platform("system-product");
 	if (p != NULL) {
 		for (i = 0; i < __arraycount(vm_system_products); i++) {
-			if (strcmp(p, vm_system_products[i]) == 0) {
-vm_guest = VM_GUEST_VM;
+			if (strcmp(p, vm_system_products[i].name) == 0) {
+vm_guest = vm_system_products[i].guest;
 return;
 			}
 		}



CVS commit: src/usr.bin/vis

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 18 18:27:24 UTC 2021

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

Log Message:
Add examples (Fernando Apestegu�a at FreeBSD)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/vis/vis.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/vis/vis.1
diff -u src/usr.bin/vis/vis.1:1.23 src/usr.bin/vis/vis.1:1.24
--- src/usr.bin/vis/vis.1:1.23	Sun May 24 15:42:39 2015
+++ src/usr.bin/vis/vis.1	Thu Feb 18 13:27:24 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vis.1,v 1.23 2015/05/24 19:42:39 christos Exp $
+.\"	$NetBSD: vis.1,v 1.24 2021/02/18 18:27:24 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)vis.1	8.4 (Berkeley) 4/19/94
 .\"
-.Dd May 24, 2015
+.Dd February 18, 2021
 .Dt VIS 1
 .Os
 .Sh NAME
@@ -171,6 +171,25 @@ instead.
 Specify the locale of the input data.
 Set to C if the input data locale is unknown.
 .El
+.Sh EXAMPLES
+Visualize characters encoding white spaces and tabs:
+.Bd -literal -offset indent
+$ printf "\\x10\\n\\t\\n" | vis -w -t
+\\^P\\012\\011\\012
+.Ed
+.Pp
+Same as above but using `\\$' for newline followed by an actual newline:
+.Bd -literal -offset indent
+$ printf "\\x10\\n\\t\\n" | vis -w -t -l
+\\^P\\$
+\\011\\$
+.Ed
+.Pp
+Visualize string using URI encoding:
+.Bd -literal -offset indent
+$ printf http://www.freebsd.org | vis -h
+http%3a%2f%2fwww.freebsd.org
+.Ed
 .Sh SEE ALSO
 .Xr unvis 1 ,
 .Xr svis 3 ,



CVS commit: src/usr.bin/unzip

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 18 18:06:02 UTC 2021

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

Log Message:
Remove the "original line"
Fix lint comment


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/unzip/unzip.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/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.26 src/usr.bin/unzip/unzip.c:1.27
--- src/usr.bin/unzip/unzip.c:1.26	Thu Feb 18 12:58:51 2021
+++ src/usr.bin/unzip/unzip.c	Thu Feb 18 13:06:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $ */
+/* $NetBSD: unzip.c,v 1.27 2021/02/18 18:06:02 christos Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Joerg Sonnenberger 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.27 2021/02/18 18:06:02 christos Exp $");
 
 #ifdef __GLIBC__
 #define _GNU_SOURCE
@@ -97,7 +97,7 @@ static int		 tty;
 		int acret = (call);\
 		if (acret != ARCHIVE_OK)			\
 			errorx("%s", archive_error_string(a));	\
-	} while (/*CONSTCONST*/0)
+	} while (/*CONSTCOND*/0)
 
 /*
  * Indicates that last info() did not end with EOL.  This helps error() et
@@ -991,7 +991,6 @@ getopts(int argc, char *argv[])
 #endif
 
  	while ((opt = getopt(argc, argv, "aCcd:fjLlnopP:qtuvyx:")) != -1)
-	while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvyx:")) != -1)
 		switch (opt) {
 		case 'a':
 			a_opt = 1;



CVS commit: src/usr.bin/unzip

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 18 17:58:51 UTC 2021

Modified Files:
src/usr.bin/unzip: unzip.1 unzip.c

Log Message:
Add support for password protected zip files (Alex Kozlov)
Also some KNF


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/unzip/unzip.1
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/unzip/unzip.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/unzip/unzip.1
diff -u src/usr.bin/unzip/unzip.1:1.12 src/usr.bin/unzip/unzip.1:1.13
--- src/usr.bin/unzip/unzip.1:1.12	Thu Feb 18 12:04:39 2021
+++ src/usr.bin/unzip/unzip.1	Thu Feb 18 12:58:51 2021
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: revision 180125$
-.\" $NetBSD: unzip.1,v 1.12 2021/02/18 17:04:39 christos Exp $
+.\" $NetBSD: unzip.1,v 1.13 2021/02/18 17:58:51 christos Exp $
 .\"
 .Dd February 18, 2021
 .Dt UNZIP 1
@@ -83,6 +83,9 @@ When extracting files from the zipfile, 
 The normal output is suppressed as if
 .Fl q
 was specified.
+.It Fl P Ar password
+Extract encrypted files using a password. Putting a password on
+the command line using this option can be insecure.
 .It Fl q
 Quiet: print less information while extracting.
 .It Fl t

Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.25 src/usr.bin/unzip/unzip.c:1.26
--- src/usr.bin/unzip/unzip.c:1.25	Thu Feb 18 12:05:51 2021
+++ src/usr.bin/unzip/unzip.c	Thu Feb 18 12:58:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $ */
+/* $NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Joerg Sonnenberger 
@@ -37,10 +37,11 @@
  */
 
 #include 
-__RCSID("$NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $");
 
 #ifdef __GLIBC__
 #define _GNU_SOURCE
+#define explicit_memset memset_s
 #endif
 
 #include 
@@ -58,6 +59,9 @@ __RCSID("$NetBSD: unzip.c,v 1.25 2021/02
 
 #include 
 #include 
+#ifdef __GLIBC__
+#include 
+#endif
 
 /* command-line options */
 static int		 a_opt;		/* convert EOL */
@@ -71,6 +75,7 @@ static int		 n_opt;		/* never overwrite 
 static int		 o_opt;		/* always overwrite */
 static int		 p_opt;		/* extract to stdout, quiet */
 static int		 q_opt;		/* quiet */
+static char		*P_arg;		/* passphrase */
 static int		 t_opt;		/* test */
 static int		 u_opt;		/* update */
 static int		 v_opt;		/* verbose/list */
@@ -92,7 +97,7 @@ static int		 tty;
 		int acret = (call);\
 		if (acret != ARCHIVE_OK)			\
 			errorx("%s", archive_error_string(a));	\
-	} while (0)
+	} while (/*CONSTCONST*/0)
 
 /*
  * Indicates that last info() did not end with EOL.  This helps error() et
@@ -101,6 +106,9 @@ static int		 tty;
  */
 static int noeol;
 
+/* for an interactive passphrase input */
+static char passbuf[1024];
+
 /* fatal error message + errno */
 __dead __printflike(1, 2) static void
 error(const char *fmt, ...)
@@ -110,12 +118,12 @@ error(const char *fmt, ...)
 	if (noeol)
 		fprintf(stdout, "\n");
 	fflush(stdout);
-	fprintf(stderr, "unzip: ");
+	fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	vfprintf(stderr, fmt, ap);
 	va_end(ap);
 	fprintf(stderr, ": %s\n", strerror(errno));
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 
 /* fatal error message, no errno */
@@ -127,12 +135,12 @@ errorx(const char *fmt, ...)
 	if (noeol)
 		fprintf(stdout, "\n");
 	fflush(stdout);
-	fprintf(stderr, "unzip: ");
+	fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	vfprintf(stderr, fmt, ap);
 	va_end(ap);
 	fprintf(stderr, "\n");
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 
 /* non-fatal error message + errno */
@@ -227,7 +235,7 @@ pathdup(const char *path)
 	}
 	str[len] = '\0';
 
-	return (str);
+	return str;
 }
 
 /* concatenate two path names */
@@ -249,7 +257,7 @@ pathcat(const char *prefix, const char *
 	}
 	memcpy(str + prelen, path, len);	/* includes zero */
 
-	return (str);
+	return str;
 }
 
 /*
@@ -293,9 +301,9 @@ match_pattern(struct pattern_list *list,
 
 	STAILQ_FOREACH(entry, list, link) {
 		if (fnmatch(entry->pattern, str, C_opt ? FNM_CASEFOLD : 0) == 0)
-			return (1);
+			return 1;
 	}
-	return (0);
+	return 0;
 }
 
 /*
@@ -307,10 +315,10 @@ accept_pathname(const char *pathname)
 {
 
 	if (!STAILQ_EMPTY(&include) && !match_pattern(&include, pathname))
-		return (0);
+		return 0;
 	if (!STAILQ_EMPTY(&exclude) && match_pattern(&exclude, pathname))
-		return (0);
-	return (1);
+		return 0;
+	return 1;
 }
 
 /*
@@ -853,6 +861,34 @@ test(struct archive *a, struct archive_e
 }
 
 /*
+ * Callback function for reading passphrase.
+ * Originally from cpio.c and passphrase.c, libarchive.
+ */
+static const char *
+passphrase_callback(struct archive *a, void *client_data)
+{
+	char *p;
+	static const char prompt[] = "\nEnter passphrase:";
+
+	(void)a; /* UNUSED */
+	(void)client_data; /* UNUSED */
+
+#if defined(RPP_ECHO_OFF)
+	p =

CVS commit: src/usr.bin/unzip

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 18 17:05:52 UTC 2021

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

Log Message:
Build with linux/glibc (Alex Kozlov)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/unzip/unzip.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/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.24 src/usr.bin/unzip/unzip.c:1.25
--- src/usr.bin/unzip/unzip.c:1.24	Thu Jul 19 14:04:25 2018
+++ src/usr.bin/unzip/unzip.c	Thu Feb 18 12:05:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Joerg Sonnenberger 
@@ -37,7 +37,11 @@
  */
 
 #include 
-__RCSID("$NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $");
+
+#ifdef __GLIBC__
+#define _GNU_SOURCE
+#endif
 
 #include 
 #include 
@@ -936,7 +940,13 @@ getopts(int argc, char *argv[])
 {
 	int opt;
 
-	optreset = optind = 1;
+#ifdef __GLIBC__
+	optind = 0;
+#else
+ 	optreset = optind = 1;
+#endif
+
+ 	while ((opt = getopt(argc, argv, "aCcd:fjLlnopP:qtuvyx:")) != -1)
 	while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvyx:")) != -1)
 		switch (opt) {
 		case 'a':



CVS commit: src/usr.bin/unzip

2021-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 18 17:04:39 UTC 2021

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

Log Message:
mention zipx, from Alex Kozlov


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/unzip/unzip.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/unzip/unzip.1
diff -u src/usr.bin/unzip/unzip.1:1.11 src/usr.bin/unzip/unzip.1:1.12
--- src/usr.bin/unzip/unzip.1:1.11	Mon Dec 21 12:17:02 2015
+++ src/usr.bin/unzip/unzip.1	Thu Feb 18 12:04:39 2021
@@ -25,9 +25,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: revision 180125$
-.\" $NetBSD: unzip.1,v 1.11 2015/12/21 17:17:02 christos Exp $
+.\" $NetBSD: unzip.1,v 1.12 2021/02/18 17:04:39 christos Exp $
 .\"
-.Dd December 21, 2015
+.Dd February 18, 2021
 .Dt UNZIP 1
 .Os
 .Sh NAME
@@ -160,7 +160,7 @@ utility is only able to process ZIP arch
 .Xr libarchive 3 .
 Depending on the installed version of
 .Xr libarchive 3 ,
-this may or may not include self-extracting archives.
+this may or may not include self-extracting or ZIPX archives.
 .Sh SEE ALSO
 .Xr libarchive 3
 .Sh HISTORY



CVS commit: src/sys

2021-02-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 17 22:32:04 UTC 2021

Modified Files:
src/sys/net: if_arp.h
src/sys/netinet: icmp_private.h igmp_var.h ip_private.h tcp_private.h
udp_private.h
src/sys/netinet6: ip6_private.h
src/sys/sys: mbuf.h param.h

Log Message:
- pass the alignment instead of the mask (as Roy asked and to match the
  other macro)
- use alignof to determine that alignment and CTASSERT what we expect
- remove unused macros


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/net/if_arp.h
cvs rdiff -u -r1.4 -r1.5 src/sys/netinet/icmp_private.h \
src/sys/netinet/ip_private.h src/sys/netinet/tcp_private.h \
src/sys/netinet/udp_private.h
cvs rdiff -u -r1.26 -r1.27 src/sys/netinet/igmp_var.h
cvs rdiff -u -r1.4 -r1.5 src/sys/netinet6/ip6_private.h
cvs rdiff -u -r1.230 -r1.231 src/sys/sys/mbuf.h
cvs rdiff -u -r1.688 -r1.689 src/sys/sys/param.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.41 src/sys/net/if_arp.h:1.42
--- src/sys/net/if_arp.h:1.41	Tue Feb 16 05:20:56 2021
+++ src/sys/net/if_arp.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.41 2021/02/16 10:20:56 martin Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.42 2021/02/17 22:32:04 christos Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -72,7 +72,8 @@ struct	arphdr {
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
 };
-#define	ARP_HDR_ALIGNMENT	1
+#define	ARP_HDR_ALIGNMENT	__alignof(struct arphdr)
+__CTASSERT(ARP_HDR_ALIGNMENT == 2);
 
 static __inline uint8_t *
 ar_data(struct arphdr *ap)

Index: src/sys/netinet/icmp_private.h
diff -u src/sys/netinet/icmp_private.h:1.4 src/sys/netinet/icmp_private.h:1.5
--- src/sys/netinet/icmp_private.h:1.4	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/icmp_private.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp_private.h,v 1.4 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: icmp_private.h,v 1.5 2021/02/17 22:32:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -44,7 +44,6 @@ extern percpu_t *icmpstat_percpu;
 
 #define	ICMP_STATINC(x)		_NET_STATINC(icmpstat_percpu, x)
 
-#define	ICMP_HDR_ALIGNMENT	3
 #endif /* _KERNEL_ */
 
 #endif /* !_NETINET_ICMP_PRIVATE_H_ */
Index: src/sys/netinet/ip_private.h
diff -u src/sys/netinet/ip_private.h:1.4 src/sys/netinet/ip_private.h:1.5
--- src/sys/netinet/ip_private.h:1.4	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/ip_private.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_private.h,v 1.4 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: ip_private.h,v 1.5 2021/02/17 22:32:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -43,7 +43,8 @@ extern	percpu_t *ipstat_percpu;
 #define	IP_STATINC(x)		_NET_STATINC(ipstat_percpu, x)
 #define	IP_STATDEC(x)		_NET_STATDEC(ipstat_percpu, x)
 
-#define	IP_HDR_ALIGNMENT	3
+#define	IP_HDR_ALIGNMENT	__alignof(struct ip)
+__CTASSERT(IP_HDR_ALIGNMENT == 4);
 #endif /* _KERNEL */
 
 #endif /* !_NETINET_IP_PRIVATE_H_ */
Index: src/sys/netinet/tcp_private.h
diff -u src/sys/netinet/tcp_private.h:1.4 src/sys/netinet/tcp_private.h:1.5
--- src/sys/netinet/tcp_private.h:1.4	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/tcp_private.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_private.h,v 1.4 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: tcp_private.h,v 1.5 2021/02/17 22:32:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -43,7 +43,8 @@ extern	percpu_t *tcpstat_percpu;
 #define	TCP_STATINC(x)		_NET_STATINC(tcpstat_percpu, x)
 #define	TCP_STATADD(x, v)	_NET_STATADD(tcpstat_percpu, x, v)
 
-#define	TCP_HDR_ALIGNMENT	3
+#define	TCP_HDR_ALIGNMENT	__alignof(struct tcphdr)
+__CTASSERT(TCP_HDR_ALIGNMENT == 4);
 #endif /* _KERNEL */
 
 #endif /* !_NETINET_TCP_PRIVATE_H_ */
Index: src/sys/netinet/udp_private.h
diff -u src/sys/netinet/udp_private.h:1.4 src/sys/netinet/udp_private.h:1.5
--- src/sys/netinet/udp_private.h:1.4	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/udp_private.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_private.h,v 1.4 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: udp_private.h,v 1.5 2021/02/17 22:32:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,8 @@ extern	percpu_t *udpstat_percpu;
 
 #define	UDP_STATINC(x)		_NET_STATINC(udpstat_percpu, x)
 
-#define	UDP_HDR_ALIGNMENT	3
+#define	UDP_HDR_ALIGNMENT	__alignof(struct udphdr)
+__CTASSERT(UDP_HDR_ALIGNMENT == 2);
 #endif /* _KERNEL */
 
 #endif /* !_NETINET_UDP_PRIVATE_H_ */

Index: src/sys/netinet/igmp_var.h
diff -u src/sys/netinet/igmp_var.h:1.26 src/sys/netinet/igmp_var.h:1.27
--- src/sys/netinet/igmp_var.h:1.26	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/igmp_var.h	Wed Feb 17 17:32:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp_var.h,v

CVS commit: src/usr.bin/mail

2021-02-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 17 21:09:39 UTC 2021

Modified Files:
src/usr.bin/mail: dotlock.c

Log Message:
add O_CLOEXEC


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/mail/dotlock.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/mail/dotlock.c
diff -u src/usr.bin/mail/dotlock.c:1.13 src/usr.bin/mail/dotlock.c:1.14
--- src/usr.bin/mail/dotlock.c:1.13	Sat Jul  4 18:45:08 2015
+++ src/usr.bin/mail/dotlock.c	Wed Feb 17 16:09:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dotlock.c,v 1.13 2015/07/04 22:45:08 christos Exp $	*/
+/*	$NetBSD: dotlock.c,v 1.14 2021/02/17 21:09:39 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
@@ -26,7 +26,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: dotlock.c,v 1.13 2015/07/04 22:45:08 christos Exp $");
+__RCSID("$NetBSD: dotlock.c,v 1.14 2021/02/17 21:09:39 christos Exp $");
 #endif
 
 #include "rcv.h"
@@ -81,7 +81,8 @@ create_exclusive(const char *fname)
 	 * We try to create the unique filename.
 	 */
 	for (ntries = 0; ; ntries++) {
-		fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC, 0);
+		fd = open(path,
+		O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC|O_CLOEXEC, 0);
 		if (fd != -1) {
 			(void)close(fd);
 			break;



CVS commit: src/sys/netinet

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 19:49:17 UTC 2021

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Undo previous; POINTER_ALIGNED_P was broken.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.303 src/sys/netinet/if_arp.c:1.304
--- src/sys/netinet/if_arp.c:1.303	Mon Feb 15 14:19:29 2021
+++ src/sys/netinet/if_arp.c	Mon Feb 15 14:49:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.303 2021/02/15 19:19:29 christos Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.304 2021/02/15 19:49:17 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.303 2021/02/15 19:19:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.304 2021/02/15 19:49:17 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -707,9 +707,10 @@ arpintr(void)
 		MCLAIM(m, &arpdomain.dom_mowner);
 		ARP_STATINC(ARP_STAT_RCVTOTAL);
 
-		if (m_get_aligned_hdr(&m, ARP_HDR_ALIGNMENT, sizeof(*ar),
-		false) != 0)
-			goto badlen;
+		if (__predict_false(m->m_len < sizeof(*ar))) {
+			if ((m = m_pullup(m, sizeof(*ar))) == NULL)
+goto badlen;
+		}
 		ar = mtod(m, struct arphdr *);
 		KASSERT(POINTER_ALIGNED_P(ar, ARP_HDR_ALIGNMENT));
 



CVS commit: src/sys/sys

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 19:46:53 UTC 2021

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

Log Message:
the fourth time is the charm


To generate a diff of this commit:
cvs rdiff -u -r1.687 -r1.688 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.687 src/sys/sys/param.h:1.688
--- src/sys/sys/param.h:1.687	Mon Feb 15 13:33:28 2021
+++ src/sys/sys/param.h	Mon Feb 15 14:46:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.687 2021/02/15 18:33:28 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.688 2021/02/15 19:46:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -290,7 +290,7 @@
 #ifdef __NO_STRICT_ALIGNMENT
 #define	POINTER_ALIGNED_P(p, a)		1
 #else
-#define	POINTER_ALIGNED_P(p, a)		(((uintptr_t)(p) + (a)) == 0)
+#define	POINTER_ALIGNED_P(p, a)		(((uintptr_t)(p) & (a)) == 0)
 #endif
 
 /*



CVS commit: src/sys/netinet

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 19:19:30 UTC 2021

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
put back alignment (reported by martin@)


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.302 src/sys/netinet/if_arp.c:1.303
--- src/sys/netinet/if_arp.c:1.302	Sun Feb 14 15:58:35 2021
+++ src/sys/netinet/if_arp.c	Mon Feb 15 14:19:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.302 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.303 2021/02/15 19:19:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.302 2021/02/14 20:58:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.303 2021/02/15 19:19:29 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -707,10 +707,9 @@ arpintr(void)
 		MCLAIM(m, &arpdomain.dom_mowner);
 		ARP_STATINC(ARP_STAT_RCVTOTAL);
 
-		if (__predict_false(m->m_len < sizeof(*ar))) {
-			if ((m = m_pullup(m, sizeof(*ar))) == NULL)
-goto badlen;
-		}
+		if (m_get_aligned_hdr(&m, ARP_HDR_ALIGNMENT, sizeof(*ar),
+		false) != 0)
+			goto badlen;
 		ar = mtod(m, struct arphdr *);
 		KASSERT(POINTER_ALIGNED_P(ar, ARP_HDR_ALIGNMENT));
 



CVS commit: src/sys/sys

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 18:33:29 UTC 2021

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

Log Message:
Fix pointer aligned macro to match the original (thanks @mlelstv)


To generate a diff of this commit:
cvs rdiff -u -r1.686 -r1.687 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.686 src/sys/sys/param.h:1.687
--- src/sys/sys/param.h:1.686	Mon Feb 15 10:53:49 2021
+++ src/sys/sys/param.h	Mon Feb 15 13:33:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.686 2021/02/15 15:53:49 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.687 2021/02/15 18:33:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -290,7 +290,7 @@
 #ifdef __NO_STRICT_ALIGNMENT
 #define	POINTER_ALIGNED_P(p, a)		1
 #else
-#define	POINTER_ALIGNED_P(p, a)		uintptr_t)(p) + (a)) & ~(a)) == 0)
+#define	POINTER_ALIGNED_P(p, a)		(((uintptr_t)(p) + (a)) == 0)
 #endif
 
 /*



CVS commit: src/sys/sys

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 15:53:49 UTC 2021

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

Log Message:
Fix reversed test (thanks mlelstv)


To generate a diff of this commit:
cvs rdiff -u -r1.685 -r1.686 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.685 src/sys/sys/param.h:1.686
--- src/sys/sys/param.h:1.685	Sun Feb 14 15:58:35 2021
+++ src/sys/sys/param.h	Mon Feb 15 10:53:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.685 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.686 2021/02/15 15:53:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -290,7 +290,7 @@
 #ifdef __NO_STRICT_ALIGNMENT
 #define	POINTER_ALIGNED_P(p, a)		1
 #else
-#define	POINTER_ALIGNED_P(p, a)		(((uintptr_t)(p) + (a)) & ~(a))
+#define	POINTER_ALIGNED_P(p, a)		uintptr_t)(p) + (a)) & ~(a)) == 0)
 #endif
 
 /*



CVS commit: src/lib/libc/locale

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 15:36:53 UTC 2021

Modified Files:
src/lib/libc/locale: duplocale.3 freelocale.3 newlocale.3

Log Message:
Remove FreeBSD portions that are not relevant to our implementation (pointed
out by joerg@)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/duplocale.3 \
src/lib/libc/locale/freelocale.3 src/lib/libc/locale/newlocale.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/libc/locale/duplocale.3
diff -u src/lib/libc/locale/duplocale.3:1.1 src/lib/libc/locale/duplocale.3:1.2
--- src/lib/libc/locale/duplocale.3:1.1	Mon Feb 15 09:35:04 2021
+++ src/lib/libc/locale/duplocale.3	Mon Feb 15 10:36:53 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: duplocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: duplocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD: head/lib/libc/locale/duplocale.3 281925 2015-04-24 10:17:55Z theraven $
 .\"
-.Dd September 17, 2011
+.Dd February 15, 2021
 .Dt DUPLOCALE 3
 .Os
 .Sh NAME
@@ -46,17 +46,6 @@ Duplicates an existing
 returning a new
 .Fa locale_t
 that refers to the same locale values but has an independent internal state.
-Various functions, such as
-.Xr mblen 3
-require a persistent state.
-These functions formerly used static variables and calls to them from multiple
-threads had undefined behavior.
-They now use fields in the
-.Fa locale_t
-associated with the current thread by
-.Xr uselocale 3 .
-These calls are therefore only thread safe on threads with a unique per-thread
-locale.
 The locale returned by this call must be freed with
 .Xr freelocale 3 .
 .Sh SEE ALSO
@@ -64,17 +53,8 @@ The locale returned by this call must be
 .Xr localeconv 3 ,
 .Xr newlocale 3 ,
 .\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
+.\" .Xr uselocale 3 ,
 .\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
 .St -p1003.1-2008 .
-.Sh BUGS
-Ideally,
-.Xr uselocale 3
-should make a copy of the
-.Fa locale_t
-implicitly to ensure thread safety,
-and a copy of the global locale should be installed lazily on each thread.
-The FreeBSD implementation does not do this,
-for compatibility with Darwin.
Index: src/lib/libc/locale/freelocale.3
diff -u src/lib/libc/locale/freelocale.3:1.1 src/lib/libc/locale/freelocale.3:1.2
--- src/lib/libc/locale/freelocale.3:1.1	Mon Feb 15 09:35:04 2021
+++ src/lib/libc/locale/freelocale.3	Mon Feb 15 10:36:53 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: freelocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: freelocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -27,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: head/lib/libc/locale/freelocale.3 303495 2016-07-29 17:18:47Z ed $
-.Dd July 26, 2016
+.Dd February 15, 2021
 .Dt FREELOCALE 3
 .Os
 .Sh NAME
@@ -46,14 +46,12 @@ or
 Frees a
 .Fa locale_t .
 This relinquishes any resources held exclusively by this locale.
-Note that locales share reference-counted components,
-so a call to this function is not guaranteed to free all of the components.
 .Sh SEE ALSO
 .Xr duplocale 3 ,
 .Xr localeconv 3 ,
 .Xr newlocale 3 ,
 .\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
+.\" .Xr uselocale 3 ,
 .\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
Index: src/lib/libc/locale/newlocale.3
diff -u src/lib/libc/locale/newlocale.3:1.1 src/lib/libc/locale/newlocale.3:1.2
--- src/lib/libc/locale/newlocale.3:1.1	Mon Feb 15 09:35:04 2021
+++ src/lib/libc/locale/newlocale.3	Mon Feb 15 10:36:53 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: newlocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: newlocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -27,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: head/lib/libc/locale/newlocale.3 366375 2020-10-02 18:35:55Z markj $
-.Dd October 2, 2020
+.Dd February 15, 2021
 .Dt NEWLOCALE 3
 .Os
 .Sh NAME
@@ -118,9 +118,9 @@ You must free the returned locale with
 .Xr duplocale 3 ,
 .Xr freelocale 3 ,
 .Xr localeconv 3 ,
-\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
-\" .Xr xlocale 3
+.\" .Xr querylocale 3 ,
+.\" .Xr uselocale 3 ,
+.\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
 .St -p1003.1-2008 .



CVS commit: src/distrib/sets/lists/comp

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 14:38:06 UTC 2021

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
new locale pages, sort


To generate a diff of this commit:
cvs rdiff -u -r1.2373 -r1.2374 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2373 src/distrib/sets/lists/comp/mi:1.2374
--- src/distrib/sets/lists/comp/mi:1.2373	Sun Jan 24 12:29:11 2021
+++ src/distrib/sets/lists/comp/mi	Mon Feb 15 09:38:06 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2373 2021/01/24 17:29:11 thorpej Exp $
+#	$NetBSD: mi,v 1.2374 2021/02/15 14:38:06 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -984,8 +984,6 @@
 ./usr/include/g++/bitdo1.h			comp-obsolete		obsolete
 ./usr/include/g++/bitdo2.h			comp-obsolete		obsolete
 ./usr/include/g++/bitprims.h			comp-obsolete		obsolete
-./usr/include/g++/bits/erase_if.h		comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/bits/unique_lock.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/bits/algorithmfwd.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/alloc_traits.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/allocated_ptr.h		comp-cxx-include	gcc,cxx,libstdcxx
@@ -1027,6 +1025,7 @@
 ./usr/include/g++/bits/cxxabi_tweaks.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/deque.tcc		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/enable_special_members.h	comp-cxx-include	gcc,cxx,libstdcxx
+./usr/include/g++/bits/erase_if.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/bits/error_constants.h	comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/exception.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/exception_defines.h	comp-cxx-include	gcc,cxx,libstdcxx
@@ -1149,6 +1148,7 @@
 ./usr/include/g++/bits/time_members.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/type_traits.h		comp-obsolete		obsolete
 ./usr/include/g++/bits/uniform_int_dist.h	comp-cxx-include	gcc,cxx,libstdcxx
+./usr/include/g++/bits/unique_lock.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/bits/unique_ptr.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/unordered_map.h		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/bits/unordered_set.h		comp-cxx-include	gcc,cxx,libstdcxx
@@ -1825,27 +1825,27 @@
 ./usr/include/g++/profile/unordered_set		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/profile/vector		comp-cxx-include	gcc,cxx,libstdcxx
 ./usr/include/g++/projectn.h			comp-obsolete		obsolete
-./usr/include/g++/pstl/algorithm_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/algorithm_fwd.h		comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/glue_algorithm_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/algorithm_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/execution_defs.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/execution_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/numeric_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/glue_algorithm_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/glue_algorithm_impl.h	comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/glue_memory_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/glue_execution_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/glue_memory_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/glue_memory_impl.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/glue_numeric_defs.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/glue_numeric_impl.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/memory_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/numeric_fwd.h		comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/parallel_backend_utils.h	comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/parallel_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/numeric_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/parallel_backend.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/parallel_backend_tbb.h	comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/parallel_backend_utils.h	comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/parallel_impl.h		comp-cxx-include	gcc=9,cxx,libstdcxx
+./usr/include/g++/pstl/pstl_config.h		comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/unseq_backend_simd.h	comp-cxx-include	gcc=9,cxx,libstdcxx
 ./usr/include/g++/pstl/utils.h			comp-cxx-include	gcc=9,cxx,libstdcxx
-./usr/include/g++/pstl/pstl_config.h		comp-cxx-includ

CVS commit: src/lib/libc/locale

2021-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 14:35:04 UTC 2021

Modified Files:
src/lib/libc/locale: Makefile.inc
Added Files:
src/lib/libc/locale: duplocale.3 freelocale.3 newlocale.3

Log Message:
Add missing man pages (from FreeBSD)


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/duplocale.3 \
src/lib/libc/locale/freelocale.3 src/lib/libc/locale/newlocale.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/libc/locale/Makefile.inc
diff -u src/lib/libc/locale/Makefile.inc:1.64 src/lib/libc/locale/Makefile.inc:1.65
--- src/lib/libc/locale/Makefile.inc:1.64	Sun Aug 18 16:03:48 2013
+++ src/lib/libc/locale/Makefile.inc	Mon Feb 15 09:35:04 2021
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile.inc	5.1 (Berkeley) 2/18/91
-#	$NetBSD: Makefile.inc,v 1.64 2013/08/18 20:03:48 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.65 2021/02/15 14:35:04 christos Exp $
 
 # locale sources
 .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale
@@ -21,7 +21,7 @@ CPPFLAGS.runetable.c+=		-I${LIBCDIR}/cit
 CPPFLAGS.multibyte_c90.c+=	-I${LIBCDIR}/citrus
 CPPFLAGS.multibyte_amd1.c+=	-I${LIBCDIR}/citrus
 
-MAN+=	setlocale.3 nl_langinfo.3
+MAN+=	duplocale.3 freelocale.3 newlocale.3 setlocale.3 nl_langinfo.3 
 
 MAN+=	mbtowc.3 mbstowcs.3 wctomb.3 wcstombs.3 mblen.3 \
 

Added files:

Index: src/lib/libc/locale/duplocale.3
diff -u /dev/null src/lib/libc/locale/duplocale.3:1.1
--- /dev/null	Mon Feb 15 09:35:04 2021
+++ src/lib/libc/locale/duplocale.3	Mon Feb 15 09:35:04 2021
@@ -0,0 +1,80 @@
+.\" $NetBSD: duplocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" Copyright (c) 2011 The FreeBSD Foundation
+.\" All rights reserved.
+.\"
+.\" This documentation was written by David Chisnall under sponsorship from
+.\" the FreeBSD Foundation.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: head/lib/libc/locale/duplocale.3 281925 2015-04-24 10:17:55Z theraven $
+.\"
+.Dd September 17, 2011
+.Dt DUPLOCALE 3
+.Os
+.Sh NAME
+.Nm duplocale
+.Nd duplicate an locale
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In locale.h
+.Ft locale_t
+.Fn duplocale "locale_t locale"
+.Sh DESCRIPTION
+Duplicates an existing
+.Fa locale_t
+returning a new
+.Fa locale_t
+that refers to the same locale values but has an independent internal state.
+Various functions, such as
+.Xr mblen 3
+require a persistent state.
+These functions formerly used static variables and calls to them from multiple
+threads had undefined behavior.
+They now use fields in the
+.Fa locale_t
+associated with the current thread by
+.Xr uselocale 3 .
+These calls are therefore only thread safe on threads with a unique per-thread
+locale.
+The locale returned by this call must be freed with
+.Xr freelocale 3 .
+.Sh SEE ALSO
+.Xr freelocale 3 ,
+.Xr localeconv 3 ,
+.Xr newlocale 3 ,
+.\" .Xr querylocale 3 ,
+.Xr uselocale 3 ,
+.\" .Xr xlocale 3
+.Sh STANDARDS
+This function conforms to
+.St -p1003.1-2008 .
+.Sh BUGS
+Ideally,
+.Xr uselocale 3
+should make a copy of the
+.Fa locale_t
+implicitly to ensure thread safety,
+and a copy of the global locale should be installed lazily on each thread.
+The FreeBSD implementation does not do this,
+for compatibility with Darwin.
Index: src/lib/libc/locale/freelocale.3
diff -u /dev/null src/lib/libc/locale/freelocale.3:1.1
--- /dev/null	Mon Feb 15 09:35:04 2021
+++ src/lib/libc/locale/freelocale.3	Mon Feb 15 09:35:04 2021
@@ -0,0 +1,60 @@
+.\" $NetBSD: freelocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" Copyright (c) 2011 The FreeBSD Foundation
+.\" All rights reserved.
+.

CVS commit: src/sys/sys

2021-02-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 15 00:44:09 UTC 2021

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

Log Message:
remove _ prefix from args


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/sys/mbuf.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/mbuf.h
diff -u src/sys/sys/mbuf.h:1.228 src/sys/sys/mbuf.h:1.229
--- src/sys/sys/mbuf.h:1.228	Sun Feb 14 15:58:35 2021
+++ src/sys/sys/mbuf.h	Sun Feb 14 19:44:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.228 2021/02/14 20:58:35 christos Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.229 2021/02/15 00:44:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -844,14 +844,14 @@ m_copy_rcvif(struct mbuf *m, const struc
 }
 
 static __inline int
-m_get_aligned_hdr(struct mbuf **_m, int _align, size_t _hlen, bool _linkhdr)
+m_get_aligned_hdr(struct mbuf **m, int align, size_t hlen, bool linkhdr)
 {
-	if (POINTER_ALIGNED_P(mtod(*_m, void *), _align) == 0)
-		*_m = m_copyup(*_m, _hlen, 
-		  _linkhdr ? (max_linkhdr + _align) & ~_align : 0);
-	else if (__predict_false((*_m)->m_len < _hlen))
-		*_m = m_pullup(*_m, _hlen);
-	return *_m == NULL;
+	if (POINTER_ALIGNED_P(mtod(*m, void *), align) == 0)
+		*m = m_copyup(*m, hlen, 
+		  linkhdr ? (max_linkhdr + align) & ~align : 0);
+	else if (__predict_false((*m)->m_len < hlen))
+		*m = m_pullup(*m, hlen);
+	return *m == NULL;
 }
 
 void m_print(const struct mbuf *, const char *, void (*)(const char *, ...)



CVS commit: src/sys

2021-02-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 14 20:58:35 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_bridge.c
src/sys/netinet: icmp_private.h if_arp.c igmp_var.h in_l2tp.c ip_flow.c
ip_input.c ip_private.h tcp_input.c tcp_private.h udp_private.h
udp_usrreq.c
src/sys/netinet6: icmp6.c in6_l2tp.c ip6_flow.c ip6_input.c
ip6_private.h udp6_usrreq.c
src/sys/sys: mbuf.h param.h

Log Message:
- centralize header align and pullup into a single inline function
- use a single macro to align pointers and expose the alignment, instead
  of hard-coding 3 in 1/2 the macros.
- fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling
  for ipv6.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/net/if_arp.h
cvs rdiff -u -r1.177 -r1.178 src/sys/net/if_bridge.c
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/icmp_private.h \
src/sys/netinet/ip_private.h src/sys/netinet/tcp_private.h \
src/sys/netinet/udp_private.h
cvs rdiff -u -r1.301 -r1.302 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netinet/igmp_var.h
cvs rdiff -u -r1.18 -r1.19 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.82 -r1.83 src/sys/netinet/ip_flow.c
cvs rdiff -u -r1.397 -r1.398 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.424 -r1.425 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.259 -r1.260 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.247 -r1.248 src/sys/netinet6/icmp6.c
cvs rdiff -u -r1.19 -r1.20 src/sys/netinet6/in6_l2tp.c
cvs rdiff -u -r1.40 -r1.41 src/sys/netinet6/ip6_flow.c
cvs rdiff -u -r1.222 -r1.223 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet6/ip6_private.h
cvs rdiff -u -r1.148 -r1.149 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.227 -r1.228 src/sys/sys/mbuf.h
cvs rdiff -u -r1.684 -r1.685 src/sys/sys/param.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.39 src/sys/net/if_arp.h:1.40
--- src/sys/net/if_arp.h:1.39	Sun Feb 14 14:47:16 2021
+++ src/sys/net/if_arp.h	Sun Feb 14 15:58:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.39 2021/02/14 19:47:16 roy Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.40 2021/02/14 20:58:34 christos Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -72,6 +72,7 @@ struct	arphdr {
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
 };
+#define	ARP_HDR_ALIGNMENT	3
 
 static __inline uint8_t *
 ar_data(struct arphdr *ap)

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.177 src/sys/net/if_bridge.c:1.178
--- src/sys/net/if_bridge.c:1.177	Mon Nov  2 07:14:59 2020
+++ src/sys/net/if_bridge.c	Sun Feb 14 15:58:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.177 2020/11/02 12:14:59 roy Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.178 2021/02/14 20:58:34 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.177 2020/11/02 12:14:59 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.178 2021/02/14 20:58:34 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2806,18 +2806,10 @@ bridge_ip_checkbasic(struct mbuf **mp)
 	if (*mp == NULL)
 		return -1;
 
-	if (IP_HDR_ALIGNED_P(mtod(m, void *)) == 0) {
-		if ((m = m_copyup(m, sizeof(struct ip),
-			(max_linkhdr + 3) & ~3)) == NULL) {
-			/* XXXJRT new stat, please */
-			ip_statinc(IP_STAT_TOOSMALL);
-			goto bad;
-		}
-	} else if (__predict_false(m->m_len < sizeof (struct ip))) {
-		if ((m = m_pullup(m, sizeof (struct ip))) == NULL) {
-			ip_statinc(IP_STAT_TOOSMALL);
-			goto bad;
-		}
+	if (m_get_aligned_hdr(&m, IP_HDR_ALIGNMENT, sizeof(*ip), true) != 0) {
+		/* XXXJRT new stat, please */
+		ip_statinc(IP_STAT_TOOSMALL);
+		goto bad;
 	}
 	ip = mtod(m, struct ip *);
 	if (ip == NULL) goto bad;
@@ -2908,22 +2900,12 @@ bridge_ip6_checkbasic(struct mbuf **mp)
 	 * it.  Otherwise, if it is aligned, make sure the entire base
 	 * IPv6 header is in the first mbuf of the chain.
 	 */
-	if (IP6_HDR_ALIGNED_P(mtod(m, void *)) == 0) {
+	if (m_get_aligned_hdr(&m, IP6_HDR_ALIGNMENT, sizeof(*ip6), true) != 0) {
 		struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
-		if ((m = m_copyup(m, sizeof(struct ip6_hdr),
-		  (max_linkhdr + 3) & ~3)) == NULL) {
-			/* XXXJRT new stat, please */
-			ip6_statinc(IP6_STAT_TOOSMALL);
-			in6_ifstat_inc(inifp, ifs6_in_hdrerr);
-			goto bad;
-		}
-	} else if (__predict_false(m->m_len < sizeof(struct ip6_hdr))) {
-		struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
-		if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {
-			ip6_statinc(IP6_STAT_TOOSMALL);
-			in6_ifstat_inc(inifp, ifs6_in_hdrerr);
-			goto bad;
-		}
+		/* XXXJRT new stat, please */
+		ip6_statinc(IP6_STAT_TOOSMALL);
+		in6_ifstat_inc(inifp, ifs6_in_hdrerr);
+		goto bad;
 	}
 
 	ip6 = mtod(m, struct ip6_hdr *);

Index: src/sys/netinet/icmp_private.h
diff -u

CVS commit: src/sys/dev/scsipi

2021-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 10 16:30:01 UTC 2021

Modified Files:
src/sys/dev/scsipi: cd.c sd.c

Log Message:
PR/55986: Ryo Onodera: DK_BUSY must have mask as second argument. Make cd.c
consistent by also using __BIT()


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.330 -r1.331 src/sys/dev/scsipi/sd.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/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.349 src/sys/dev/scsipi/cd.c:1.350
--- src/sys/dev/scsipi/cd.c:1.349	Mon Oct 26 07:39:48 2020
+++ src/sys/dev/scsipi/cd.c	Wed Feb 10 11:30:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.349 2020/10/26 11:39:48 mlelstv Exp $	*/
+/*	$NetBSD: cd.c,v 1.350 2021/02/10 16:30:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.349 2020/10/26 11:39:48 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.350 2021/02/10 16:30:01 christos Exp $");
 
 #include 
 #include 
@@ -1378,7 +1378,7 @@ cdioctl(dev_t dev, u_long cmd, void *add
 		XS_CTL_IGNORE_NOT_READY | XS_CTL_IGNORE_MEDIA_CHANGE));
 	case DIOCEJECT:
 		if (*(int *)addr == 0) {
-			int pmask = 1 << part;
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.330 src/sys/dev/scsipi/sd.c:1.331
--- src/sys/dev/scsipi/sd.c:1.330	Fri Sep 25 09:08:00 2020
+++ src/sys/dev/scsipi/sd.c	Wed Feb 10 11:30:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.330 2020/09/25 13:08:00 jakllsch Exp $	*/
+/*	$NetBSD: sd.c,v 1.331 2021/02/10 16:30:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.330 2020/09/25 13:08:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.331 2021/02/10 16:30:01 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -954,11 +954,12 @@ sdioctl(dev_t dev, u_long cmd, void *add
 		if ((periph->periph_flags & PERIPH_REMOVABLE) == 0)
 			return (ENOTTY);
 		if (*(int *)addr == 0) {
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.
 			 */
-			if (DK_BUSY(dksc, part) == 0) {
+			if (DK_BUSY(dksc, pmask) == 0) {
 error = scsipi_prevent(periph, SPAMR_ALLOW,
 XS_CTL_IGNORE_NOT_READY);
 if (error)



CVS commit: src/sys/external/bsd/ipf/netinet

2021-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 10 00:28:55 UTC 2021

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_nat6.c

Log Message:
>From Cy Schubert:

ipfilter: Use the softn (NAT softc) host map size in ip_nat6
calculation. The ipfilter NAT table host map size is a tunable
that defaults to a macro value defined at build time. HOSTMAP_SIZE
is saved in softn (the ipnat softc) at initialization. It can be
tuned (changed) at runtime using the ipf -T command. If the
hostmap_size tunable is adjusted the calculation to determine where
to put new entries in the table was incorrect. Use the tunable in
the NAT softc instead of the static build time value.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/ipf/netinet/ip_nat6.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/external/bsd/ipf/netinet/ip_nat6.c
diff -u src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.11 src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.12
--- src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.11	Thu May  3 03:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_nat6.c	Tue Feb  9 19:28:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_nat6.c,v 1.11 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_nat6.c,v 1.12 2021/02/10 00:28:55 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -382,7 +382,7 @@ ipf_nat6_hostmap(ipf_nat_softc_t *softn,
 	hv += dst->i6[2];
 	hv += dst->i6[1];
 	hv += dst->i6[0];
-	hv %= HOSTMAP_SIZE;
+	hv %= softn->ipf_nat_hostmap_sz;
 	for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_next)
 		if (IP6_EQ(&hm->hm_osrc6, src) &&
 		IP6_EQ(&hm->hm_odst6, dst) &&



CVS commit: src/sys/sys

2021-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb  6 21:08:51 UTC 2021

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

Log Message:
Expose devhandle_t to standalone programs (fixes sparc* build etc)


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 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.166 src/sys/sys/device.h:1.167
--- src/sys/sys/device.h:1.166	Fri Feb  5 12:03:35 2021
+++ src/sys/sys/device.h	Sat Feb  6 16:08:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.166 2021/02/05 17:03:35 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.167 2021/02/06 21:08:51 christos Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -148,7 +148,33 @@ typedef struct cfdata *cfdata_t;
 typedef struct cfdriver *cfdriver_t;
 typedef struct cfattach *cfattach_t;
 
-#if defined(_KERNEL) || defined(_KMEMUSER)
+#if defined(_KERNEL) || defined(_KMEMUSER) || defined(_STANDALONE)
+/*
+ * devhandle_t --
+ *
+ *	This is an abstraction of the device handles used by ACPI,
+ *	OpenFirmware, and others, to support device enumeration and
+ *	device tree linkage.  A devhandle_t can be safely passed
+ *	by value.
+ */
+struct devhandle {
+	const struct devhandle_impl *	impl;
+	union {
+		/*
+		 * Storage for the device handle.  Which storage field
+		 * is used is at the sole discretion of the type
+		 * implementation.
+		 */
+		void *			pointer;
+		const void *		const_pointer;
+		uintptr_t		uintptr;
+		int			integer;
+	};
+};
+typedef struct devhandle devhandle_t;
+#endif
+
+#if defined(_KERNEL) || defined(_KMEMUSER) 
 struct device_compatible_entry {
 	union {
 		const char *compat;
@@ -182,29 +208,6 @@ struct device_garbage {
 	int		dg_ndevs;
 };
 
-/*
- * devhandle_t --
- *
- *	This is an abstraction of the device handles used by ACPI,
- *	OpenFirmware, and others, to support device enumeration and
- *	device tree linkage.  A devhandle_t can be safely passed
- *	by value.
- */
-struct devhandle {
-	const struct devhandle_impl *	impl;
-	union {
-		/*
-		 * Storage for the device handle.  Which storage field
-		 * is used is at the sole discretion of the type
-		 * implementation.
-		 */
-		void *			pointer;
-		const void *		const_pointer;
-		uintptr_t		uintptr;
-		int			integer;
-	};
-};
-typedef struct devhandle devhandle_t;
 
 typedef enum {
 	/* Used to represent invalid states. */



CVS commit: src/sys/dev/pci

2021-02-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  5 16:06:25 UTC 2021

Modified Files:
src/sys/dev/pci: if_wpi.c

Log Message:
PR/55975: Riccardo Mottola: Don't try to lock a mutex from an interrupt context.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/if_wpi.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/dev/pci/if_wpi.c
diff -u src/sys/dev/pci/if_wpi.c:1.89 src/sys/dev/pci/if_wpi.c:1.90
--- src/sys/dev/pci/if_wpi.c:1.89	Fri Mar 20 13:19:25 2020
+++ src/sys/dev/pci/if_wpi.c	Fri Feb  5 11:06:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wpi.c,v 1.89 2020/03/20 17:19:25 sevan Exp $	*/
+/*	$NetBSD: if_wpi.c,v 1.90 2021/02/05 16:06:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.89 2020/03/20 17:19:25 sevan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.90 2021/02/05 16:06:24 christos Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -158,6 +158,8 @@ static bool	wpi_resume(device_t, const p
 static int	wpi_getrfkill(struct wpi_softc *);
 static void	wpi_sysctlattach(struct wpi_softc *);
 static void	wpi_rsw_thread(void *);
+static void	wpi_rsw_suspend(struct wpi_softc *);
+static void	wpi_stop_intr(struct ifnet *, int);
 
 #ifdef WPI_DEBUG
 #define DPRINTF(x)	do { if (wpi_debug > 0) printf x; } while (0)
@@ -1769,7 +1771,7 @@ wpi_notif_intr(struct wpi_softc *sc)
 "Radio transmitter is off\n");
 /* turn the interface down */
 ifp->if_flags &= ~IFF_UP;
-wpi_stop(ifp, 1);
+wpi_stop_intr(ifp, 1);
 splx(s);
 return;	/* no further processing */
 			}
@@ -1853,7 +1855,7 @@ wpi_softintr(void *arg)
 		/* SYSTEM FAILURE, SYSTEM FAILURE */
 		aprint_error_dev(sc->sc_dev, "fatal firmware error\n");
 		ifp->if_flags &= ~IFF_UP;
-		wpi_stop(ifp, 1);
+		wpi_stop_intr(ifp, 1);
 		return;
 	}
 
@@ -2203,7 +2205,7 @@ wpi_watchdog(struct ifnet *ifp)
 		if (--sc->sc_tx_timer == 0) {
 			aprint_error_dev(sc->sc_dev, "device timeout\n");
 			ifp->if_flags &= ~IFF_UP;
-			wpi_stop(ifp, 1);
+			wpi_stop_intr(ifp, 1);
 			if_statinc(ifp, if_oerrors);
 			return;
 		}
@@ -3200,7 +3202,7 @@ wpi_init(struct ifnet *ifp)
 	uint32_t tmp;
 	int qid, ntries, error;
 
-	wpi_stop(ifp,1);
+	wpi_stop(ifp, 1);
 	(void)wpi_reset(sc);
 
 	wpi_mem_lock(sc);
@@ -3311,7 +3313,7 @@ fail1:	wpi_stop(ifp, 1);
 }
 
 static void
-wpi_stop(struct ifnet *ifp, int disable)
+wpi_stop1(struct ifnet *ifp, int disable, bool fromintr)
 {
 	struct wpi_softc *sc = ifp->if_softc;
 	struct ieee80211com *ic = &sc->sc_ic;
@@ -3323,13 +3325,11 @@ wpi_stop(struct ifnet *ifp, int disable)
 
 	ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
 
-	/* suspend rfkill test thread */
-	mutex_enter(&sc->sc_rsw_mtx);
-	sc->sc_rsw_suspend = true;
-	cv_broadcast(&sc->sc_rsw_cv);
-	while (!sc->sc_rsw_suspended)
-		cv_wait(&sc->sc_rsw_cv, &sc->sc_rsw_mtx);
-	mutex_exit(&sc->sc_rsw_mtx);
+	if (fromintr) {
+		sc->sc_rsw_suspend = true; // XXX: without mutex or wait
+	} else {
+		wpi_rsw_suspend(sc);
+	}
 
 	/* disable interrupts */
 	WPI_WRITE(sc, WPI_MASK, 0);
@@ -3361,6 +3361,18 @@ wpi_stop(struct ifnet *ifp, int disable)
 	WPI_WRITE(sc, WPI_RESET, tmp | WPI_SW_RESET);
 }
 
+static void
+wpi_stop(struct ifnet *ifp, int disable)
+{
+	wpi_stop1(ifp, disable, false);
+}
+
+static void
+wpi_stop_intr(struct ifnet *ifp, int disable)
+{
+	wpi_stop1(ifp, disable, true);
+}
+
 static bool
 wpi_resume(device_t dv, const pmf_qual_t *qual)
 {
@@ -3463,6 +3475,18 @@ err:
 }
 
 static void
+wpi_rsw_suspend(struct wpi_softc *sc)
+{
+	/* suspend rfkill test thread */
+	mutex_enter(&sc->sc_rsw_mtx);
+	sc->sc_rsw_suspend = true;
+	cv_broadcast(&sc->sc_rsw_cv);
+	while (!sc->sc_rsw_suspended)
+		cv_wait(&sc->sc_rsw_cv, &sc->sc_rsw_mtx);
+	mutex_exit(&sc->sc_rsw_mtx);
+}
+
+static void
 wpi_rsw_thread(void *arg)
 {
 	struct wpi_softc *sc = (struct wpi_softc *)arg;



CVS commit: src/external/bsd/libarchive/dist/tar

2021-01-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 28 19:46:54 UTC 2021

Modified Files:
src/external/bsd/libarchive/dist/tar: write.c

Log Message:
Don't try print an error message when there is none.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libarchive/dist/tar/write.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/bsd/libarchive/dist/tar/write.c
diff -u src/external/bsd/libarchive/dist/tar/write.c:1.2 src/external/bsd/libarchive/dist/tar/write.c:1.3
--- src/external/bsd/libarchive/dist/tar/write.c:1.2	Thu Jan 28 14:42:27 2021
+++ src/external/bsd/libarchive/dist/tar/write.c	Thu Jan 28 14:46:54 2021
@@ -798,7 +798,9 @@ copy_file_data_block(struct bsdtar *bsdt
 		progress += bytes_written;
 	}
 	if (r < ARCHIVE_WARN) {
-		lafe_warnc(archive_errno(a), "%s", archive_error_string(a));
+		const char *s = archive_error_string(a);
+		if (s)
+			lafe_warnc(archive_errno(a), "%s", s);
 		return (-1);
 	}
 	return (0);



CVS commit: src/external/bsd/libarchive/dist/tar

2021-01-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 28 19:42:27 UTC 2021

Modified Files:
src/external/bsd/libarchive/dist/tar: write.c

Log Message:
PR/55962: Andreas Gustafsson: Some tar(1) error messages lack file name and
newline


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/libarchive/dist/tar/write.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/bsd/libarchive/dist/tar/write.c
diff -u src/external/bsd/libarchive/dist/tar/write.c:1.1.1.5 src/external/bsd/libarchive/dist/tar/write.c:1.2
--- src/external/bsd/libarchive/dist/tar/write.c:1.1.1.5	Wed Jul 24 09:50:41 2019
+++ src/external/bsd/libarchive/dist/tar/write.c	Thu Jan 28 14:42:27 2021
@@ -971,16 +971,15 @@ write_entry(struct bsdtar *bsdtar, struc
 
 	e = archive_write_header(a, entry);
 	if (e != ARCHIVE_OK) {
-		if (bsdtar->verbose > 1) {
+		if (bsdtar->verbose > 0) {
 			safe_fprintf(stderr, "a ");
 			list_item_verbose(bsdtar, stderr, entry);
 			lafe_warnc(0, ": %s", archive_error_string(a));
-		} else if (bsdtar->verbose > 0) {
+		} else {
 			lafe_warnc(0, "%s: %s",
 			archive_entry_pathname(entry),
 			archive_error_string(a));
-		} else
-			fprintf(stderr, ": %s", archive_error_string(a));
+		}
 	}
 
 	if (e == ARCHIVE_FATAL)



CVS commit: src/sys/net/npf

2021-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 27 17:39:13 UTC 2021

Modified Files:
src/sys/net/npf: npf_os.c

Log Message:
Don't silently ignore the errors from npfctl_run_op. We end up returning
packets to userland that are missing required fields (like in rule_add the
id of the rule) and npfctl aborts.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/net/npf/npf_os.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/net/npf/npf_os.c
diff -u src/sys/net/npf/npf_os.c:1.20 src/sys/net/npf/npf_os.c:1.21
--- src/sys/net/npf/npf_os.c:1.20	Mon Jan 25 12:17:19 2021
+++ src/sys/net/npf/npf_os.c	Wed Jan 27 12:39:13 2021
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.20 2021/01/25 17:17:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.21 2021/01/27 17:39:13 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -298,8 +298,11 @@ npf_dev_ioctl(dev_t dev, u_long cmd, voi
 #endif
 	}
 	resp = nvlist_create(0);
-	npfctl_run_op(npf, cmd, req, resp);
-	error = nvlist_copyout(data, resp);
+
+	if ((error = npfctl_run_op(npf, cmd, req, resp)) == 0) {
+		error = nvlist_copyout(data, resp);
+	}
+
 	nvlist_destroy(resp);
 	nvlist_destroy(req);
 



CVS commit: src/sys/net/npf

2021-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 25 17:18:55 UTC 2021

Modified Files:
src/sys/net/npf: npf_conn.c npf_tableset.c

Log Message:
s/npf_config_lock/npf->config_lock/ in the comments


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/npf/npf_conn.c
cvs rdiff -u -r1.35 -r1.36 src/sys/net/npf/npf_tableset.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/net/npf/npf_conn.c
diff -u src/sys/net/npf/npf_conn.c:1.32 src/sys/net/npf/npf_conn.c:1.33
--- src/sys/net/npf/npf_conn.c:1.32	Sat May 30 10:16:56 2020
+++ src/sys/net/npf/npf_conn.c	Mon Jan 25 12:18:55 2021
@@ -97,14 +97,14 @@
  *
  * Lock order
  *
- *	npf_config_lock ->
+ *	npf->config_lock ->
  *		conn_lock ->
  *			npf_conn_t::c_lock
  */
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_conn.c,v 1.32 2020/05/30 14:16:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_conn.c,v 1.33 2021/01/25 17:18:55 christos Exp $");
 
 #include 
 #include 

Index: src/sys/net/npf/npf_tableset.c
diff -u src/sys/net/npf/npf_tableset.c:1.35 src/sys/net/npf/npf_tableset.c:1.36
--- src/sys/net/npf/npf_tableset.c:1.35	Sat May 30 10:16:56 2020
+++ src/sys/net/npf/npf_tableset.c	Mon Jan 25 12:18:55 2021
@@ -46,7 +46,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.35 2020/05/30 14:16:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.36 2021/01/25 17:18:55 christos Exp $");
 
 #include 
 #include 
@@ -101,7 +101,7 @@ struct npf_table {
 
 	/*
 	 * Table ID, type and lock.  The ID may change during the
-	 * config reload, it is protected by the npf_config_lock.
+	 * config reload, it is protected by the npf->config_lock.
 	 */
 	int			t_type;
 	unsigned		t_id;



CVS commit: src/sys/net/npf

2021-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 25 17:17:19 UTC 2021

Modified Files:
src/sys/net/npf: npf_os.c

Log Message:
Fix locking issue: npf_default_pass needs to be called with the config lock
held.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/net/npf/npf_os.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/net/npf/npf_os.c
diff -u src/sys/net/npf/npf_os.c:1.19 src/sys/net/npf/npf_os.c:1.20
--- src/sys/net/npf/npf_os.c:1.19	Tue Aug 18 03:53:24 2020
+++ src/sys/net/npf/npf_os.c	Mon Jan 25 12:17:19 2021
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.19 2020/08/18 07:53:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.20 2021/01/25 17:17:19 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -321,8 +321,16 @@ npf_dev_read(dev_t dev, struct uio *uio,
 bool
 npf_autounload_p(void)
 {
+	if (npf_active_p())
+		return false;
+
 	npf_t *npf = npf_getkernctx();
-	return !npf_active_p() && npf_default_pass(npf);
+
+	npf_config_enter(npf);
+	bool pass = npf_default_pass(npf);
+	npf_config_exit(npf);
+
+	return pass;
 }
 
 /*



CVS commit: src/tools/lint

2021-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 15:43:09 UTC 2021

Modified Files:
src/tools/lint: Makefile

Log Message:
Install lint's custom stdbool.h and make lint search for it in the right place.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tools/lint/Makefile

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

Modified files:

Index: src/tools/lint/Makefile
diff -u src/tools/lint/Makefile:1.4 src/tools/lint/Makefile:1.5
--- src/tools/lint/Makefile:1.4	Mon Nov 12 18:16:28 2001
+++ src/tools/lint/Makefile	Sun Jan 24 10:43:09 2021
@@ -1,8 +1,19 @@
-#	$NetBSD: Makefile,v 1.4 2001/11/12 23:16:28 tv Exp $
+#	$NetBSD: Makefile,v 1.5 2021/01/24 15:43:09 christos Exp $
 
 HOSTPROGNAME=	${MACHINE_GNU_PLATFORM}-lint
 HOST_SRCDIR=	usr.bin/xlint/xlint
 HOST_CPPFLAGS=	-DPATH_LIBEXEC=\"${TOOLDIR}/libexec\" \
+		-DPATH_LIBLINT=\"${TOOLDIR}/libdata/lint\" \
 		-DTARGET_PREFIX=\"${MACHINE_GNU_PLATFORM}-\"
 
+
 .include "${.CURDIR}/../Makefile.host"
+
+STDBOOL_H=${NETBSDSRCDIR}/${HOST_SRCDIR}/strict-bool-stdbool.h
+
+install: ${TOOLDIR}/libdata/lint/stdbool.h
+
+${TOOLDIR}/libdata/lint/stdbool.h:: ${STDBOOL_H}
+	${_MKTARGET_INSTALL}
+	mkdir -p ${TOOLDIR}/libdata/lint
+	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${STDBOOL_H} ${.TARGET}



CVS commit: src/sys/dev/pci

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 01:44:12 UTC 2021

Modified Files:
src/sys/dev/pci: virtio_pci.c

Log Message:
Add a comment explaining why bus_space_write_8 is limited to virtio.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/virtio_pci.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/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.19 src/sys/dev/pci/virtio_pci.c:1.20
--- src/sys/dev/pci/virtio_pci.c:1.19	Sat Jan 23 15:00:19 2021
+++ src/sys/dev/pci/virtio_pci.c	Sat Jan 23 20:44:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.20 2021/01/24 01:44:11 christos Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.20 2021/01/24 01:44:11 christos Exp $");
 
 #include 
 #include 
@@ -733,6 +733,12 @@ virtio_pci_read_queue_size_10(struct vir
  * written as two 4 byters
  */
 #ifndef __HAVE_BUS_SPACE_8
+/*
+ * This is not a general purpose function that can be used in any
+ * driver. Virtio specifically allows the 8 byte bus transaction
+ * to be split into two 4 byte transactions. Do not copy/use it
+ * in other device drivers unless you know that the device accepts it.
+ */
 static __inline void
 bus_space_write_8(bus_space_tag_t iot, bus_space_handle_t ioh,
  bus_size_t offset, uint64_t value)



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

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 00:11:07 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: Makefile

Log Message:
fix the build


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/xlint/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.bin/xlint/xlint/Makefile
diff -u src/usr.bin/xlint/xlint/Makefile:1.19 src/usr.bin/xlint/xlint/Makefile:1.20
--- src/usr.bin/xlint/xlint/Makefile:1.19	Sun Jan 17 14:32:53 2021
+++ src/usr.bin/xlint/xlint/Makefile	Sat Jan 23 19:11:07 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2021/01/17 19:32:53 rillig Exp $
+#	$NetBSD: Makefile,v 1.20 2021/01/24 00:11:07 christos Exp $
 
 .PATH:		${.CURDIR}/../lint1
 .PATH:		${.CURDIR}/../../mkdep
@@ -14,10 +14,10 @@ CPPFLAGS+=	-I${.CURDIR}/../../mkdep
 .if (${HOSTPROG:U} == "")
 DPADD+=		${LIBUTIL}
 LDADD+=		-lutil
-.endif
 
 FILES+=		strict-bool-stdbool.h
 FILESDIR=	/usr/libdata/lint/strict-bool
 FILESNAME_strict-bool-stdbool.h= stdbool.h
+.endif
 
 .include 



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

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 00:02:38 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
fix the build


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/lint1/lex.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/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.3 src/usr.bin/xlint/lint1/lex.c:1.4
--- src/usr.bin/xlint/lint1/lex.c:1.3	Sat Jan 23 18:11:40 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sat Jan 23 19:02:38 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.3 2021/01/23 23:11:40 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.4 2021/01/24 00:02:38 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -32,9 +32,13 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.3 2021/01/23 23:11:40 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.4 2021/01/24 00:02:38 christos Exp $");
 #endif
 
 #include 



CVS commit: src/sys/dev/pci

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 23 20:00:19 UTC 2021

Modified Files:
src/sys/dev/pci: virtio_pci.c

Log Message:
Provide a generic bus_space_write_8 function that is bi-endian.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/virtio_pci.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/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.18 src/sys/dev/pci/virtio_pci.c:1.19
--- src/sys/dev/pci/virtio_pci.c:1.18	Thu Jan 21 15:48:33 2021
+++ src/sys/dev/pci/virtio_pci.c	Sat Jan 23 15:00:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.18 2021/01/21 20:48:33 reinoud Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,12 +28,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.18 2021/01/21 20:48:33 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -731,9 +732,20 @@ virtio_pci_read_queue_size_10(struct vir
  * By definition little endian only in v1.0 and 8 byters are allowed to be
  * written as two 4 byters
  */
-#define bus_space_write_le_8(iot, ioh, reg, val) \
-	bus_space_write_4(iot, ioh, reg, ((uint64_t) (val)) & 0x); \
-	bus_space_write_4(iot, ioh, reg + 4, ((uint64_t) (val)) >> 32);
+#ifndef __HAVE_BUS_SPACE_8
+static __inline void
+bus_space_write_8(bus_space_tag_t iot, bus_space_handle_t ioh,
+ bus_size_t offset, uint64_t value)
+{
+#if _QUAD_HIGHWORD
+	bus_space_write_4(iot, ioh, offset, BUS_ADDR_LO32(value));
+	bus_space_write_4(iot, ioh, offset + 4, BUS_ADDR_HI32(value));
+#else
+	bus_space_write_4(iot, ioh, offset, BUS_ADDR_HI32(value));
+	bus_space_write_4(iot, ioh, offset + 4, BUS_ADDR_LO32(value));
+#endif
+}
+#endif
 
 static void
 virtio_pci_setup_queue_10(struct virtio_softc *sc, uint16_t idx, uint64_t addr)
@@ -747,15 +759,15 @@ virtio_pci_setup_queue_10(struct virtio_
 	bus_space_write_2(iot, ioh, VIRTIO_CONFIG1_QUEUE_SELECT, vq->vq_index);
 	if (addr == 0) {
 		bus_space_write_2(iot, ioh, VIRTIO_CONFIG1_QUEUE_ENABLE, 0);
-		bus_space_write_le_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_DESC,   0);
-		bus_space_write_le_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_AVAIL,  0);
-		bus_space_write_le_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_USED,   0);
+		bus_space_write_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_DESC,   0);
+		bus_space_write_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_AVAIL,  0);
+		bus_space_write_8(iot, ioh, VIRTIO_CONFIG1_QUEUE_USED,   0);
 	} else {
-		bus_space_write_le_8(iot, ioh,
+		bus_space_write_8(iot, ioh,
 			VIRTIO_CONFIG1_QUEUE_DESC, addr);
-		bus_space_write_le_8(iot, ioh,
+		bus_space_write_8(iot, ioh,
 			VIRTIO_CONFIG1_QUEUE_AVAIL, addr + vq->vq_availoffset);
-		bus_space_write_le_8(iot, ioh,
+		bus_space_write_8(iot, ioh,
 			VIRTIO_CONFIG1_QUEUE_USED, addr + vq->vq_usedoffset);
 		bus_space_write_2(iot, ioh,
 			VIRTIO_CONFIG1_QUEUE_ENABLE, 1);
@@ -771,7 +783,6 @@ virtio_pci_setup_queue_10(struct virtio_
 			VIRTIO_CONFIG1_QUEUE_MSIX_VECTOR, vec);
 	}
 }
-#undef bus_space_write_le_8
 
 static void
 virtio_pci_set_status_10(struct virtio_softc *sc, int status)



CVS commit: src/sys/arch

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 23 19:38:53 UTC 2021

Modified Files:
src/sys/arch/alpha/include: types.h
src/sys/arch/amd64/include: types.h
src/sys/arch/atari/include: types.h
src/sys/arch/dreamcast/include: types.h
src/sys/arch/evbsh3/include: types.h
src/sys/arch/hp300/include: types.h
src/sys/arch/hpcsh/include: types.h
src/sys/arch/hppa/include: types.h
src/sys/arch/ia64/include: types.h
src/sys/arch/landisk/include: types.h
src/sys/arch/mips/include: types.h
src/sys/arch/ofppc/include: types.h
src/sys/arch/or1k/include: types.h
src/sys/arch/powerpc/include: types.h
src/sys/arch/sparc/include: types.h

Log Message:
Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/alpha/include/types.h
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/atari/include/types.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/dreamcast/include/types.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbsh3/include/types.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp300/include/types.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcsh/include/types.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hppa/include/types.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ia64/include/types.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/landisk/include/types.h
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/mips/include/types.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ofppc/include/types.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/or1k/include/types.h
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc/include/types.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/arch/alpha/include/types.h
diff -u src/sys/arch/alpha/include/types.h:1.60 src/sys/arch/alpha/include/types.h:1.61
--- src/sys/arch/alpha/include/types.h:1.60	Thu Sep 24 23:40:11 2020
+++ src/sys/arch/alpha/include/types.h	Sat Jan 23 14:38:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.60 2020/09/25 03:40:11 thorpej Exp $ */
+/* $NetBSD: types.h,v 1.61 2021/01/23 19:38:51 christos Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -86,6 +86,7 @@ typedef __register_t	register_t;
 #define	__HAVE_COMMON___TLS_GET_ADDR
 #define	__HAVE_TLS_VARIANT_I
 #define	__HAVE_UCAS_FULL
+#define	__HAVE_BUS_SPACE_8
 
 #if defined(_KERNEL)
 #define	__HAVE_RAS

Index: src/sys/arch/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.69 src/sys/arch/amd64/include/types.h:1.70
--- src/sys/arch/amd64/include/types.h:1.69	Sat Aug  1 08:14:39 2020
+++ src/sys/arch/amd64/include/types.h	Sat Jan 23 14:38:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.69 2020/08/01 12:14:39 jdolecek Exp $	*/
+/*	$NetBSD: types.h,v 1.70 2021/01/23 19:38:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -100,6 +100,7 @@ typedef	unsigned char		__cpu_simple_lock
 #define	__HAVE_MM_MD_DIRECT_MAPPED_IO
 #define	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #define	__HAVE_UCAS_FULL
+#define	__HAVE_BUS_SPACE_8
 
 #ifdef _KERNEL_OPT
 #define	__HAVE_RAS

Index: src/sys/arch/atari/include/types.h
diff -u src/sys/arch/atari/include/types.h:1.16 src/sys/arch/atari/include/types.h:1.17
--- src/sys/arch/atari/include/types.h:1.16	Sun Dec 18 04:12:18 2011
+++ src/sys/arch/atari/include/types.h	Sat Jan 23 14:38:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.16 2011/12/18 09:12:18 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.17 2021/01/23 19:38:52 christos Exp $	*/
 
 #ifndef _MACHINE_TYPES_H_
 #define	_MACHINE_TYPES_H_
@@ -7,5 +7,6 @@
 
 #define __HAVE_MM_MD_READWRITE
 #define __HAVE_NEW_STYLE_BUS_H
+#define	__HAVE_BUS_SPACE_8
 
 #endif

Index: src/sys/arch/dreamcast/include/types.h
diff -u src/sys/arch/dreamcast/include/types.h:1.4 src/sys/arch/dreamcast/include/types.h:1.5
--- src/sys/arch/dreamcast/include/types.h:1.4	Tue Sep 19 20:41:12 2006
+++ src/sys/arch/dreamcast/include/types.h	Sat Jan 23 14:38:52 2021
@@ -1,7 +1,8 @@
-/*	$NetBSD: types.h,v 1.4 2006/09/20 00:41:12 uwe Exp $	*/
+/*	$NetBSD: types.h,v 1.5 2021/01/23 19:38:52 christos Exp $	*/
 #ifndef _DREAMCAST_TYPES_H_
 #define	_DREAMCAST_TYPES_H_
 
 #include 
+#define	__HAVE_BUS_SPACE_8
 
 #endif /* _DREAMCAST_TYPES_H_ */

Index: src/sys/arch/evbsh3/include/types.h
diff -u src/sys/arch/evbsh3/include/types.h:1.2 src/sys/arch/evbsh3/include/types.h:1.3
--- src/sys/arch/evbsh3/include/types.h:1.2	Wed Feb 27 22:17:27 2002
+++ src/sys/arch/evbsh3/include/types.h	Sat Jan 23 14:38:52 2021
@@ -1,7 +1,8 @@
-/*	$NetBSD: types.h,v 1.2 2002/02/28 03:17:27 simonb Exp $	*/
+/*	$NetBSD: types.h,v 1.3 2021/01/23 19:38:52 christos Exp $	*/
 #ifndef _EVBSH3_TYPES_H_
 #define	_EVBSH3_TYPES_H_
 
 #include 
+#define	__HAVE_BUS_SPACE_8
 
 #endif /* _EV

CVS commit: src/sys/arch

2021-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 23 19:38:08 UTC 2021

Modified Files:
src/sys/arch/emips/include: bus.h
src/sys/arch/evbcf/include: bus_space.h
src/sys/arch/hp300/include: bus.h
src/sys/arch/luna68k/include: bus.h
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mvme68k/include: bus_space.h
src/sys/arch/news68k/include: bus.h
src/sys/arch/newsmips/include: bus.h
src/sys/arch/next68k/include: bus_space.h
src/sys/arch/vax/include: bus.h

Log Message:
Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/include/bus.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbcf/include/bus_space.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp300/include/bus.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/luna68k/include/bus.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mvme68k/include/bus_space.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/news68k/include/bus.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/include/bus.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/next68k/include/bus_space.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/vax/include/bus.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/arch/emips/include/bus.h
diff -u src/sys/arch/emips/include/bus.h:1.4 src/sys/arch/emips/include/bus.h:1.5
--- src/sys/arch/emips/include/bus.h:1.4	Thu Apr  2 11:30:26 2020
+++ src/sys/arch/emips/include/bus.h	Sat Jan 23 14:38:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.4 2020/04/02 15:30:26 msaitoh Exp $	*/
+/*	$NetBSD: bus.h,v 1.5 2021/01/23 19:38:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -143,10 +143,6 @@ void	bus_space_free(bus_space_tag_t t, b
 #define	bus_space_read_4(t, h, o)	\
  ((void) t, (*(volatile u_int32_t *)((h) + (o
 
-#if 0	/* Cause a link error for bus_space_read_8 */
-#define	bus_space_read_8(t, h, o)	!!! bus_space_read_8 unimplemented !!!
-#endif
-
 /*
  *	void bus_space_read_multi_N(bus_space_tag_t tag,
  *	bus_space_handle_t bsh, bus_size_t offset,
@@ -178,10 +174,6 @@ __EMIPS_bus_space_read_multi(1,8)
 __EMIPS_bus_space_read_multi(2,16)
 __EMIPS_bus_space_read_multi(4,32)
 
-#if 0	/* Cause a link error for bus_space_read_multi_8 */
-#define	bus_space_read_multi_8	!!! bus_space_read_multi_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_read_multi
 
 /*
@@ -218,10 +210,6 @@ __EMIPS_bus_space_read_region(1,8)
 __EMIPS_bus_space_read_region(2,16)
 __EMIPS_bus_space_read_region(4,32)
 
-#if 0	/* Cause a link error for bus_space_read_region_8 */
-#define	bus_space_read_region_8	!!! bus_space_read_region_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_read_region
 
 /*
@@ -254,10 +242,6 @@ do {	\
 	wbflush();	/* XXX */	\
 } while (0)
 
-#if 0	/* Cause a link error for bus_space_write_8 */
-#define	bus_space_write_8	!!! bus_space_write_8 not implemented !!!
-#endif
-
 /*
  *	void bus_space_write_multi_N(bus_space_tag_t tag,
  *	bus_space_handle_t bsh, bus_size_t offset,
@@ -289,11 +273,6 @@ __EMIPS_bus_space_write_multi(1,8)
 __EMIPS_bus_space_write_multi(2,16)
 __EMIPS_bus_space_write_multi(4,32)
 
-#if 0	/* Cause a link error for bus_space_write_8 */
-#define	bus_space_write_multi_8(t, h, o, a, c)\
-			!!! bus_space_write_multi_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_write_multi
 
 /*
@@ -329,11 +308,6 @@ __EMIPS_bus_space_write_region(1,8)
 __EMIPS_bus_space_write_region(2,16)
 __EMIPS_bus_space_write_region(4,32)
 
-#if 0	/* Cause a link error for bus_space_write_region_8 */
-#define	bus_space_write_region_8	\
-			!!! bus_space_write_region_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_write_region
 
 /*
@@ -367,11 +341,6 @@ __EMIPS_bus_space_set_multi(1,8)
 __EMIPS_bus_space_set_multi(2,16)
 __EMIPS_bus_space_set_multi(4,32)
 
-#if 0	/* Cause a link error for bus_space_set_multi_8 */
-#define	bus_space_set_multi_8		\
-			!!! bus_space_set_multi_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_set_multi
 
 /*
@@ -407,11 +376,6 @@ __EMIPS_bus_space_set_region(1,8)
 __EMIPS_bus_space_set_region(2,16)
 __EMIPS_bus_space_set_region(4,32)
 
-#if 0	/* Cause a link error for bus_space_set_region_8 */
-#define	bus_space_set_region_8		\
-			!!! bus_space_set_region_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_bus_space_set_region
 
 /*
@@ -459,11 +423,6 @@ __EMIPS_copy_region(1)
 __EMIPS_copy_region(2)
 __EMIPS_copy_region(4)
 
-#if 0	/* Cause a link error for bus_space_copy_region_8 */
-#define	bus_space_copy_region_8		\
-			!!! bus_space_copy_region_8 unimplemented !!!
-#endif
-
 #undef __EMIPS_copy_regio

CVS commit: src/external/mpl/dhcp/dist/common

2021-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 13 17:01:31 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/common: options.c

Log Message:
Reset options on every loop.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/dist/common/options.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/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.4 src/external/mpl/dhcp/dist/common/options.c:1.5
--- src/external/mpl/dhcp/dist/common/options.c:1.4	Wed Jan 13 10:51:49 2021
+++ src/external/mpl/dhcp/dist/common/options.c	Wed Jan 13 12:01:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $	*/
 
 /* options.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $");
 
 #define DHCP_OPTION_DATA
 #include "dhcpd.h"
@@ -130,8 +130,8 @@ int parse_option_buffer (options, buffer
 	unsigned len, offset;
 	unsigned code;
 	struct option_cache *op = NULL, *nop = NULL;
-	struct buffer *bp = (struct buffer *)0;
-	struct option *option = NULL;
+	struct buffer *bp = NULL;
+	struct option *option;
 	char *reason = "general failure";
 
 	if (!buffer_allocate (&bp, length, MDL)) {
@@ -143,6 +143,7 @@ int parse_option_buffer (options, buffer
 	for (offset = 0;
 	 (offset + universe->tag_size) <= length &&
 	 (code = universe->get_tag(buffer + offset)) != universe->end; ) {
+		option = NULL;
 		offset += universe->tag_size;
 
 		/* Pad options don't have a length - just skip them. */



CVS commit: src/external/mpl/dhcp/dist/common

2021-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 13 15:51:49 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/common: options.c

Log Message:
If an option is not found in the standard table, log it and don't try to
dereference it. This prevents crashes from XenServer VM that PXE boots and
includes option 175 in the DHCP request. Reported by Stephen Borrill.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/common/options.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/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.3 src/external/mpl/dhcp/dist/common/options.c:1.4
--- src/external/mpl/dhcp/dist/common/options.c:1.3	Mon Aug  3 17:10:56 2020
+++ src/external/mpl/dhcp/dist/common/options.c	Wed Jan 13 10:51:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.3 2020/08/03 21:10:56 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $	*/
 
 /* options.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: options.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $");
 
 #define DHCP_OPTION_DATA
 #include "dhcpd.h"
@@ -179,13 +179,16 @@ int parse_option_buffer (options, buffer
 
 		offset += universe->length_size;
 
-		option_code_hash_lookup(&option, universe->code_hash, &code,
-	0, MDL);
+		if (!option_code_hash_lookup(&option, universe->code_hash,
+		&code, 0, MDL)) {
+			log_error("Can't find option with code %u", code);
+		}
 
 		/* If the length is outrageous, the options are bad. */
 		if (offset + len > length) {
 			/* Avoid reference count overflow */
-			option_dereference(&option, MDL);
+			if (option)
+option_dereference(&option, MDL);
 			reason = "option length exceeds option buffer length";
 		  bogus:
 			log_error("parse_option_buffer: malformed option "
@@ -216,7 +219,8 @@ int parse_option_buffer (options, buffer
 			/* non-compliant clients can send it
 			 * we'll just drop it and go on */
 			log_debug ("Ignoring empty DHO_HOST_NAME option");
-			option_dereference(&option, MDL);
+			if (option)
+option_dereference(&option, MDL);
 			offset += len;
 			continue;
 		}
@@ -282,7 +286,8 @@ int parse_option_buffer (options, buffer
 			option_cache_dereference(&nop, MDL);
 		}
 
-		option_dereference(&option, MDL);
+		if (option)
+			option_dereference(&option, MDL);
 		offset += len;
 	}
 	buffer_dereference (&bp, MDL);



CVS commit: src/external/bsd/ppp/usr.sbin/pppd

2021-01-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 11 21:45:22 UTC 2021

Modified Files:
src/external/bsd/ppp/usr.sbin/pppd: sys-bsd.c

Log Message:
Make this compile without -DINET6 (Kurt Schreiner)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.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/bsd/ppp/usr.sbin/pppd/sys-bsd.c
diff -u src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:1.8 src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:1.9
--- src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:1.8	Sat Jan  9 11:39:29 2021
+++ src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c	Mon Jan 11 16:45:22 2021
@@ -121,6 +121,8 @@ __RCSID("NetBSD: sys-bsd.c,v 1.68 2013/0
 #endif
 #include 
 
+#ifdef INET6
+
 #define s6_addr32 __u6_addr.__u6_addr32	/* Non-standard */
 
 #define IN6_SOCKADDR_FROM_EUI64(s, eui64) do { \
@@ -146,8 +148,10 @@ __RCSID("NetBSD: sys-bsd.c,v 1.68 2013/0
 	sin6.s6_addr16[0] = htons(0xfe80);			\
 	eui64_copy(eui64, sin6.s6_addr32[2]);			\
 } while (/*CONSTCOND*/0)
-#endif
-#endif
+#endif /* __KAME__ */
+#endif /* IN6_LLADDR_FROM_EUI64 */
+
+#endif /* INET6 */
 
 #if RTM_VERSION >= 3
 #include 
@@ -201,8 +205,9 @@ static int if6_is_up;		/* the interface 
 #endif /* INET6 */
 static u_int32_t ifaddrs[2];	/* local and remote addresses we set */
 static u_int32_t default_route_gateway;	/* gateway addr for default route */
-static eui64_t  default_route_gateway6; /* Gateway for default IPv6 route added
-*/ 
+#ifdef INET6
+static eui64_t  default_route_gateway6; /* Gateway for default IPv6 route added */
+#endif /* INET6 */
 static u_int32_t proxy_arp_addr;	/* remote addr for proxy arp */
 
 /* Prototypes for procedures local to this file. */
@@ -307,8 +312,10 @@ sys_cleanup(void)
 	cifaddr(0, ifaddrs[0], ifaddrs[1]);
 if (default_route_gateway)
 	cifdefaultroute(0, 0, default_route_gateway);
+#ifdef INET6
 if (default_route_gateway6.e32[0] != 0 || default_route_gateway6.e32[1] != 0)
 	cif6defaultroute(0, default_route_gateway6, default_route_gateway6);
+#endif
 if (proxy_arp_addr)
 	cifproxyarp(0, proxy_arp_addr);
 doing_cleanup = 0;
@@ -1659,6 +1666,7 @@ dodefaultroute(u_int32_t g, int cmd)
 }
 
 
+#ifdef INET6
 /*
  * dodefaultroute - assign/clear a default route through the address given.
  */
@@ -1725,6 +1733,8 @@ cif6defaultroute(int u, eui64_t l, eui64
 	return dodefaultroute6(u, l, g, 'c');
 }
 
+#endif
+
 #if RTM_VERSION >= 3
 
 /*



CVS commit: src/tests/lib/libc/stdlib

2021-01-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 11 20:31:34 UTC 2021

Modified Files:
src/tests/lib/libc/stdlib: t_mktemp.c

Log Message:
Only try to create up-to NAME_MAX filenames.
XXX: this should be moved to stdio/t_mktemp.c where the rest of the tests
are and the code lives.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdlib/t_mktemp.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/lib/libc/stdlib/t_mktemp.c
diff -u src/tests/lib/libc/stdlib/t_mktemp.c:1.3 src/tests/lib/libc/stdlib/t_mktemp.c:1.4
--- src/tests/lib/libc/stdlib/t_mktemp.c:1.3	Sun Nov  1 13:19:54 2020
+++ src/tests/lib/libc/stdlib/t_mktemp.c	Mon Jan 11 15:31:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mktemp.c,v 1.3 2020/11/01 18:19:54 gson Exp $ */
+/* $NetBSD: t_mktemp.c,v 1.4 2021/01/11 20:31:34 christos Exp $ */
 
 /*-
  * Copyright (c) 2013, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mktemp.c,v 1.3 2020/11/01 18:19:54 gson Exp $");
+__RCSID("$NetBSD: t_mktemp.c,v 1.4 2021/01/11 20:31:34 christos Exp $");
 
 #include 
 
@@ -79,10 +79,17 @@ ATF_TC_HEAD(mktemp_large_template, tc)
 ATF_TC_BODY(mktemp_large_template, tc)
 {
 	const char *path = "/tmp/mktemp.XX";
-	char template[PATH_MAX] = { 0 };
+	char *template;
 	size_t i;
+	long name_max;
+	size_t tlen;
 
-	atf_tc_expect_fail("PR lib/55441");
+	name_max = pathconf("/tmp/", _PC_NAME_MAX);
+	ATF_REQUIRE(name_max > 0);
+
+	tlen = (size_t)name_max + sizeof("/tmp/");
+	template = malloc(tlen);
+	ATF_REQUIRE(template != NULL);
 
 	ATF_REQUIRE(strcpy(template, path) != NULL);
 	ATF_REQUIRE(mktemp(template) != NULL);
@@ -90,16 +97,17 @@ ATF_TC_BODY(mktemp_large_template, tc)
 	ATF_REQUIRE(strcmp(template, path) != 0);
 	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
 
-	(void)memset(template, '\0', sizeof(template));
+	(void)memset(template, '\0', tlen);
 	(void)strcpy(template, "/tmp/mktemp.");
 
-	for (i = 12; i < sizeof(template) - 1; i++)
+	for (i = 12; i < tlen - 1; i++)
 		template[i] = 'X';
 
 	ATF_REQUIRE(mktemp(template) != NULL);
-	ATF_REQUIRE(strlen(template) == sizeof(template) - 1);
+	ATF_REQUIRE(strlen(template) == tlen - 1);
 	ATF_REQUIRE(strcmp(template, path) != 0);
 	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
+	free(template);
 }
 
 ATF_TC(mkstemp_basic);



CVS commit: src/usr.bin/telnet

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 18:26:03 UTC 2021

Modified Files:
src/usr.bin/telnet: commands.c

Log Message:
preserve errno because we are doing system calls between error printing
and error setting.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/telnet/commands.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/telnet/commands.c
diff -u src/usr.bin/telnet/commands.c:1.78 src/usr.bin/telnet/commands.c:1.79
--- src/usr.bin/telnet/commands.c:1.78	Sat Jan  9 13:22:42 2021
+++ src/usr.bin/telnet/commands.c	Sat Jan  9 13:26:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.78 2021/01/09 18:22:42 christos Exp $	*/
+/*	$NetBSD: commands.c,v 1.79 2021/01/09 18:26:03 christos Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)commands.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: commands.c,v 1.78 2021/01/09 18:22:42 christos Exp $");
+__RCSID("$NetBSD: commands.c,v 1.79 2021/01/09 18:26:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -2086,7 +2086,7 @@ tn(int argc, char *argv[])
 {
 struct addrinfo hints, *res, *res0;
 const char *cause = "telnet: unknown";
-int error;
+int error, serrno = 0;
 char *cmd, *hostp = 0;
 const char *portp = 0;
 const char *user = 0;
@@ -2193,6 +2193,7 @@ tn(int argc, char *argv[])
 	printf("Trying %s...\n", sockaddr_ntop(res->ai_addr));
 	net = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
 	if (net < 0) {
+	serrno = errno;
 	cause = "telnet: socket";
 	continue;
 	}
@@ -2203,11 +2204,13 @@ tn(int argc, char *argv[])
 
 #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
 	if (setpolicy(net, res, ipsec_policy_in) < 0) {
+	serrno = errno;
 	(void) NetClose(net);
 	net = -1;
 	continue;
 	}
 	if (setpolicy(net, res, ipsec_policy_out) < 0) {
+	serrno = errno;
 	(void) NetClose(net);
 	net = -1;
 	continue;
@@ -2218,6 +2221,7 @@ tn(int argc, char *argv[])
 	if (res->ai_next) {
 		warn("Connect to address %s: ", sockaddr_ntop(res->ai_addr));
 	}
+	serrno = errno;
 	cause = "Unable to connect to remote host";
 	(void) NetClose(net);
 	net = -1;
@@ -2232,7 +2236,7 @@ tn(int argc, char *argv[])
 }
 freeaddrinfo(res0);
 if (net < 0 || connected == 0) {
-	warn("%s", cause);
+	warnc(serrno, "%s", cause);
 	return 0;
 }
 



CVS commit: src/usr.bin/telnet

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 18:22:43 UTC 2021

Modified Files:
src/usr.bin/telnet: commands.c

Log Message:
restore perror -> warn (reported by Havard Eidnes)


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/telnet/commands.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/telnet/commands.c
diff -u src/usr.bin/telnet/commands.c:1.77 src/usr.bin/telnet/commands.c:1.78
--- src/usr.bin/telnet/commands.c:1.77	Fri Oct  4 07:39:44 2019
+++ src/usr.bin/telnet/commands.c	Sat Jan  9 13:22:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.77 2019/10/04 11:39:44 mrg Exp $	*/
+/*	$NetBSD: commands.c,v 1.78 2021/01/09 18:22:42 christos Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)commands.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: commands.c,v 1.77 2019/10/04 11:39:44 mrg Exp $");
+__RCSID("$NetBSD: commands.c,v 1.78 2021/01/09 18:22:42 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -2232,7 +2232,7 @@ tn(int argc, char *argv[])
 }
 freeaddrinfo(res0);
 if (net < 0 || connected == 0) {
-	warnx("%s", cause);
+	warn("%s", cause);
 	return 0;
 }
 



CVS commit: src/doc

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 16:44:35 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new pppd


To generate a diff of this commit:
cvs rdiff -u -r1.1772 -r1.1773 src/doc/3RDPARTY
cvs rdiff -u -r1.2774 -r1.2775 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.1772 src/doc/3RDPARTY:1.1773
--- src/doc/3RDPARTY:1.1772	Thu Dec 31 02:54:13 2020
+++ src/doc/3RDPARTY	Sat Jan  9 11:44:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1772 2020/12/31 07:54:13 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1773 2021/01/09 16:44:35 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1235,12 +1235,13 @@ Location:	external/ibm-public/postfix/di
 Notes:
 
 Package:	ppp
-Version:	2.4.7
-Current Vers:	2.4.7
+Version:	2.4.9
+Current Vers:	2.4.9
 Maintainer:	Paul Mackerras 
 Archive Site:
 Home Page:
-GIT root:	git://ozlabs.org/~paulus/ppp.git
+Date: 		2021-01-09
+GIT root:	https://github.com/paulusmack/ppp.git
 Mailing List:
 Responsible:	christos, cube
 License:	BSD (3-clause)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2774 src/doc/CHANGES:1.2775
--- src/doc/CHANGES:1.2774	Fri Jan  1 05:12:25 2021
+++ src/doc/CHANGES	Sat Jan  9 11:44:35 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2774 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2775 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -327,3 +327,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	dhcpcd: Update to version 9.4.0 [roy 20201228]
 	tzdata updated to 2020f (includes update to 2020e)  [kre 20201231] 
 	evbarm: Add support for Amlogic G12 family SoCs. [ryo 20210101]
+	pppd(8): updated to version 2.4.9. [christos 20210109]



CVS commit: src/external/bsd/ppp

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 16:41:09 UTC 2021

Modified Files:
src/external/bsd/ppp: ppp2netbsd

Log Message:
remove more


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ppp/ppp2netbsd

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/ppp/ppp2netbsd
diff -u src/external/bsd/ppp/ppp2netbsd:1.2 src/external/bsd/ppp/ppp2netbsd:1.3
--- src/external/bsd/ppp/ppp2netbsd:1.2	Sat Oct 25 15:06:33 2014
+++ src/external/bsd/ppp/ppp2netbsd	Sat Jan  9 11:41:09 2021
@@ -71,5 +71,10 @@ find . -type f -name '.gitignore' | whil
 	rm -f ${m}
 	echo -n "${m} "
 done
+echo -n "Removing .github... "
+find . -type f -name '.github' | while read m; do
+	rm -fr ${m}
+	echo -n "${m} "
+done
 echo; echo
 cleantags .



CVS commit: src/external/bsd/ppp/dist/.github/workflows

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 16:40:01 UTC 2021

Removed Files:
src/external/bsd/ppp/dist/.github/workflows: buildroot.yaml
solaris.yaml

Log Message:
remove useless files


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/ppp/dist/.github/workflows/buildroot.yaml \
src/external/bsd/ppp/dist/.github/workflows/solaris.yaml

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



CVS import: src/external/bsd/ppp/dist

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 16:37:37 UTC 2021

Update of /cvsroot/src/external/bsd/ppp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv2064

Log Message:
What's new in ppp-2.4.9.


* Support for new EAP (Extensible Authentication Protocol) methods:
  - Support for EAP-TLS, from Jan Just Keijser and others
  - Support for EAP-MSCHAPv2, from Eivind Næss, Thomas Omerzu, Tijs
Van Buggenhout and others

* New pppd options:
  - chap-timeout
  - chapms-strip-domain
  - replacedefaultroute
  - noreplacedefaultroute
  - ipv6cp-accept-remote
  - lcp-echo-adaptive
  - ip-up-script
  - ip-down-script
  - ca
  - capath
  - cert
  - key
  - crl-dir
  - crl
  - max-tls-version
  - need-peer-eap

* Fixes for CVE-2020-8597 and CVE-2015-3310.

* libpcap is now required when compiling on Linux (previously, if
  libpcap was not present, pppd would be compiled without packet
  filtering support).

* The rp-pppoe plugin has been renamed to pppoe, to distinguish it
  from the upstream rp-pppoe code.  Its options have changed names,
  but the old names are kept as aliases.

* The configure script now supports cross-compilation.

* Many bug fixes and cleanups.
  

What was new in ppp-2.4.8.
**

* New pppd options have been added:
  - ifname, to set the name for the PPP interface device
  - defaultroute-metric, to set the metric for the default route
  - defaultroute6, to add an IPv6 default route (with nodefaultroute6
to prevent adding an IPv6 default route)
  - up_sdnotify, to have pppd notify systemd when the link is up.

* The rp-pppoe plugin has new options:
  - host-uniq, to set the Host-Uniq value to send
  - pppoe-padi-timeout, to set the timeout for discovery packets
  - pppoe-padi-attempts, to set the number of discovery attempts.

* Added the CLASS attribute in radius packets.

* Sundry bug fixes.

* Fixed warnings and issues found by static analysis.

* Added Submitting-patches.md.


What was new in ppp-2.4.7.
**

* Fixed a potential security issue in parsing option files (CVE-2014-3158).

* There is a new "stop-bits" option, which takes an argument of 1 or 2,
  indicating the number of stop bits to use for async serial ports.

* Various bug fixes.


What was new in ppp-2.4.6.
**

* Man page updates.

* Several bug fixes.

* Options files can now set and unset environment variables for
  scripts.

* The timeout for chat scripts can now be taken from an environment
  variable.

* There is a new option, master_detach, which allows pppd to detach
  from the controlling terminal when it is the multilink bundle master
  but its own link has terminated, even if the nodetach option has
  been given.



Status:

Vendor Tag: MACKERRAS
Release Tags:   ppp-2-4-9

U src/external/bsd/ppp/dist/PLUGINS
U src/external/bsd/ppp/dist/FAQ
U src/external/bsd/ppp/dist/README
U src/external/bsd/ppp/dist/README.MPPE
U src/external/bsd/ppp/dist/README.MSCHAP80
U src/external/bsd/ppp/dist/README.MSCHAP81
U src/external/bsd/ppp/dist/README.cbcp
U src/external/bsd/ppp/dist/README.eap-srp
N src/external/bsd/ppp/dist/README.eap-tls
U src/external/bsd/ppp/dist/README.pppol2tp
U src/external/bsd/ppp/dist/README.pwfd
U src/external/bsd/ppp/dist/SETUP
N src/external/bsd/ppp/dist/Submitting-patches.md
N src/external/bsd/ppp/dist/.github/workflows/buildroot.yaml
N src/external/bsd/ppp/dist/.github/workflows/solaris.yaml
U src/external/bsd/ppp/dist/chat/chat.8
C src/external/bsd/ppp/dist/chat/chat.c
C src/external/bsd/ppp/dist/pppd/auth.c
C src/external/bsd/ppp/dist/pppd/ccp.c
C src/external/bsd/ppp/dist/pppd/ccp.h
U src/external/bsd/ppp/dist/pppd/chap-md5.c
C src/external/bsd/ppp/dist/pppd/eap.h
C src/external/bsd/ppp/dist/pppd/cbcp.c
U src/external/bsd/ppp/dist/pppd/cbcp.h
C src/external/bsd/ppp/dist/pppd/chap-new.c
C src/external/bsd/ppp/dist/pppd/chap_ms.c
U src/external/bsd/ppp/dist/pppd/chap-md5.h
C src/external/bsd/ppp/dist/pppd/chap_ms.h
C src/external/bsd/ppp/dist/pppd/chap-new.h
C src/external/bsd/ppp/dist/pppd/demand.c
U src/external/bsd/ppp/dist/pppd/ecp.h
C src/external/bsd/ppp/dist/pppd/fsm.h
N src/external/bsd/ppp/dist/pppd/eap-tls.c
N src/external/bsd/ppp/dist/pppd/eap-tls.h
C src/external/bsd/ppp/dist/pppd/eap.c
C src/external/bsd/ppp/dist/pppd/pppd.8
C src/external/bsd/ppp/dist/pppd/ecp.c
C src/external/bsd/ppp/dist/pppd/pppd.h
C src/external/bsd/ppp/dist/pppd/eui64.c
C src/external/bsd/ppp/dist/pppd/eui64.h
C src/external/bsd/ppp/dist/pppd/fsm.c
C src/external/bsd/ppp/dist/pppd/ipcp.c
C src/external/bsd/ppp/dist/pppd/ipcp.h
C src/external/bsd/ppp/dist/pppd/ipv6cp.c
C src/external/bsd/ppp/dist/pppd/ipv6cp.h
C src/external/bsd/ppp/dist/pppd/ipxcp.c
C src/external/bsd/ppp/dist/pppd/ipxcp.h
C src/external/bsd/ppp/dist/pppd/lcp.c
C src/external/bsd/ppp/dist/pppd/lcp.h
C src/external/bsd/ppp/dist/pppd/magic.c
C src/external/bsd/ppp/dist/pppd/magic.h
C src/external/bsd/ppp/dist

CVS commit: src/usr.bin/cmp

2021-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  9 15:16:28 UTC 2021

Modified Files:
src/usr.bin/cmp: regular.c

Log Message:
PR/55916: William Ahern: cmp -s + regular files + skipping is broken
Move test after length is adjusted


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/cmp/regular.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/cmp/regular.c
diff -u src/usr.bin/cmp/regular.c:1.24 src/usr.bin/cmp/regular.c:1.25
--- src/usr.bin/cmp/regular.c:1.24	Wed Nov 20 12:19:14 2013
+++ src/usr.bin/cmp/regular.c	Sat Jan  9 10:16:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regular.c,v 1.24 2013/11/20 17:19:14 kleink Exp $	*/
+/*	$NetBSD: regular.c,v 1.25 2021/01/09 15:16:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)regular.c	8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: regular.c,v 1.24 2013/11/20 17:19:14 kleink Exp $");
+__RCSID("$NetBSD: regular.c,v 1.25 2021/01/09 15:16:28 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -59,9 +59,6 @@ c_regular(int fd1, const char *file1, of
 	int dfound;
 	size_t blk_sz, blk_cnt;
 
-	if (sflag && len1 != len2)
-		exit(1);
-
 	if (skip1 > len1)
 		eofmsg(file1, len1 + 1, 0);
 	len1 -= skip1;
@@ -69,6 +66,9 @@ c_regular(int fd1, const char *file1, of
 		eofmsg(file2, len2 + 1, 0);
 	len2 -= skip2;
 
+	if (sflag && len1 != len2)
+		exit(DIFF_EXIT);
+
 	byte = line = 1;
 	dfound = 0;
 	length = MIN(len1, len2);



CVS commit: src/games/testpat

2021-01-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  8 15:16:04 UTC 2021

Modified Files:
src/games/testpat: testpat.c

Log Message:
- Don't allocate memory dynamically on the stack (for SSP)
- Don't return errno as exit code
- Fold long lines


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/games/testpat/testpat.c

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

Modified files:

Index: src/games/testpat/testpat.c
diff -u src/games/testpat/testpat.c:1.3 src/games/testpat/testpat.c:1.4
--- src/games/testpat/testpat.c:1.3	Sat Jan  2 07:12:26 2021
+++ src/games/testpat/testpat.c	Fri Jan  8 10:16:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: testpat.c,v 1.3 2021/01/02 12:12:26 jmcneill Exp $ */
+/* $NetBSD: testpat.c,v 1.4 2021/01/08 15:16:04 christos Exp $ */
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -25,6 +25,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#include 
+__RCSID("$NetBSD: testpat.c,v 1.4 2021/01/08 15:16:04 christos Exp $");
+
+#include 
+#include 
 
 #include 
 #include 
@@ -34,69 +39,66 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+
+static int colour_list[6] = {
+	COLOR_YELLOW,
+	COLOR_CYAN,
+	COLOR_GREEN,
+	COLOR_MAGENTA,
+	COLOR_RED,
+	COLOR_BLUE,
+};
+static int numcolours = (int)__arraycount(colour_list);
 
 int main(int argc, char *argv[]) {
 	int i, col, colour, line, x_limit, y_limit, colourOK, spacing;
 	int xpos, ypos, spacing_residual, spacing_start, spacing_end;
-	int grid_x, grid_y;
+	int grid_x, grid_y, **circle_pos;
+	size_t ncpos;
 	float grid_unit;
-
-	char title[255] = "NetBSD";
-	int numcolours = 6;
-
-	int colour_list[6] = {
-		COLOR_YELLOW,
-		COLOR_CYAN,
-		COLOR_GREEN,
-		COLOR_MAGENTA,
-		COLOR_RED,
-		COLOR_BLUE,
-	};
-
+	const char *title = "NetBSD";
 	float coord_x, circle_int;
 	float a_axis, b_axis;
 
-	if (!(initscr())) {
-		printf("\nUnknown terminal type.");
-		printf("\n");
-		return EXIT_FAILURE;
+	if (!initscr()) {
+		errx(EXIT_FAILURE, "Unknown terminal type");
 	}
+
 	curs_set(0);
 
 	if (argc > 2) {
 		endwin();
-		errx(EINVAL, "usage: testpat [title]");
+		fprintf(stderr, "Usage: %s ", getprogname());
+		return EXIT_FAILURE;
 	}
 
-	if (argc == 2 && strlen(argv[1]) < (size_t)COLS)
-		snprintf(title, sizeof(title), "%s", argv[1]);
-	else if (argc == 2 && (int)strlen(argv[1]) > COLS) {
-		endwin();
-		errx(EINVAL, "title string must be less than display columns");
+	if (argc == 2) {
+		title = argv[1];
+		if (strlen(title) >= (size_t)COLS) {
+			endwin();
+			errx(EXIT_FAILURE,
+			"Title string is longer than display cols");
+		}
 	}
 
 	colourOK = has_colors();
 
 	if (COLS < 13 || LINES < 13) {
 		endwin();
-		printf("\nTerminal size must be at least 72x25.");
-		printf("\n");
-		return EXIT_FAILURE;
+		errx(EXIT_FAILURE, "Terminal size must be at least 72x25.");
 	}
 
 	if (colourOK) {
 		start_color();
 
-		init_pair( 0, COLOR_WHITE, COLOR_BLACK );
-		init_pair( 1, COLOR_WHITE, COLOR_RED );
-		init_pair( 2, COLOR_WHITE, COLOR_GREEN );
-		init_pair( 3, COLOR_WHITE, COLOR_YELLOW );
-		init_pair( 4, COLOR_WHITE, COLOR_BLUE );
-		init_pair( 5, COLOR_WHITE, COLOR_MAGENTA );
-		init_pair( 6, COLOR_WHITE, COLOR_CYAN );
-		init_pair( 7, COLOR_BLACK, COLOR_WHITE );
+		init_pair(0, COLOR_WHITE, COLOR_BLACK);
+		init_pair(1, COLOR_WHITE, COLOR_RED);
+		init_pair(2, COLOR_WHITE, COLOR_GREEN);
+		init_pair(3, COLOR_WHITE, COLOR_YELLOW);
+		init_pair(4, COLOR_WHITE, COLOR_BLUE);
+		init_pair(5, COLOR_WHITE, COLOR_MAGENTA);
+		init_pair(6, COLOR_WHITE, COLOR_CYAN);
+		init_pair(7, COLOR_BLACK, COLOR_WHITE);
 
 		attrset(COLOR_PAIR(0));
 	}
@@ -113,11 +115,21 @@ int main(int argc, char *argv[]) {
 	grid_y = grid_unit;
 	grid_x = grid_unit * 2;
 
-	int circle_pos[y_limit][2];
-	memset(circle_pos, -1, sizeof(circle_pos));
+	
+	ncpos = y_limit * sizeof(*circle_pos)
+	+ y_limit * 2 * sizeof(**circle_pos);
+	circle_pos = malloc(ncpos);
+	if (circle_pos == NULL) {
+		endwin();
+		errx(EXIT_FAILURE, "Can't allocate circle positions");
+	}
+	for (i = 0; i < y_limit; i++) {
+	circle_pos[i] = (void *)&circle_pos[y_limit + i * 2];
+	circle_pos[i][0] = circle_pos[i][1] = -1;
+	}
 
 	for (i = 0; i < y_limit; i++) {
-		/* Draw an elipse (looks more circular.) */
+		/* Draw an ellipse (looks more circular.) */
 		circle_int = (i - a_axis) / a_axis;
 		circle_int = 1 - powf(circle_int, 2);
 		circle_int = circle_int * powf(b_axis, 2);
@@ -200,8 +212,8 @@ int main(int argc, char *argv[]) {
 			attrset(COLOR_PAIR(COLOR_BLACK));
 
 		for (col = roundf((4 * grid_unit * 2) +
-		circle_pos[y_limit /2][0]); col <= roundf((9 * grid_unit
-		* 2) + circle_pos[y_limit /2][0]); col++)
+		circle_pos[y_limit / 2][0]); col <= roundf((9 * grid_unit
+		* 2) + circle_pos[y_limit / 2][0]); col++)
 			mvaddch(i, col

CVS commit: src/sys

2020-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 19:49:05 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_intr.c
src/sys/arch/riscv/include: sysreg.h
src/sys/dev/i2c: tcakp.c
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_uvd_v4_2.c
amdgpu_uvd_v5_0.c amdgpu_uvd_v6_0.c
src/sys/external/bsd/drm2/dist/drm/i915: intel_pm.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_uvd_v1_0.c
src/sys/external/bsd/drm2/dist/drm/vmwgfx: vmwgfx_drv.h
src/sys/external/isc/atheros_hal/dist: ah.h

Log Message:
interupt -> interrupt


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/i2c/tcakp.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v4_2.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v5_0.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v6_0.c
cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/vmwgfx/vmwgfx_drv.h
cvs rdiff -u -r1.4 -r1.5 src/sys/external/isc/atheros_hal/dist/ah.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/arch/arm/broadcom/bcm2835_intr.c
diff -u src/sys/arch/arm/broadcom/bcm2835_intr.c:1.32 src/sys/arch/arm/broadcom/bcm2835_intr.c:1.33
--- src/sys/arch/arm/broadcom/bcm2835_intr.c:1.32	Sat Feb 15 03:16:11 2020
+++ src/sys/arch/arm/broadcom/bcm2835_intr.c	Wed Dec 16 14:49:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_intr.c,v 1.32 2020/02/15 08:16:11 skrll Exp $	*/
+/*	$NetBSD: bcm2835_intr.c,v 1.33 2020/12/16 19:49:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2015, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.32 2020/02/15 08:16:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.33 2020/12/16 19:49:04 christos Exp $");
 
 #define _INTR_PRIVATE
 
@@ -891,8 +891,8 @@ bcm2836mp_icu_fdt_establish(device_t dev
 	bip->bi_arg = arg;
 
 	/*
-	 * If we're not cold and the BPs have been started then we can register the
-	 * interupt for all CPUs now, e.g. PMU
+	 * If we're not cold and the BPs have been started then we can
+	 * register the interrupt for all CPUs now, e.g. PMU
 	 */
 	if (!cold) {
 		for (cpuid_t cpuid = 0; cpuid < BCM2836_NCPUS; cpuid++) {

Index: src/sys/arch/riscv/include/sysreg.h
diff -u src/sys/arch/riscv/include/sysreg.h:1.10 src/sys/arch/riscv/include/sysreg.h:1.11
--- src/sys/arch/riscv/include/sysreg.h:1.10	Wed Nov  4 15:05:47 2020
+++ src/sys/arch/riscv/include/sysreg.h	Wed Dec 16 14:49:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sysreg.h,v 1.10 2020/11/04 20:05:47 skrll Exp $ */
+/* $NetBSD: sysreg.h,v 1.11 2020/12/16 19:49:04 christos Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -141,7 +141,7 @@ riscvreg_fcsr_write_frm(uint32_t __new)
 #define SR_UIE		__BIT(0)
 
 /* Supervisor interrupt registers */
-/* ... interupt pending register (sip) */
+/* ... interrupt pending register (sip) */
 			/* Bit (XLEN-1)-10 is WIRI */
 #define SIP_SEIP	__BIT(9)
 #define SIP_UEIP	__BIT(8)
@@ -152,7 +152,7 @@ riscvreg_fcsr_write_frm(uint32_t __new)
 #define SIP_SSIP	__BIT(1)
 #define SIP_USIP	__BIT(0)
 
-/* ... interupt-enable register (sie) */
+/* ... interrupt-enable register (sie) */
 			/* Bit (XLEN-1) - 10 is WIRI */
 #define SIE_SEIE	__BIT(9)
 #define SIE_UEIE	__BIT(8)

Index: src/sys/dev/i2c/tcakp.c
diff -u src/sys/dev/i2c/tcakp.c:1.11 src/sys/dev/i2c/tcakp.c:1.12
--- src/sys/dev/i2c/tcakp.c:1.11	Mon Dec 23 15:38:08 2019
+++ src/sys/dev/i2c/tcakp.c	Wed Dec 16 14:49:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tcakp.c,v 1.11 2019/12/23 20:38:08 thorpej Exp $ */
+/* $NetBSD: tcakp.c,v 1.12 2020/12/16 19:49:04 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.11 2019/12/23 20:38:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.12 2020/12/16 19:49:04 christos Exp $");
 
 #include 
 #include 
@@ -400,7 +400,7 @@ tcakp_attach(device_t parent, device_t s
 	sc->sc_sih = softint_establish(SOFTINT_SERIAL, tcakp_softintr, sc);
 	if (sc->sc_sih == NULL) {
 		aprint_error_dev(sc->sc_dev,
-		"unable to establish soft interupt\n");
+		"unable to establish soft interrupt\n");
 		return;
 	}
 

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v4_2.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v4_2.c:1.3 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd_v4_2.c:1.4
--- src/sys/external/bsd/drm2/dist/

CVS commit: src/usr.bin/make

2020-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 13 18:12:29 UTC 2020

Modified Files:
src/usr.bin/make: compat.c

Log Message:
fix comment


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/usr.bin/make/compat.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/make/compat.c
diff -u src/usr.bin/make/compat.c:1.212 src/usr.bin/make/compat.c:1.213
--- src/usr.bin/make/compat.c:1.212	Sun Dec 13 11:47:19 2020
+++ src/usr.bin/make/compat.c	Sun Dec 13 13:12:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.212 2020/12/13 16:47:19 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.213 2020/12/13 18:12:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.212 2020/12/13 16:47:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.213 2020/12/13 18:12:29 christos Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -532,7 +532,7 @@ MakeUnmade(GNode *gn, GNode *pgn)
 
 	/*
 	 * Alter our type to tell if errors should be ignored or things
-	 * should not be printed so CompatRunCommand knows what to do.
+	 * should not be printed so Compat_RunCommand knows what to do.
 	 */
 	if (opts.ignoreErrors)
 		gn->type |= OP_IGNORE;



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 13 16:50:47 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
Improve previous: generated names end with .[[:digits:]] so look for that
instead.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/c-exp.y

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/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.3
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2	Fri Dec 11 13:25:45 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Sun Dec 13 11:50:47 2020
@@ -2608,7 +2608,63 @@ static bool last_was_structop;
 /* Depth of parentheses.  */
 static int paren_depth;
 
-static const char PART[] = ".part.";
+static int
+get_namelen (const char *tokstart, bool dot)
+{
+  int c;
+  int namelen;
+
+  for (c = tokstart[namelen];
+   (c == '_' || c == '$' || (dot && c == '.') || c_ident_is_alnum (c) || c == '<');)
+{
+  /* Template parameter lists are part of the name.
+	 FIXME: This mishandles `print $a<4&&$a>3'.  */
+
+  if (c == '<')
+	{
+	  if (! is_cast_operator (tokstart, namelen))
+	{
+	  /* Scan ahead to get rest of the template specification.  Note
+		 that we look ahead only when the '<' adjoins non-whitespace
+		 characters; for comparison expressions, e.g. "a < b > c",
+		 there must be spaces before the '<', etc. */
+	  const char *p = find_template_name_end (tokstart + namelen);
+
+	  if (p)
+		namelen = p - tokstart;
+	}
+	  break;
+	}
+  c = tokstart[++namelen];
+}
+  return namelen;
+}
+
+static bool is_generated_symbol (const char *symbol)
+{
+  /* generated symbol are of the form:
+
+ .
+ .isra.
+ .part.
+
+So we see if the symbol ends with .
+   */
+
+  int len = get_namelen (symbol, true);
+  int ndigits;
+
+  if (len-- == 0)
+return false;
+
+  for (ndigits = 0; ndigits <= len && ISDIGIT(symbol[len - ndigits]); ndigits++)
+continue;
+
+  if (ndigits == 0)
+return false;
+
+  return symbol[len - ndigits] == '.';
+}
 
 /* Read one token, getting characters through lexptr.  */
 
@@ -2725,13 +2781,6 @@ lex_one_token (struct parser_state *par_
   return c;
 
 case '.':
-  /* Gross! recognize .part.N */
-  if (strncmp(pstate->lexptr, PART, sizeof(PART) - 1) == 0 &&
-	ISDIGIT(pstate->lexptr[sizeof(PART) - 1]) &&
-	pstate->lexptr[sizeof(PART)] == '\0')
-	{
-	  break;
-	}
   /* Might be a floating point number.  */
   if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
 	{
@@ -2895,30 +2944,7 @@ lex_one_token (struct parser_state *par_
 error (_("Invalid character '%c' in expression."), c);
 
   /* It's a name.  See how long it is.  */
-  namelen = 0;
-  for (c = tokstart[namelen];
-   (c == '_' || c == '$' || c == '.' || c_ident_is_alnum (c) || c == '<');)
-{
-  /* Template parameter lists are part of the name.
-	 FIXME: This mishandles `print $a<4&&$a>3'.  */
-
-  if (c == '<')
-	{
-	  if (! is_cast_operator (tokstart, namelen))
-	{
-	  /* Scan ahead to get rest of the template specification.  Note
-		 that we look ahead only when the '<' adjoins non-whitespace
-		 characters; for comparison expressions, e.g. "a < b > c",
-		 there must be spaces before the '<', etc. */
-	  const char *p = find_template_name_end (tokstart + namelen);
-
-	  if (p)
-		namelen = p - tokstart;
-	}
-	  break;
-	}
-  c = tokstart[++namelen];
-}
+  namelen = get_namelen (tokstart, is_generated_symbol (tokstart));
 
   /* The token "if" terminates the expression and is NOT removed from
  the input stream.  It doesn't count if it appears in the



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

2020-12-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 12 18:45:12 UTC 2020

Modified Files:
src/external/bsd/libfido2/lib: Makefile

Log Message:
Use the NetBSD-specific back-end.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/lib/Makefile

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/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.2 src/external/bsd/libfido2/lib/Makefile:1.3
--- src/external/bsd/libfido2/lib/Makefile:1.2	Fri Dec  4 13:27:44 2020
+++ src/external/bsd/libfido2/lib/Makefile	Sat Dec 12 13:45:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2020/12/04 18:27:44 christos Exp $
+# $NetBSD: Makefile,v 1.3 2020/12/12 18:45:11 christos Exp $
 
 NOLINT=
 .include 
@@ -31,7 +31,7 @@ eddsa.c \
 err.c \
 es256.c \
 hid.c \
-hid_openbsd.c \
+hid_netbsd.c \
 info.c \
 io.c \
 iso7816.c \



CVS commit: src/external/bsd/libfido2/dist/src

2020-12-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 12 18:44:38 UTC 2020

Added Files:
src/external/bsd/libfido2/dist/src: hid_netbsd.c

Log Message:
Add a NetBSD-specific back-end. (riastradh@)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/libfido2/dist/src/hid_netbsd.c

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

Added files:

Index: src/external/bsd/libfido2/dist/src/hid_netbsd.c
diff -u /dev/null src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.1
--- /dev/null	Sat Dec 12 13:44:38 2020
+++ src/external/bsd/libfido2/dist/src/hid_netbsd.c	Sat Dec 12 13:44:38 2020
@@ -0,0 +1,423 @@
+/*
+ * Copyright (c) 2020 Yubico AB. All rights reserved.
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "fido.h"
+
+#define MAX_UHID	64
+
+struct hid_netbsd {
+	int	fd;
+	size_t	report_in_len;
+	size_t	report_out_len;
+};
+
+/* Hack to make this work with newer kernels even if /usr/include is old.  */
+#if __NetBSD_Version__ < 90100	/* 9.1 */
+#define	USB_HID_GET_RAW	_IOR('h', 1, int)
+#define	USB_HID_SET_RAW	_IOW('h', 2, int)
+#endif
+
+static bool
+is_fido(int fd)
+{
+	report_desc_t			rdesc;
+	hid_data_t			hdata;
+	hid_item_t			hitem;
+	boolisfido;
+	intraw = 1;
+
+	if ((rdesc = hid_get_report_desc(fd)) == NULL) {
+		fido_log_debug("%s: failed to get report descriptor",
+		__func__);
+		return (false);
+	}
+	if ((hdata = hid_start_parse(rdesc, 1 << hid_collection, -1))
+	== NULL) {
+		fido_log_debug("%s: failed to parse report descriptor",
+		__func__);
+		hid_dispose_report_desc(rdesc);
+		return (false);
+	}
+	isfido = false;
+	while ((hid_get_item(hdata, &hitem)) > 0) {
+		if (HID_PAGE(hitem.usage) == 0xf1d0) {
+			isfido = true;
+			break;
+		}
+	}
+	hid_end_parse(hdata);
+	hid_dispose_report_desc(rdesc);
+	if (!isfido)
+		return (false);
+
+/*
+	 * This step is not strictly necessary -- NetBSD puts fido
+ * devices into raw mode automatically by default, but in
+ * principle that might change, and this serves as a test to
+ * verify that we're running on a kernel with support for raw
+ * mode at all so we don't get confused issuing writes that try
+ * to set the report descriptor rather than transfer data on
+ * the output interrupt pipe as we need.
+	 */
+	if (ioctl(fd, USB_HID_SET_RAW, &raw) == -1) {
+		fido_log_debug("%s: unable to set raw", __func__);
+		return (false);
+	}
+
+	return (true);
+}
+
+static int
+copy_info(fido_dev_info_t *di, const char *path)
+{
+	int			fd = -1;
+	int			ok = -1;
+	struct usb_device_info	udi;
+
+	memset(di, 0, sizeof(*di));
+	memset(&udi, 0, sizeof(udi));
+
+	if ((fd = open(path, O_RDWR)) == -1) {
+		if (errno != EBUSY && errno != ENOENT)
+			fido_log_debug("%s: open %s: %s", __func__, path,
+			strerror(errno));
+		goto fail;
+	}
+	if (!is_fido(fd))
+		goto fail;
+
+	if (ioctl(fd, USB_GET_DEVICEINFO, &udi) == -1)
+		goto fail;
+
+	if ((di->path = strdup(path)) == NULL ||
+	(di->manufacturer = strdup(udi.udi_vendor)) == NULL ||
+	(di->product = strdup(udi.udi_product)) == NULL)
+		goto fail;
+
+	di->vendor_id = (int16_t)udi.udi_vendorNo;
+	di->product_id = (int16_t)udi.udi_productNo;
+
+	ok = 0;
+fail:
+	if (fd != -1)
+		close(fd);
+
+	if (ok < 0) {
+		free(di->path);
+		free(di->manufacturer);
+		free(di->product);
+		explicit_bzero(di, sizeof(*di));
+	}
+
+	return (ok);
+}
+
+int
+fido_hid_manifest(fido_dev_info_t *devlist, size_t ilen, size_t *olen)
+{
+	char	path[64];
+	size_t	i;
+
+	*olen = 0;
+
+	if (ilen == 0)
+		return (FIDO_OK); /* nothing to do */
+
+	if (devlist == NULL || olen == NULL)
+		return (FIDO_ERR_INVALID_ARGUMENT);
+
+	for (i = *olen = 0; i < MAX_UHID && *olen < ilen; i++) {
+		snprintf(path, sizeof(path), "/dev/uhid%zu", i);
+		if (copy_info(&devlist[*olen], path) == 0) {
+			devlist[*olen].io = (fido_dev_io_t) {
+fido_hid_open,
+fido_hid_close,
+fido_hid_read,
+fido_hid_write,
+			};
+			++(*olen);
+		}
+	}
+
+	return (FIDO_OK);
+}
+
+/*
+ * Workaround for NetBSD (as of 201910) bug that loses
+ * sync of DATA0/DATA1 sequence bit across uhid open/close.
+ * Send pings until we get a response - early pings with incorrect
+ * sequence bits will be ignored as duplicate packets by the device.
+ */
+static int
+terrible_ping_kludge(struct hid_netbsd *ctx)
+{
+	u_char data[256];
+	int i, n;
+	struct pollfd pfd;
+
+	if (sizeof(data) < ctx->report_out_len + 1)
+		return -1;
+	for (i = 0; i < 4; i++) {
+		memset(data, 0, sizeof(data));
+		/* broadcast channel ID */
+		data[1] = 0xff;
+		data[2] = 0xff;
+		data[3] = 0xff;
+		data[4] = 0xff;
+		/* Ping command */
+		data[5] = 0x81;
+		/* One byte ping only, Vasili */
+		data

CVS commit: src/sys/kern

2020-12-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 12 18:41:13 UTC 2020

Modified Files:
src/sys/kern: vfs_cache.c

Log Message:
Be more clear and don't rely on cur being the first member.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/kern/vfs_cache.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/kern/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.148 src/sys/kern/vfs_cache.c:1.149
--- src/sys/kern/vfs_cache.c:1.148	Sat Dec 12 13:35:59 2020
+++ src/sys/kern/vfs_cache.c	Sat Dec 12 13:41:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.148 2020/12/12 18:35:59 uwe Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.149 2020/12/12 18:41:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -172,7 +172,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.148 2020/12/12 18:35:59 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.149 2020/12/12 18:41:13 christos Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -244,7 +244,8 @@ static kmutex_t cache_stat_lock __cachel
 #define	COUNT(f) do { \
 	lwp_t *l = curlwp; \
 	KPREEMPT_DISABLE(l); \
-	((struct nchstats_percpu *)curcpu()->ci_data.cpu_nch)->f++; \
+	struct nchcpu *nchcpu = curcpu()->ci_data.cpu_nch; \
+	nchcpu->cur.f++; \
 	KPREEMPT_ENABLE(l); \
 } while (/* CONSTCOND */ 0);
 



CVS commit: src/external/bsd/pkg_install/dist/lib

2020-12-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 12 18:19:34 UTC 2020

Modified Files:
src/external/bsd/pkg_install/dist/lib: plist.c

Log Message:
Don't try to memcpy (size_t)-1 bytes!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/lib/plist.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/bsd/pkg_install/dist/lib/plist.c
diff -u src/external/bsd/pkg_install/dist/lib/plist.c:1.4 src/external/bsd/pkg_install/dist/lib/plist.c:1.5
--- src/external/bsd/pkg_install/dist/lib/plist.c:1.4	Wed Dec  2 08:53:50 2020
+++ src/external/bsd/pkg_install/dist/lib/plist.c	Sat Dec 12 13:19:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: plist.c,v 1.4 2020/12/02 13:53:50 wiz Exp $	*/
+/*	$NetBSD: plist.c,v 1.5 2020/12/12 18:19:34 christos Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: plist.c,v 1.4 2020/12/02 13:53:50 wiz Exp $");
+__RCSID("$NetBSD: plist.c,v 1.5 2020/12/12 18:19:34 christos Exp $");
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -637,15 +637,16 @@ delete_package(Boolean ign_err, package_
 	fail = FAIL;
 	goto pkgdb_cleanup;
 }
-			}
-			memcpy(&buf[SymlinkHeaderLen], tmp2, cc);
-			buf[SymlinkHeaderLen + cc] = 0x0;
-			if (strcmp(buf, p->next->name) != 0) {
-printf("symlink %s is not same as recorded value, %s: %s\n",
-buf, Force ? "deleting anyway" : "not deleting", tmp);
-if (!Force) {
-	fail = FAIL;
-	goto pkgdb_cleanup;
+			} else {
+memcpy(&buf[SymlinkHeaderLen], tmp2, cc);
+buf[SymlinkHeaderLen + cc] = 0x0;
+if (strcmp(buf, p->next->name) != 0) {
+	printf("symlink %s is not same as recorded value, %s: %s\n",
+	buf, Force ? "deleting anyway" : "not deleting", tmp);
+	if (!Force) {
+		fail = FAIL;
+		goto pkgdb_cleanup;
+	}
 }
 			}
 		}



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 11 18:25:45 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
PR/55851: Martin Husemann: recognize .part. names
This is gross; perhaps we should hide them completely (not print them
in stack traces etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/c-exp.y

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/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9	Mon Sep 14 21:43:28 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Fri Dec 11 13:25:45 2020
@@ -2608,6 +2608,8 @@ static bool last_was_structop;
 /* Depth of parentheses.  */
 static int paren_depth;
 
+static const char PART[] = ".part.";
+
 /* Read one token, getting characters through lexptr.  */
 
 static int
@@ -2723,6 +2725,13 @@ lex_one_token (struct parser_state *par_
   return c;
 
 case '.':
+  /* Gross! recognize .part.N */
+  if (strncmp(pstate->lexptr, PART, sizeof(PART) - 1) == 0 &&
+	ISDIGIT(pstate->lexptr[sizeof(PART) - 1]) &&
+	pstate->lexptr[sizeof(PART)] == '\0')
+	{
+	  break;
+	}
   /* Might be a floating point number.  */
   if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
 	{
@@ -2888,7 +2897,7 @@ lex_one_token (struct parser_state *par_
   /* It's a name.  See how long it is.  */
   namelen = 0;
   for (c = tokstart[namelen];
-   (c == '_' || c == '$' || c_ident_is_alnum (c) || c == '<');)
+   (c == '_' || c == '$' || c == '.' || c_ident_is_alnum (c) || c == '<');)
 {
   /* Template parameter lists are part of the name.
 	 FIXME: This mishandles `print $a<4&&$a>3'.  */



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 11 18:23:25 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: Makefile.in aarch64-nbsd-tdep.c

Log Message:
fix aarch64 crossgdb


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/Makefile.in
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.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/gdb/dist/gdb/Makefile.in
diff -u src/external/gpl3/gdb/dist/gdb/Makefile.in:1.4 src/external/gpl3/gdb/dist/gdb/Makefile.in:1.5
--- src/external/gpl3/gdb/dist/gdb/Makefile.in:1.4	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/Makefile.in	Fri Dec 11 13:23:25 2020
@@ -667,6 +667,7 @@ TARGET_OBS = @TARGET_OBS@
 ALL_64_TARGET_OBS = \
 	aarch64-fbsd-tdep.o \
 	aarch64-linux-tdep.o \
+	aarch64-nbsd-tdep.o \
 	aarch64-newlib-tdep.o \
 	aarch64-ravenscar-thread.o \
 	aarch64-tdep.o \

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.6	Sat Jul 13 17:55:52 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Dec 11 13:23:25 2020
@@ -194,6 +194,7 @@ aarch64_nbsd_init_abi (struct gdbarch_in
 (gdbarch, aarch64_nbsd_iterate_over_regset_sections);
 }
 
+void _initialize_aarch64_nbsd_tdep (void);
 void
 _initialize_aarch64_nbsd_tdep (void)
 {



<    1   2   3   4   5   6   7   8   9   10   >