CVS commit: src/usr.bin/make/unit-tests

2021-06-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 17 15:25:34 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: deptgt-order.exp deptgt-order.mk

Log Message:
tests/make: add test for circular dependency in .ORDER


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/deptgt-order.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/deptgt-order.mk

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/unit-tests/deptgt-order.exp
diff -u src/usr.bin/make/unit-tests/deptgt-order.exp:1.1 src/usr.bin/make/unit-tests/deptgt-order.exp:1.2
--- src/usr.bin/make/unit-tests/deptgt-order.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/deptgt-order.exp	Thu Jun 17 15:25:33 2021
@@ -1 +1,4 @@
+: 'Making two out of one.'
+: 'Making three out of two.'
+: 'Making all out of three.'
 exit status 0

Index: src/usr.bin/make/unit-tests/deptgt-order.mk
diff -u src/usr.bin/make/unit-tests/deptgt-order.mk:1.2 src/usr.bin/make/unit-tests/deptgt-order.mk:1.3
--- src/usr.bin/make/unit-tests/deptgt-order.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/deptgt-order.mk	Thu Jun 17 15:25:33 2021
@@ -1,8 +1,18 @@
-# $NetBSD: deptgt-order.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: deptgt-order.mk,v 1.3 2021/06/17 15:25:33 rillig Exp $
 #
 # Tests for the special target .ORDER in dependency declarations.
 
-# TODO: Implementation
+all one two three: .PHONY
 
-all:
-	@:;
+two: one
+	: 'Making $@ out of $>.'
+three: two
+	: 'Making $@ out of $>.'
+
+# This .ORDER creates a circular dependency since 'three' depends on 'one'
+# but 'one' is supposed to be built after 'three'.
+.ORDER: three one
+
+# XXX: The circular dependency should be detected here.
+all: three
+	: 'Making $@ out of $>.'



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

2021-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 17 12:53:43 UTC 2021

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

Log Message:
replace our merged version with upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.

Modified files:

Index: src/external/bsd/libfido2/dist/src/hid_netbsd.c
diff -u src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.2 src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.3
--- src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.2	Wed Jun 16 21:15:46 2021
+++ src/external/bsd/libfido2/dist/src/hid_netbsd.c	Thu Jun 17 08:53:43 2021
@@ -11,23 +11,22 @@
 #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;
+	int fd;
+	size_t  report_in_len;
+	size_t  report_out_len;
 	sigset_tsigmask;
 	const sigset_t *sigmaskp;
 };
@@ -41,47 +40,39 @@ struct hid_netbsd {
 static bool
 is_fido(int fd)
 {
-	report_desc_t			rdesc;
-	hid_data_t			hdata;
-	hid_item_t			hitem;
-	boolisfido;
+	struct usb_ctl_report_desc	ucrd;
+	uint32_t			usage_page = 0;
 	intraw = 1;
 
-	if ((rdesc = hid_get_report_desc(fd)) == NULL) {
-		fido_log_debug("%s: failed to get report descriptor",
-		__func__);
+	memset(, 0, sizeof(ucrd));
+
+	if (ioctl(fd, IOCTL_REQ(USB_GET_REPORT_DESC), ) == -1) {
+		fido_log_error(errno, "%s: ioctl", __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);
+
+	if (ucrd.ucrd_size < 0 ||
+	(size_t)ucrd.ucrd_size > sizeof(ucrd.ucrd_data) ||
+	fido_hid_get_usage(ucrd.ucrd_data, (size_t)ucrd.ucrd_size,
+		_page) < 0) {
+		fido_log_debug("%s: fido_hid_get_usage", __func__);
 		return (false);
 	}
-	isfido = false;
-	while ((hid_get_item(hdata, )) > 0) {
-		if (HID_PAGE(hitem.usage) == 0xf1d0) {
-			isfido = true;
-			break;
-		}
-	}
-	hid_end_parse(hdata);
-	hid_dispose_report_desc(rdesc);
-	if (!isfido)
+
+	if (usage_page != 0xf1d0)
 		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.
+	 * 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, ) == -1) {
-		fido_log_debug("%s: unable to set raw", __func__);
+	if (ioctl(fd, IOCTL_REQ(USB_HID_SET_RAW), ) == -1) {
+		fido_log_error(errno, "%s: unable to set raw", __func__);
 		return (false);
 	}
 
@@ -98,17 +89,13 @@ copy_info(fido_dev_info_t *di, const cha
 	memset(di, 0, sizeof(*di));
 	memset(, 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))
+	if ((fd = fido_hid_unix_open(path)) == -1 || is_fido(fd) == 0)
 		goto fail;
 
-	if (ioctl(fd, USB_GET_DEVICEINFO, ) == -1)
+	if (ioctl(fd, IOCTL_REQ(USB_GET_DEVICEINFO), ) == -1) {
+		fido_log_error(errno, "%s: ioctl", __func__);
 		goto fail;
+	}
 
 	if ((di->path = strdup(path)) == NULL ||
 	(di->manufacturer = strdup(udi.udi_vendor)) == NULL ||
@@ -120,8 +107,8 @@ copy_info(fido_dev_info_t *di, const cha
 
 	ok = 0;
 fail:
-	if (fd != -1)
-		close(fd);
+	if (fd != -1 && close(fd) == -1)
+		fido_log_error(errno, "%s: close", __func__);
 
 	if (ok < 0) {
 		free(di->path);
@@ -198,7 +185,7 @@ terrible_ping_kludge(struct hid_netbsd *
 		pfd.fd = ctx->fd;
 		pfd.events = POLLIN;
 		if ((n = poll(, 1, 100)) == -1) {
-			fido_log_debug("%s: poll: %d", __func__, errno);
+			fido_log_error(errno, "%s: poll", __func__);
 			return -1;
 		} else if (n == 0) {
 			fido_log_debug("%s: timed out", __func__);
@@ -223,58 +210,40 @@ void *
 fido_hid_open(const char *path)
 {
 	struct hid_netbsd		*ctx;
-	report_desc_t			rdesc = NULL;
-	hid_data_t			hdata;
-	intlen, report_id = 0;
-
-	if ((ctx = calloc(1, sizeof(*ctx))) == NULL)
-		goto 

CVS commit: src/tests/net/if_wg

2021-06-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jun 17 12:45:59 UTC 2021

Modified Files:
src/tests/net/if_wg: t_misc.sh

Log Message:
tests/net/if_wg: Only expect this to fail once!

Not sure how that happened, weird artefact of applying fuzzy patch
twice or something.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/net/if_wg/t_misc.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/net/if_wg/t_misc.sh
diff -u src/tests/net/if_wg/t_misc.sh:1.9 src/tests/net/if_wg/t_misc.sh:1.10
--- src/tests/net/if_wg/t_misc.sh:1.9	Thu Jun 17 12:16:09 2021
+++ src/tests/net/if_wg/t_misc.sh	Thu Jun 17 12:45:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_misc.sh,v 1.9 2021/06/17 12:16:09 riastradh Exp $
+#	$NetBSD: t_misc.sh,v 1.10 2021/06/17 12:45:58 riastradh Exp $
 #
 # Copyright (c) 2018 Ryota Ozaki 
 # All rights reserved.
@@ -88,8 +88,6 @@ wg_rekey_body()
 
 	atf_expect_fail "PR kern/56252"
 
-	atf_expect_fail "PR kern/56252"
-
 	# No reinitiation is performed
 	atf_check -s exit:0 -o match:"$latest_handshake" \
 	$HIJACKING wgconfig wg0 show peer peer0



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

2021-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 17 12:38:53 UTC 2021

Modified Files:
src/external/bsd/libfido2/lib: Makefile
Removed Files:
src/external/bsd/libfido2/lib: fido2.map

Log Message:
use the linker script provided by the package


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libfido2/lib/Makefile
cvs rdiff -u -r1.3 -r0 src/external/bsd/libfido2/lib/fido2.map

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.5 src/external/bsd/libfido2/lib/Makefile:1.6
--- src/external/bsd/libfido2/lib/Makefile:1.5	Thu Jun 17 02:20:56 2021
+++ src/external/bsd/libfido2/lib/Makefile	Thu Jun 17 08:38:53 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/06/17 06:20:56 rin Exp $
+# $NetBSD: Makefile,v 1.6 2021/06/17 12:38:53 christos Exp $
 
 NOLINT=
 .include 
@@ -11,7 +11,7 @@ CPPFLAGS+= -D_FIDO_INTERNAL -I${DIST}/sr
 LDADD+=-lusbhid -lcbor
 DPADD+=${LIBUSBHID} ${LIBCBOR}
 
-LDFLAGS+=-Wl,--version-script=${.CURDIR}/fido2.map
+LDFLAGS+=-Wl,--version-script=${DIST}/src/export.gnu
 
 LIB=fido2
 



CVS commit: src/tests/net/if_wg

2021-06-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jun 17 12:16:09 UTC 2021

Modified Files:
src/tests/net/if_wg: t_misc.sh

Log Message:
tests/net/if_wg: Mark as flaky (PR kern/56252).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/net/if_wg/t_misc.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/net/if_wg/t_misc.sh
diff -u src/tests/net/if_wg/t_misc.sh:1.8 src/tests/net/if_wg/t_misc.sh:1.9
--- src/tests/net/if_wg/t_misc.sh:1.8	Wed Jun 16 23:45:52 2021
+++ src/tests/net/if_wg/t_misc.sh	Thu Jun 17 12:16:09 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_misc.sh,v 1.8 2021/06/16 23:45:52 riastradh Exp $
+#	$NetBSD: t_misc.sh,v 1.9 2021/06/17 12:16:09 riastradh Exp $
 #
 # Copyright (c) 2018 Ryota Ozaki 
 # All rights reserved.
@@ -86,6 +86,10 @@ wg_rekey_body()
 
 	$ping $ip_wg_peer
 
+	atf_expect_fail "PR kern/56252"
+
+	atf_expect_fail "PR kern/56252"
+
 	# No reinitiation is performed
 	atf_check -s exit:0 -o match:"$latest_handshake" \
 	$HIJACKING wgconfig wg0 show peer peer0
@@ -113,6 +117,8 @@ wg_rekey_body()
 	$HIJACKING wgconfig wg0 show peer peer0
 
 	destroy_wg_interfaces
+
+	atf_fail "failed to trigger PR kern/56252"
 }
 
 wg_rekey_cleanup()
@@ -202,6 +208,8 @@ wg_handshake_timeout_body()
 	export RUMP_SERVER=$SOCK_LOCAL
 
 	destroy_wg_interfaces
+
+	atf_fail "failed to trigger PR kern/56252"
 }
 
 wg_handshake_timeout_cleanup()
@@ -263,6 +271,8 @@ wg_cookie_body()
 	# and a session doesn't start
 	$ping_fail $ip_wg_peer
 
+	atf_expect_fail "PR kern/56252"
+
 	extract_new_packets $BUS > $outfile
 	$DEBUG && cat $outfile
 	# XXX length 64 indicates the message is a cookie message
@@ -286,6 +296,8 @@ wg_cookie_body()
 	$HIJACKING wgconfig wg0
 
 	destroy_wg_interfaces
+
+	atf_fail "failed to trigger PR kern/56252"
 }
 
 wg_cookie_cleanup()
@@ -342,6 +354,8 @@ wg_mobility_body()
 	export RUMP_SERVER=$SOCK_LOCAL
 	$ping_fail $ip_wg_peer
 
+	atf_expect_fail "PR kern/56252"
+
 	extract_new_packets $BUS > $outfile
 	$DEBUG && cat $outfile
 
@@ -380,6 +394,8 @@ wg_mobility_body()
 	atf_check -s exit:0 -o not-match:"$ip_local.$port > $ip_peer.$port" cat $outfile
 
 	destroy_wg_interfaces
+
+	atf_fail "failed to trigger PR kern/56252"
 }
 
 wg_mobility_cleanup()



CVS commit: src/usr.bin/calendar/calendars

2021-06-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 17 11:48:19 UTC 2021

Modified Files:
src/usr.bin/calendar/calendars: calendar.holiday

Log Message:
U.S.S.R no longer exists


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/calendar/calendars/calendar.holiday

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/calendar/calendars/calendar.holiday
diff -u src/usr.bin/calendar/calendars/calendar.holiday:1.31 src/usr.bin/calendar/calendars/calendar.holiday:1.32
--- src/usr.bin/calendar/calendars/calendar.holiday:1.31	Thu Jun 17 11:45:22 2021
+++ src/usr.bin/calendar/calendars/calendar.holiday	Thu Jun 17 11:48:19 2021
@@ -61,7 +61,7 @@
 03/06	Lantern Day, Bejing
 03/09*	Purim - Feast of Lots 
 03/08	First Annual International Women's Day, 1909
-03/08	International Women's Day in U.S.S.R.
+03/08	International Women's Day
 03/08	Syrian National Day in Libyan Arab Republic
 03/08	Women's Day in Guinea-Bissau, Taiwan, Yemen Democratic Republic
 03/08	Youth Day in Zambia
@@ -149,7 +149,7 @@
 05/07	May Day in United Kingdom
 05/08	Truman Day in Missouri
 05/09	Liberation Day in Czechoslovakia
-05/09	Victory Day in Poland, U.S.S.R.
+05/09	Victory Day in Poland, Israel, former U.S.S.R.
 05/10	Confederate Memorial Day in South Carolina
 05/10	Mothers Day in Guatemala
 05/11	Minnesota Day in Minnesota
@@ -348,7 +348,6 @@
 10/04	Independence Day in Lesotho
 10/06	National Sports Day in Lesotho
 10/07	National Heroes Day in Jamaica
-10/08	Constitution Day in U.S.S.R
 10/08	Fiji Day in Fiji
 10/09	Independence Day in Uganda
 10/09	Korean Alphabet Day in South Korea



CVS commit: src/usr.bin/calendar/calendars

2021-06-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 17 11:45:22 UTC 2021

Modified Files:
src/usr.bin/calendar/calendars: calendar.holiday

Log Message:
November 20 is International Transgender Day of Remembrance

Officially recongized in Ontario, Canada. Originates from the murder
of Rita Hester in Allston, Massachusetts, on November 28, 1998.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/calendar/calendars/calendar.holiday

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/calendar/calendars/calendar.holiday
diff -u src/usr.bin/calendar/calendars/calendar.holiday:1.30 src/usr.bin/calendar/calendars/calendar.holiday:1.31
--- src/usr.bin/calendar/calendars/calendar.holiday:1.30	Mon Dec 16 07:18:11 2019
+++ src/usr.bin/calendar/calendars/calendar.holiday	Thu Jun 17 11:45:22 2021
@@ -551,6 +551,7 @@
 11/19	Anniversary of the 1968 Coup by the Army in Mali
 11/19	Garifuna Settlement in Belize
 11/19	Prince of Wales Birthday in Fiji
+11/20	Transgender Day of Remembrance
 11/22	Anniversary of Portuguese Aggression in Guinea
 11/24	Anniversary of the New Regime in Zaire
 11/28	Independence from Spain in Panama



CVS commit: src/usr.bin/calendar/calendars

2021-06-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 17 11:32:34 UTC 2021

Modified Files:
src/usr.bin/calendar/calendars: calendar.computer

Log Message:
1985: first ARM silicon and first Amiga


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/calendar/calendars/calendar.computer

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/calendar/calendars/calendar.computer
diff -u src/usr.bin/calendar/calendars/calendar.computer:1.17 src/usr.bin/calendar/calendars/calendar.computer:1.18
--- src/usr.bin/calendar/calendars/calendar.computer:1.17	Wed Jun 16 19:31:03 2021
+++ src/usr.bin/calendar/calendars/calendar.computer	Thu Jun 17 11:32:34 2021
@@ -34,6 +34,7 @@
 04/07	IBM announces System/360, 1964
 04/09	ENIAC Project begun, 1943
 04/20	Apple announces the Apple ][ at the 1st West Coast Computer Faire, 1977
+04/26	First ARM silicon produced, 1985
 04/28	Zilog Z-80 introduced, 1974
 05/01	First BASIC program run at Dartmouth, 1964
 05/06	EDSAC demonstrated, 1949
@@ -58,6 +59,7 @@
 	Temple Univ., Phila, 1948, for symbolic differentiation on the ENIAC
 07/08	Bell Telephone Co. formed (predecessor of AT), 1877
 07/08	CDC incorporated, 1957
+07/23	Commodore Amiga 1000 released, 1985
 08/09	First email sent from space by the crew of STS-43, 1991
 08/14	First Unix-based mallet created, 1954
 08/14	IBM PC announced, 1981



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

2021-06-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Jun 17 06:20:56 UTC 2021

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

Log Message:
Unbreak build; new libfido2 requires OpenBSD-compatible freezero().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/external/bsd/libfido2/lib/Makefile:1.5
--- src/external/bsd/libfido2/lib/Makefile:1.4	Thu Jun 17 01:15:46 2021
+++ src/external/bsd/libfido2/lib/Makefile	Thu Jun 17 06:20:56 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2021/06/17 01:15:46 christos Exp $
+# $NetBSD: Makefile,v 1.5 2021/06/17 06:20:56 rin Exp $
 
 NOLINT=
 .include 
@@ -48,6 +48,7 @@ u2f.c
 
 SRCS+= \
 explicit_bzero.c \
+freezero.c \
 recallocarray.c \
 timingsafe_bcmp.c