CVS commit: src/sys/modules/sodium

2021-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 18 09:34:45 UTC 2021

Modified Files:
src/sys/modules/sodium: Makefile.sodmod

Log Message:
Don't define HAVE_TI_MODE if we don't have it.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/sodium/Makefile.sodmod

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

Modified files:

Index: src/sys/modules/sodium/Makefile.sodmod
diff -u src/sys/modules/sodium/Makefile.sodmod:1.1 src/sys/modules/sodium/Makefile.sodmod:1.2
--- src/sys/modules/sodium/Makefile.sodmod:1.1	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile.sodmod	Wed Aug 18 05:34:45 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.sodmod,v 1.1 2021/08/17 17:29:20 christos Exp $
+#	$NetBSD: Makefile.sodmod,v 1.2 2021/08/18 09:34:45 christos Exp $
 
 SODIUMDIR=	${S}/external/isc/libsodium
 SODIUMSRCDIR=	${SODIUMDIR}/dist/src/libsodium
@@ -49,5 +49,8 @@ CWARNFLAGS+=	-Wno-shadow
 CWARNFLAGS+=	-Wno-unused-function
 CWARNFLAGS+=	-Wno-unused-variable
 
-CPPFLAGS+=	-DHAVE_TI_MODE -I${SODIUMDIR}/include 
+.if ${MACHINE_CPU} == "x86_64"
+CPPFLAGS+=	-DHAVE_TI_MODE
+.endif
+CPPFLAGS+=	-I${SODIUMDIR}/include 
 CPPFLAGS+=	-I${SODIUMDIR}/dist/src/libsodium/include/sodium



CVS commit: src/sys/modules

2021-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 18 09:07:07 UTC 2021

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/blake2s: Makefile
Removed Files:
src/sys/modules/blakes2s: Makefile

Log Message:
Fix broken name


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/blake2s/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/modules/blakes2s/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.253 src/sys/modules/Makefile:1.254
--- src/sys/modules/Makefile:1.253	Tue Aug 17 17:39:32 2021
+++ src/sys/modules/Makefile	Wed Aug 18 05:07:07 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.253 2021/08/17 21:39:32 kre Exp $
+#	$NetBSD: Makefile,v 1.254 2021/08/18 09:07:07 christos Exp $
 
 .include 
 
@@ -27,7 +27,7 @@ SUBDIR+=	adosfs
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs
-SUBDIR+=	blakes2s
+SUBDIR+=	blake2s
 SUBDIR+=	blowfish
 SUBDIR+=	bpf
 SUBDIR+=	bpf_filter

Added files:

Index: src/sys/modules/blake2s/Makefile
diff -u /dev/null src/sys/modules/blake2s/Makefile:1.1
--- /dev/null	Wed Aug 18 05:07:07 2021
+++ src/sys/modules/blake2s/Makefile	Wed Aug 18 05:07:07 2021
@@ -0,0 +1,13 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/18 09:07:07 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	blake2s
+
+BLAKE2SDIR=	$S/crypto/blake2
+CPPFLAGS+=	-I${BLAKE2SDIR}
+
+.PATH: ${BLAKE2SDIR}
+SRCS+=	blake2s.c
+
+.include 



CVS commit: src/distrib/sets/lists

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:31:59 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi

Log Message:
modules for if_wg, blake2s, libsodium


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.144 -r1.145 src/distrib/sets/lists/modules/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/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.9 src/distrib/sets/lists/debug/module.mi:1.10
--- src/distrib/sets/lists/debug/module.mi:1.9	Mon May 17 00:07:42 2021
+++ src/distrib/sets/lists/debug/module.mi	Tue Aug 17 13:31:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.9 2021/05/17 04:07:42 yamaguchi Exp $
+# $NetBSD: module.mi,v 1.10 2021/08/17 17:31:58 christos Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
@@ -14,6 +14,8 @@
 ./usr/libdata/debug/@MODULEDIR@/audio/audio.kmod.debug			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/autofsmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/autofs/autofs.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/blake2smodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/blake2s/blake2s.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfishmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfish/blowfish.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpfmodules-base-kernel	kmod,debug
@@ -224,6 +226,8 @@
 ./usr/libdata/debug/@MODULEDIR@/if_urndis/if_urndis.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_vlanmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_vlan/if_vlan.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_wgmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_wg/if_wg.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/iicmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/iic/iic.kmod.debug			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/ip_ecnmodules-base-kernel	kmod,debug
@@ -332,6 +336,8 @@
 ./usr/libdata/debug/@MODULEDIR@/skipjack/skipjack.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/slcompress			modules-base-kernel kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/slcompress/slcompress.kmod.debug	modules-base-kernel kmod,debug
+./usr/libdata/debug/@MODULEDIR@/sodiummodules-base-kernel kmod,solaris,debug
+./usr/libdata/debug/@MODULEDIR@/sodium/sodium.kmod.debug		modules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/solarismodules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/solaris/solaris.kmod.debug		modules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/spdmemmodules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.144 src/distrib/sets/lists/modules/mi:1.145
--- src/distrib/sets/lists/modules/mi:1.144	Mon May 17 00:07:42 2021
+++ src/distrib/sets/lists/modules/mi	Tue Aug 17 13:31:59 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.144 2021/05/17 04:07:42 yamaguchi Exp $
+# $NetBSD: mi,v 1.145 2021/08/17 17:31:59 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -23,6 +23,8 @@
 ./@MODULEDIR@/audio/audio.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/autofsmodules-base-kernel	kmod
 ./@MODULEDIR@/autofs/autofs.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/blake2smodules-base-kernel	kmod
+./@MODULEDIR@/blake2s/blake2s.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/blowfishmodules-base-kernel	kmod
 ./@MODULEDIR@/blowfish/blowfish.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/bpfmodules-base-kernel	kmod
@@ -251,6 +253,8 @@
 ./@MODULEDIR@/if_vioif/if_vioif.kmod		base-obsolete		obsolete
 ./@MODULEDIR@/if_vlanmodules-base-kernel	kmod
 ./@MODULEDIR@/if_vlan/if_vlan.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/if_wgmodules-base-kernel	kmod
+./@MODULEDIR@/if_wg/if_wg.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/iicmodules-base-kernel	kmod
 ./@MODULEDIR@/iic/iic.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/ip_ecnmodules-base-kernel	kmod
@@ -399,6 +403,8 @@
 ./@MODULEDIR@/slcompress/slcompress.kmod	modules-base-kernel kmod
 ./@MODULEDIR@/smbfsbase-obsolete		obsolete
 ./@MODULEDIR@/smbfs/smbfs.kmod			base-obsolete		obsolete
+./@MODULEDIR@/sodiummodules-base-kernel kmod

CVS commit: src/sys/net

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:31:13 UTC 2021

Modified Files:
src/sys/net: if_wg.c

Log Message:
Some signnes, casts, and constant sizes.
Add module dependencies.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/net/if_wg.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/if_wg.c
diff -u src/sys/net/if_wg.c:1.64 src/sys/net/if_wg.c:1.65
--- src/sys/net/if_wg.c:1.64	Tue Jun 15 20:21:19 2021
+++ src/sys/net/if_wg.c	Tue Aug 17 13:31:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wg.c,v 1.64 2021/06/16 00:21:19 riastradh Exp $	*/
+/*	$NetBSD: if_wg.c,v 1.65 2021/08/17 17:31:13 christos Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki 
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.64 2021/06/16 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.65 2021/08/17 17:31:13 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq_enabled.h"
@@ -442,7 +442,7 @@ sliwin_update(struct sliwin *W, uint64_t
 	bit = S % SLIWIN_BPW;
 	if (W->B[word] & (1UL << bit))
 		return EAUTH;
-	W->B[word] |= 1UL << bit;
+	W->B[word] |= 1U << bit;
 
 	/* Accept!  */
 	return 0;
@@ -1009,7 +1009,7 @@ wg_algo_hmac(uint8_t out[], const size_t
 	uint8_t hmackey[HMAC_BLOCK_LEN] = {0};
 	uint8_t ipad[HMAC_BLOCK_LEN];
 	uint8_t opad[HMAC_BLOCK_LEN];
-	int i;
+	size_t i;
 	struct blake2s state;
 
 	KASSERT(outlen == WG_HASH_LEN);
@@ -1167,11 +1167,11 @@ wg_algo_tai64n(wg_timestamp_t timestamp)
 	/* FIXME strict TAI64N (https://cr.yp.to/libtai/tai64.html) */
 	getnanotime();
 	/* TAI64 label in external TAI64 format */
-	be32enc(timestamp, 0x4000UL + (ts.tv_sec >> 32));
+	be32enc(timestamp, 0x4000U + (uint32_t)(ts.tv_sec >> 32));
 	/* second beginning from 1970 TAI */
-	be32enc(timestamp + 4, ts.tv_sec & 0xU);
+	be32enc(timestamp + 4, (uint32_t)(ts.tv_sec & 0xU));
 	/* nanosecond in big-endian format */
-	be32enc(timestamp + 8, ts.tv_nsec);
+	be32enc(timestamp + 8, (uint32_t)ts.tv_nsec);
 }
 
 /*
@@ -1715,7 +1715,7 @@ wg_send_handshake_msg_init(struct wg_sof
 		if (wgp->wgp_handshake_start_time == 0)
 			wgp->wgp_handshake_start_time = time_uptime;
 		callout_schedule(>wgp_handshake_timeout_timer,
-		MIN(wg_rekey_timeout, INT_MAX/hz) * hz);
+		MIN(wg_rekey_timeout, (unsigned)(INT_MAX / hz)) * hz);
 	} else {
 		wg_put_session_index(wg, wgs);
 		/* Initiation failed; toss packet waiting for it if any.  */
@@ -2271,7 +2271,7 @@ wg_lookup_session_by_index(struct wg_sof
 static void
 wg_schedule_rekey_timer(struct wg_peer *wgp)
 {
-	int timeout = MIN(wg_rekey_after_time, INT_MAX/hz);
+	int timeout = MIN(wg_rekey_after_time, (unsigned)(INT_MAX / hz));
 
 	callout_schedule(>wgp_rekey_timer, timeout * hz);
 }
@@ -2308,7 +2308,7 @@ wg_need_to_send_init_message(struct wg_s
 }
 
 static void
-wg_schedule_peer_task(struct wg_peer *wgp, int task)
+wg_schedule_peer_task(struct wg_peer *wgp, unsigned int task)
 {
 
 	mutex_enter(wgp->wgp_intr_lock);
@@ -3082,7 +3082,7 @@ wg_peer_work(struct work *wk, void *cook
 {
 	struct wg_peer *wgp = container_of(wk, struct wg_peer, wgp_work);
 	struct wg_softc *wg = wgp->wgp_sc;
-	int tasks;
+	unsigned int tasks;
 
 	mutex_enter(wgp->wgp_intr_lock);
 	while ((tasks = wgp->wgp_tasks) != 0) {
@@ -4515,10 +4515,10 @@ wg_ioctl_get(struct wg_softc *wg, struct
 		const struct timespec *t = >wgp_last_handshake_time;
 
 		if (!prop_dictionary_set_uint64(prop_peer,
-			"last_handshake_time_sec", t->tv_sec))
+			"last_handshake_time_sec", (uint64_t)t->tv_sec))
 			goto next;
 		if (!prop_dictionary_set_uint32(prop_peer,
-			"last_handshake_time_nsec", t->tv_nsec))
+			"last_handshake_time_nsec", (uint32_t)t->tv_nsec))
 			goto next;
 
 		if (wgp->wgp_n_allowedips == 0)
@@ -5002,4 +5002,4 @@ rumpkern_wg_recv_peer(struct wg_softc *w
  */
 #include "if_module.h"
 
-IF_MODULE(MODULE_CLASS_DRIVER, wg, "")
+IF_MODULE(MODULE_CLASS_DRIVER, wg, "sodium,blake2s")



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

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:30:01 UTC 2021

Modified Files:
src/sys/external/isc/libsodium/src: glue.c

Log Message:
Add module glue


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/isc/libsodium/src/glue.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/isc/libsodium/src/glue.c
diff -u src/sys/external/isc/libsodium/src/glue.c:1.1 src/sys/external/isc/libsodium/src/glue.c:1.2
--- src/sys/external/isc/libsodium/src/glue.c:1.1	Thu Aug 20 17:20:16 2020
+++ src/sys/external/isc/libsodium/src/glue.c	Tue Aug 17 13:30:01 2021
@@ -1 +1,56 @@
+/*	$NetBSD: glue.c,v 1.2 2021/08/17 17:30:01 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: glue.c,v 1.2 2021/08/17 17:30:01 christos Exp $");
+
+#include 
+#include 
+#include 
+
 int libsodium_errno;
+
+MODULE(MODULE_CLASS_MISC, sodium, NULL);
+
+static int
+sodium_modcmd(modcmd_t cmd, void *arg)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		break;
+
+	case MODULE_CMD_FINI:
+		break;
+
+	default:
+		return ENOTTY;
+	}
+
+	return 0;
+}



CVS commit: src/sys/modules

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:29:20 UTC 2021

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/blakes2s: Makefile
src/sys/modules/if_wg: Makefile wg.ioconf
src/sys/modules/sodium: Makefile Makefile.sodmod

Log Message:
modules for blake2s libsodium and if_wg


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/blakes2s/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_wg/Makefile \
src/sys/modules/if_wg/wg.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/sodium/Makefile \
src/sys/modules/sodium/Makefile.sodmod

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.251 src/sys/modules/Makefile:1.252
--- src/sys/modules/Makefile:1.251	Mon Aug  9 16:49:10 2021
+++ src/sys/modules/Makefile	Tue Aug 17 13:29:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.251 2021/08/09 20:49:10 andvar Exp $
+#	$NetBSD: Makefile,v 1.252 2021/08/17 17:29:19 christos Exp $
 
 .include 
 
@@ -27,6 +27,7 @@ SUBDIR+=	adosfs
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs
+SUBDIR+=	blake2s
 SUBDIR+=	blowfish
 SUBDIR+=	bpf
 SUBDIR+=	bpf_filter
@@ -100,6 +101,7 @@ SUBDIR+=	if_ure
 SUBDIR+=	if_url
 SUBDIR+=	if_urndis
 SUBDIR+=	if_vlan
+SUBDIR+=	if_wg
 SUBDIR+=	iic
 SUBDIR+=	ip_ecn
 SUBDIR+=	ipl
@@ -389,6 +391,8 @@ SUBDIR+=	cyclic
 SUBDIR+=	dtrace
 .endif
 
+SUBDIR+=sodium
+
 # we need solaris for the dtrace and zfs modules
 .if (${MKDTRACE} != "no" || ${MKZFS} != "no")
 SUBDIR+=solaris

Added files:

Index: src/sys/modules/blakes2s/Makefile
diff -u /dev/null src/sys/modules/blakes2s/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/blakes2s/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,13 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	blake2s
+
+BLAKE2SDIR=	$S/crypto/blake2
+CPPFLAGS+=	-I${BLAKE2SDIR}
+
+.PATH: ${BLAKE2SDIR}
+SRCS+=	blake2s.c
+
+.include 

Index: src/sys/modules/if_wg/Makefile
diff -u /dev/null src/sys/modules/if_wg/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/if_wg/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		if_wg
+IOCONF=		wg.ioconf
+SRCS=		if_wg.c
+
+CPPFLAGS+=	-DINET
+CPPFLAGS+=	-DINET6
+CPPFLAGS+=	-DALTQ
+
+WARNS=		3
+
+.include 
Index: src/sys/modules/if_wg/wg.ioconf
diff -u /dev/null src/sys/modules/if_wg/wg.ioconf:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/if_wg/wg.ioconf	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,7 @@
+#	$NetBSD: wg.ioconf,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+ioconf		wg
+
+include		"conf/files"
+
+pseudo-device   wg

Index: src/sys/modules/sodium/Makefile
diff -u /dev/null src/sys/modules/sodium/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	sodium
+
+.include "Makefile.sodmod"
+.include 
Index: src/sys/modules/sodium/Makefile.sodmod
diff -u /dev/null src/sys/modules/sodium/Makefile.sodmod:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile.sodmod	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,53 @@
+#	$NetBSD: Makefile.sodmod,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+SODIUMDIR=	${S}/external/isc/libsodium
+SODIUMSRCDIR=	${SODIUMDIR}/dist/src/libsodium
+
+.PATH:	${SODIUMDIR}/src
+SRCS+=	glue.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult/curve25519/ref10
+SRCS+=	x25519_ref10.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult/curve25519
+SRCS+=	scalarmult_curve25519.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult
+SRCS+=	crypto_scalarmult.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth/poly1305/donna
+SRCS+=	poly1305_donna.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth/poly1305
+SRCS+=	onetimeauth_poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth
+SRCS+=	crypto_onetimeauth.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_stream/chacha20/ref
+SRCS+=	chacha20_ref.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_stream/chacha20
+SRCS+=	stream_chacha20.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_aead/xchacha20poly1305/sodium
+SRCS+=	aead_xchacha20poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_aead/chacha20poly1305/sodium
+SRCS+=	aead_chacha20poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_core/hchacha20
+SRCS+=	core_hchacha20.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_core/ed25519/ref10
+SRCS+=	ed25519_ref10.c
+
+WARNS=		3
+
+CWARNFLAGS+=	-Wall
+CWARNFLAGS+=	-Wno-shadow
+CWARNFLAGS+=	-Wno-unused-function
+CWARNFLAGS+=	-Wno-unused-variable
+
+CPPFLAGS+=	-DHAVE_TI_MODE -I${SODIUMDIR}/include 
+CPPFLAGS+=	-I${SODIUMDIR}/dist/src/libsodium/include/sodium



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c

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

Modified files:

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



CVS commit: src/lib/libcurses

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/slk.c

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

Modified files:

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

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



CVS commit: src/bin/csh

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

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

Log Message:
Turn on EL_SAFEREAD


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/csh/set.c

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

Modified files:

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



CVS commit: src/bin/sh

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

Modified Files:
src/bin/sh: Makefile

Log Message:
Add -I to find filecomplete.h


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

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

Modified files:

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



CVS commit: src/lib/libcurses

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

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

Log Message:
need limits.h


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libcurses/slk.c

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

Modified files:

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



CVS commit: src/lib/libcurses

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/slk.c

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

Modified files:

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



CVS commit: src/usr.sbin/catman

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

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

Log Message:
Restore BSD BUGS section


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

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

Modified files:

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



CVS commit: src/bin/kill

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

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

Log Message:
restore a bit of history.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/kill/kill.1

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

Modified files:

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



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

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

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

Log Message:
Conditionalize GSSAPI use on USE_KERBEROS


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

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

Modified files:

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



CVS commit: src/share/mk

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

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

Log Message:
Fix sun2 build for ldap/gssapi


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

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

Modified files:

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



CVS commit: src/bin/sh

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/bin/sh/histedit.c
cvs rdiff -u -r1.13 -r1.14 src/bin/sh/myhistedit.h

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

Modified files:

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

CVS commit: src/lib/libedit

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/lib/libedit/editline.3 src/lib/libedit/el.c
cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/el.h
cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/eln.c
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/histedit.h
cvs rdiff -u -r1.106 -r1.107 src/lib/libedit/read.c

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

Modified files:

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

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

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

CVS commit: src/lib/libedit

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

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

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


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

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.159 src/lib/libedit/readline.c:1.160
--- src/lib/libedit/readline.c:1.159	Wed Oct  9 10:31:07 2019
+++ src/lib/libedit/readline.c	Sun Aug 15 06:06:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.159 2019/10/09 14:31:07 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.159 2019/10/09 14:31:07 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -952,8 +952,10 @@ history_expand(char *str, char **output)
 			(size += len + 1) * sizeof(*nresult));	\
 			if (nresult == NULL) {\
 el_free(*output);			\
-if (/*CONSTCOND*/fr)			\
+if (/*CONSTCOND*/fr) {			\
+	/*LINTED*/			\
 	el_free(tmp);			\
+}	\
 return 0;\
 			}		\
 			result = nresult;\



CVS commit: src/sys/compat/common

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

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

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


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

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

Modified files:

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

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

CVS commit: src/usr.sbin/racoon

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

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

Log Message:
One more ldap change


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/racoon/Makefile

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

Modified files:

Index: src/usr.sbin/racoon/Makefile
diff -u src/usr.sbin/racoon/Makefile:1.39 src/usr.sbin/racoon/Makefile:1.40
--- src/usr.sbin/racoon/Makefile:1.39	Mon Apr 12 21:11:05 2021
+++ src/usr.sbin/racoon/Makefile	Sat Aug 14 13:08:21 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2021/04/13 01:11:05 mrg Exp $
+# $NetBSD: Makefile,v 1.40 2021/08/14 17:08:21 christos Exp $
 
 WARNS?=	0	# XXX third-party program, many issues
 NOCLANGERROR=	# defined
@@ -60,8 +60,8 @@ CPPFLAGS+=-DINET6
 
 .if (${USE_LDAP} != "no")
 CPPFLAGS+=-DHAVE_LIBLDAP
-LDADD+=-lldap -llber -lssl
-DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBSSL}
+LDADD+= ${LIBLDAP_LDADD}
+DPADD+= ${LIBLDAP_DPADD}
 .endif
 
 LDADD+= -lcrypto -lcrypt



CVS commit: src/doc

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:20:31 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenLDAP


To generate a diff of this commit:
cvs rdiff -u -r1.1809 -r1.1810 src/doc/3RDPARTY
cvs rdiff -u -r1.2819 -r1.2820 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.1809 src/doc/3RDPARTY:1.1810
--- src/doc/3RDPARTY:1.1809	Thu Jul 29 09:42:38 2021
+++ src/doc/3RDPARTY	Sat Aug 14 12:20:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1809 2021/07/29 13:42:38 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1810 2021/08/14 16:20:31 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1017,12 +1017,12 @@ Notes:
 We have lots of local fixes.
 
 Package:	OpenLDAP
-Version:	2.4.50
-Current Vers:	2.4.57
+Version:	2.5.6
+Current Vers:	2.5.6
 Maintainer:	OpenLDAP Foundation
 Archive Site:	http://www.openldap.org/
 Home Page:	http://www.openldap.org/
-Date:		2021-03-01
+Date:		2021-08-14
 Mailing List:
 Responsible:
 License:	BSD (3-clause)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2819 src/doc/CHANGES:1.2820
--- src/doc/CHANGES:1.2819	Tue Aug 10 12:45:35 2021
+++ src/doc/CHANGES	Sat Aug 14 12:20:31 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2819 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2820 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -399,3 +399,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbarm: Improvements in interrupt handling on Arm GIC v2 and v3 systems
 		resulting in better network and storage performance.
 		[jmcneill 20210810]
+	openldap: Import 2.5.6. [christos 20210814]



CVS commit: src/distrib/sets/lists

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:18:32 UTC 2021

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

Log Message:
bump ldap libraries


To generate a diff of this commit:
cvs rdiff -u -r1.922 -r1.923 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.279 -r1.280 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.922 src/distrib/sets/lists/base/shl.mi:1.923
--- src/distrib/sets/lists/base/shl.mi:1.922	Tue Jul 13 23:19:23 2021
+++ src/distrib/sets/lists/base/shl.mi	Sat Aug 14 12:18:32 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.922 2021/07/14 03:19:23 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.923 2021/08/14 16:18:32 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -417,14 +417,14 @@
 ./usr/lib/libkvm.so.6base-sys-shlib		compatfile
 ./usr/lib/libkvm.so.6.0base-sys-shlib		compatfile
 ./usr/lib/liblber.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/liblber.so.3base-ldap-shlib		ldap,compatfile
-./usr/lib/liblber.so.3.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/liblber.so.5base-ldap-shlib		ldap,compatfile
+./usr/lib/liblber.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/libldap.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/libldap.so.4base-ldap-shlib		ldap,compatfile
-./usr/lib/libldap.so.4.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap.so.5base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/libldap_r.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/libldap_r.so.4			base-ldap-shlib		ldap,compatfile
-./usr/lib/libldap_r.so.4.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap_r.so.5			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap_r.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/liblsan.sobase-sys-shlib		compatfile,cxx,gcc
 ./usr/lib/liblsan.so.1base-sys-shlib		compatfile,obsolete
 ./usr/lib/liblsan.so.1.0			base-sys-shlib		compatfile,obsolete

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.279 src/distrib/sets/lists/debug/shl.mi:1.280
--- src/distrib/sets/lists/debug/shl.mi:1.279	Tue Jul 13 23:19:24 2021
+++ src/distrib/sets/lists/debug/shl.mi	Sat Aug 14 12:18:32 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.279 2021/07/14 03:19:24 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.280 2021/08/14 16:18:32 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
@@ -148,9 +148,9 @@
 ./usr/libdata/debug/usr/lib/libkdc.so.3.0.debug			comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libkrb5.so.27.0.debug		comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libkvm.so.6.0.debug			comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/liblber.so.3.3.debug		comp-ldap-debug	debug,compatfile,ldap
-./usr/libdata/debug/usr/lib/libldap.so.4.3.debug		comp-ldap-debug	debug,compatfile,ldap
-./usr/libdata/debug/usr/lib/libldap_r.so.4.3.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/liblber.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/libldap.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/libldap_r.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
 ./usr/libdata/debug/usr/lib/liblsan.so.1.0.debug		comp-sys-debug	debug,compatfile,obsolete
 ./usr/libdata/debug/usr/lib/liblsan.so.2.0.debug		comp-sys-debug	debug,compatfile,cxx,gcc
 ./usr/libdata/debug/usr/lib/liblua.so.5.3.debug			comp-sys-debug	debug,compatfile



CVS commit: src

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:17:57 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/dist: ldapauth.c ldapauth.h sshd.c
src/external/bsd/am-utils/bin/amd: Makefile
src/external/ibm-public/postfix: Makefile.inc

Log Message:
Adjust for new OpenLDAP
- use centralized library variables
- ldap_connect -> ldap_xconnect


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/ldapauth.c
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/ldapauth.h
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/openssh/dist/sshd.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/am-utils/bin/amd/Makefile
cvs rdiff -u -r1.27 -r1.28 src/external/ibm-public/postfix/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/crypto/external/bsd/openssh/bin/sshd/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23 src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.24
--- src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23	Fri Mar  5 12:47:15 2021
+++ src/crypto/external/bsd/openssh/bin/sshd/Makefile	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2021/03/05 17:47:15 christos Exp $
+#	$NetBSD: Makefile,v 1.24 2021/08/14 16:17:57 christos Exp $
 
 .include 
 
@@ -54,8 +54,8 @@ DPADD+= ${LIBKRB5_DPADD}
 
 .if (${USE_LDAP} != "no")
 SRCS+=	ldapauth.c
-LDADD+=	-lldap -lssl -llber
-DPADD+=	${LIBLDAP} ${LIBSSL} ${LIBLBER}
+LDADD+=	${LIBLDAP_LDADD}
+DPADD+=	${LIBLDAP_DPADD}
 .endif
 
 LDADD+=	-lcrypt -lutil

Index: src/crypto/external/bsd/openssh/dist/ldapauth.c
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7 src/crypto/external/bsd/openssh/dist/ldapauth.c:1.8
--- src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -21,7 +21,7 @@
  *
  */
 #include "includes.h"
-__RCSID("$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $");
+__RCSID("$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $");
 
 #ifdef WITH_LDAP_PUBKEY
 #include 
@@ -124,7 +124,7 @@ void ldap_close(ldap_opt_t * ldap) {
 }
 
 /* init && bind */
-int ldap_connect(ldap_opt_t * ldap) {
+int ldap_xconnect(ldap_opt_t * ldap) {
 int version = LDAP_VERSION3;
 
 if (!ldap->servers)
@@ -154,7 +154,7 @@ int ldap_connect(ldap_opt_t * ldap) {
 if ( (ldap->tls == -1) || (ldap->tls == 1) ) {
 if (ldap_start_tls_s(ldap->ld, NULL, NULL ) != LDAP_SUCCESS) {
 /* failed then reinit the initial connect */
-ldap_perror(ldap->ld, "ldap_connect: (TLS) ldap_start_tls()");
+ldap_perror(ldap->ld, "ldap_xconnect: (TLS) ldap_start_tls()");
 if (ldap->tls == 1)
 return FAILURE;
 
@@ -378,7 +378,7 @@ ldap_key_t * ldap_getuserkey(ldap_opt_t 
 /* XXX TODO: setup some conf value for retrying */
 if (!(l->flags & FLAG_CONNECTED))
 for (i = 0 ; i < 2 ; i++)
-if (ldap_connect(l) == 0)
+if (ldap_xconnect(l) == 0)
 break;
 
 /* quick check for attempts to be evil */
@@ -445,7 +445,7 @@ int ldap_ismember(ldap_opt_t * l, const 
 /* XXX TODO: setup some conf value for retrying */
 if (!(l->flags & FLAG_CONNECTED)) 
 for (i = 0 ; i < 2 ; i++)
-if (ldap_connect(l) == 0)
+if (ldap_xconnect(l) == 0)
  break;
 
 /* quick check for attempts to be evil */

Index: src/crypto/external/bsd/openssh/dist/ldapauth.h
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5 src/crypto/external/bsd/openssh/dist/ldapauth.h:1.6
--- src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.h	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.h,v 1.5 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.h,v 1.6 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -112,7 +112,7 @@ typedef struct ldap_keys {
 
 /* function headers */
 void ldap_close(ldap_opt_t *);
-int ldap_connect(ldap_opt_t *);
+int ldap_xconnect(ldap_opt_t *);
 char * ldap_parse_groups(const char *);
 char * ldap_parse_servers(const char *);
 void ldap_options_print(ldap_opt_t *);

Index: src/crypto/external/bsd/openssh/dist/sshd.c
diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.42 src/crypto/external/bsd/openssh/dist/sshd.c:1.43
--- src/crypto/external/bsd/openssh/dist/sshd.c:1.42	Mon Apr 19 10:40:15 2021
+++ src/crypto/external/bsd/openssh/dist/sshd.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 

CVS commit: src/share/mk

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:16:32 UTC 2021

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

Log Message:
Centralize the ldap libraries


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

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.336 src/share/mk/bsd.prog.mk:1.337
--- src/share/mk/bsd.prog.mk:1.336	Thu Nov 12 12:53:43 2020
+++ src/share/mk/bsd.prog.mk	Sat Aug 14 12:16:32 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.336 2020/11/12 17:53:43 nia Exp $
+#	$NetBSD: bsd.prog.mk,v 1.337 2021/08/14 16:16:32 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -229,6 +229,11 @@ LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR}
 	${LIBSQLITE3} ${LIBM} ${LIBCRYPT} ${LIBUTIL}
 .endif
 
+.if (${MKLDAP} != "no")
+LIBLDAP_LDADD+= -lldap -llber -lgssapi -lssl -lcrypto 
+LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI} ${LIBSSL} ${LIBCRYPTO}
+.endif
+
 # PAM applications, if linked statically, need more libraries
 .if (${MKPIC} == "no")
 PAM_STATIC_LDADD+= -lssh



CVS commit: src/external/bsd/openldap/dist/libraries/libldap

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:15:46 UTC 2021

Added Files:
src/external/bsd/openldap/dist/libraries/libldap: gssapi.c

Log Message:
Put back gssapi.c


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.4 \
src/external/bsd/openldap/dist/libraries/libldap/gssapi.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/openldap/dist/libraries/libldap/gssapi.c
diff -u /dev/null src/external/bsd/openldap/dist/libraries/libldap/gssapi.c:1.4
--- /dev/null	Sat Aug 14 12:15:46 2021
+++ src/external/bsd/openldap/dist/libraries/libldap/gssapi.c	Sat Aug 14 12:15:46 2021
@@ -0,0 +1,1015 @@
+/*	$NetBSD: gssapi.c,v 1.4 2021/08/14 16:15:46 christos Exp $	*/
+
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2020 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Author: Stefan Metzmacher 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
+ */
+
+#include 
+__RCSID("$NetBSD: gssapi.c,v 1.4 2021/08/14 16:15:46 christos Exp $");
+
+#include "portable.h"
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef HAVE_LIMITS_H
+#include 
+#endif
+
+#include "ldap-int.h"
+
+#ifdef HAVE_GSSAPI
+
+#ifdef HAVE_GSSAPI_GSSAPI_H
+#include 
+#else
+#include 
+#endif
+
+static char *
+gsserrstr(
+	char *buf,
+	ber_len_t buf_len,
+	gss_OID mech,
+	int gss_rc,
+	OM_uint32 minor_status )
+{
+	OM_uint32 min2;
+	gss_buffer_desc mech_msg = GSS_C_EMPTY_BUFFER;
+	gss_buffer_desc gss_msg = GSS_C_EMPTY_BUFFER;
+	gss_buffer_desc minor_msg = GSS_C_EMPTY_BUFFER;
+	OM_uint32 msg_ctx = 0;
+
+	if (buf == NULL) {
+		return NULL;
+	}
+
+	if (buf_len == 0) {
+		return NULL;
+	}
+
+#ifdef HAVE_GSS_OID_TO_STR
+	gss_oid_to_str(, mech, _msg);
+#endif
+	gss_display_status(, gss_rc, GSS_C_GSS_CODE,
+			   mech, _ctx, _msg);
+	gss_display_status(, minor_status, GSS_C_MECH_CODE,
+			   mech, _ctx, _msg);
+
+	snprintf(buf, buf_len, "gss_rc[%d:%*s] mech[%*s] minor[%u:%*s]",
+		 gss_rc, (int)gss_msg.length,
+		 (const char *)(gss_msg.value?gss_msg.value:""),
+		 (int)mech_msg.length,
+		 (const char *)(mech_msg.value?mech_msg.value:""),
+		 minor_status, (int)minor_msg.length,
+		 (const char *)(minor_msg.value?minor_msg.value:""));
+
+	gss_release_buffer(, _msg);
+	gss_release_buffer(, _msg);
+	gss_release_buffer(, _msg);
+
+	buf[buf_len-1] = '\0';
+
+	return buf;
+}
+
+static void
+sb_sasl_gssapi_init(
+	struct sb_sasl_generic_data *p,
+	ber_len_t *min_send,
+	ber_len_t *max_send,
+	ber_len_t *max_recv )
+{
+	gss_ctx_id_t gss_ctx = (gss_ctx_id_t)p->ops_private;
+	int gss_rc;
+	OM_uint32 minor_status;
+	gss_OID ctx_mech = GSS_C_NO_OID;
+	OM_uint32 ctx_flags = 0;
+	int conf_req_flag = 0;
+	OM_uint32 max_input_size;
+
+	gss_inquire_context(_status,
+			gss_ctx,
+			NULL,
+			NULL,
+			NULL,
+			_mech,
+			_flags,
+			NULL,
+			NULL);
+
+	if (ctx_flags & (GSS_C_CONF_FLAG)) {
+		conf_req_flag = 1;
+	}
+
+#if defined(HAVE_CYRUS_SASL)
+#define SEND_PREALLOC_SIZE	SASL_MIN_BUFF_SIZE
+#else
+#define SEND_PREALLOC_SIZE  4096
+#endif
+#define SEND_MAX_WIRE_SIZE	0x00A0
+#define RECV_MAX_WIRE_SIZE	0x0FFF
+#define FALLBACK_SEND_MAX_SIZE	0x009FFFB8 /* from MIT 1.5.x */
+
+	gss_rc = gss_wrap_size_limit(_status, gss_ctx,
+ conf_req_flag, GSS_C_QOP_DEFAULT,
+ SEND_MAX_WIRE_SIZE, _input_size);
+	if ( gss_rc != GSS_S_COMPLETE ) {
+		char msg[256];
+		ber_log_printf( LDAP_DEBUG_ANY, p->sbiod->sbiod_sb->sb_debug,
+"sb_sasl_gssapi_init: failed to wrap size limit: %s\n",
+gsserrstr( msg, sizeof(msg), ctx_mech, gss_rc, minor_status ) );
+		ber_log_printf( LDAP_DEBUG_ANY, p->sbiod->sbiod_sb->sb_debug,
+"sb_sasl_gssapi_init: fallback to default wrap size limit\n");
+		/*
+		 * some libgssglue/libgssapi versions
+		 * have a broken gss_wrap_size_limit()
+		 * implementation
+		 */
+		max_input_size = FALLBACK_SEND_MAX_SIZE;
+	}
+
+	*min_send = SEND_PREALLOC_SIZE;
+	*max_send = max_input_size;
+	*max_recv = RECV_MAX_WIRE_SIZE;
+}
+
+static ber_int_t
+sb_sasl_gssapi_encode(
+	struct sb_sasl_generic_data *p,
+	unsigned char *buf,
+	ber_len_t len,
+	Sockbuf_Buf *dst )
+{
+	gss_ctx_id_t gss_ctx = (gss_ctx_id_t)p->ops_private;
+	int gss_rc;
+	OM_uint32 minor_status;
+	gss_buffer_desc unwrapped, wrapped;
+	gss_OID ctx_mech = GSS_C_NO_OID;
+	OM_uint32 ctx_flags = 0;
+	int conf_req_flag = 0;
+	int conf_state;
+	unsigned char *b;
+	ber_len_t pkt_len;
+
+	unwrapped.value		= buf;
+	unwrapped.length	= len;
+
+	gss_inquire_context(_status,
+			gss_ctx,
+			NULL,
+			

CVS commit: src/external/bsd/openldap

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:15:04 UTC 2021

Modified Files:
src/external/bsd/openldap: openldap.mk
src/external/bsd/openldap/bin: Makefile.inc
src/external/bsd/openldap/dist/build: mkversion version.h
src/external/bsd/openldap/dist/clients/tools: common.c common.h
ldapcompare.c ldapdelete.c ldapexop.c ldapmodify.c ldapmodrdn.c
ldappasswd.c ldapsearch.c ldapurl.c ldapvc.c ldapwhoami.c
src/external/bsd/openldap/dist/contrib/ldapc++/src: LDAPAddRequest.h
LDAPAsynConnection.h LDAPAttrType.h LDAPAttribute.h
LDAPAttributeList.h LDAPBindRequest.h LDAPCompareRequest.h
LDAPConnection.h LDAPConstraints.h LDAPControl.h LDAPControlSet.h
LDAPDeleteRequest.h LDAPEntry.h LDAPEntryList.h LDAPException.h
LDAPExtRequest.h LDAPExtResult.h LDAPMessage.h LDAPMessageQueue.h
LDAPModDNRequest.h LDAPModList.h LDAPModification.h
LDAPModifyRequest.h LDAPObjClass.h LDAPRebind.h LDAPRebindAuth.h
LDAPReferenceList.h LDAPRequest.h LDAPResult.h LDAPSaslBindResult.h
LDAPSchema.h LDAPSearchReference.h LDAPSearchRequest.h
LDAPSearchResult.h LDAPSearchResults.h LDAPUrl.h LDAPUrlList.h
LdifReader.h LdifWriter.h SaslInteraction.h
SaslInteractionHandler.h StringList.h TlsOptions.h debug.h
src/external/bsd/openldap/dist/contrib/ldapc++/src/ac: time.h
src/external/bsd/openldap/dist/contrib/ldaptcl: neoXldap.c tclAppInit.c
tkAppInit.c
src/external/bsd/openldap/dist/contrib/slapd-modules/acl: gssacl.c
posixgroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/addpartial:
addpartial-overlay.c
src/external/bsd/openldap/dist/contrib/slapd-modules/adremap: adremap.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allop: allop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allowed: allowed.c
src/external/bsd/openldap/dist/contrib/slapd-modules/authzid: authzid.c
src/external/bsd/openldap/dist/contrib/slapd-modules/autogroup:
autogroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/cloak: cloak.c
src/external/bsd/openldap/dist/contrib/slapd-modules/comp_match: asn.h
asn_to_syn_mr.c authorityKeyIdentifier.c authorityKeyIdentifier.h
certificate.c certificate.h componentlib.c componentlib.h crl.c
crl.h init.c
src/external/bsd/openldap/dist/contrib/slapd-modules/datamorph:
datamorph.c
src/external/bsd/openldap/dist/contrib/slapd-modules/denyop: denyop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dsaschema:
dsaschema.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dupent: dupent.c
src/external/bsd/openldap/dist/contrib/slapd-modules/kinit: kinit.c
src/external/bsd/openldap/dist/contrib/slapd-modules/lastbind:
lastbind.c
src/external/bsd/openldap/dist/contrib/slapd-modules/lastmod: lastmod.c
src/external/bsd/openldap/dist/contrib/slapd-modules/noopsrch:
noopsrch.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nops: nops.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nssov: alias.c
ether.c group.c host.c netgroup.c network.c nssov.c nssov.h pam.c
passwd.c protocol.c rpc.c service.c shadow.c

src/external/bsd/openldap/dist/contrib/slapd-modules/nssov/nss-pam-ldapd:
attrs.h nslcd-prot.h nslcd.h tio.c tio.h
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd: apr1.c
kerberos.c netscape.c radius.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/pbkdf2:
pw-pbkdf2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/sha2:
sha2.c sha2.h slapd-sha2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/totp:
slapd-totp.c
src/external/bsd/openldap/dist/contrib/slapd-modules/ppm: ppm.c ppm.h
ppm_test.c
src/external/bsd/openldap/dist/contrib/slapd-modules/proxyOld:
proxyOld.c
src/external/bsd/openldap/dist/contrib/slapd-modules/rbac: init.c jts.c
ldap_rbac.h rbac.c rbac.h rbacacl.c rbacaudit.c rbacperm.c
rbacreq.c rbacsess.c rbacuser.c util.c
src/external/bsd/openldap/dist/contrib/slapd-modules/samba4: pguid.c
rdnval.c vernum.c
src/external/bsd/openldap/dist/contrib/slapd-modules/smbk5pwd:
smbk5pwd.c
src/external/bsd/openldap/dist/contrib/slapd-modules/trace: trace.c
src/external/bsd/openldap/dist/contrib/slapd-modules/usn: usn.c
src/external/bsd/openldap/dist/contrib/slapd-modules/variant: variant.c
src/external/bsd/openldap/dist/contrib/slapd-modules/vc: vc.c

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

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:05:42 UTC 2021

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

Log Message:
Import OpenLDAP 2.5.6:

OpenLDAP 2.5.6 Release (2021/07/27)
Fixed libldap buffer overflow (ITS#9578)
Fixed libldap missing mutex unlock on connection alloc failure 
(ITS#9590)
Fixed lloadd cn=config olcBkLloadClientMaxPending setting (ITS#8747)
Fixed slapd multiple config defaults (ITS#9363)
Fixed slapd ipv6 addresses to work with tcp wrappers (ITS#9603)
Fixed slapo-syncprov delete of nonexistent sessionlog (ITS#9608)
Build
Fixed library symbol versioning on Solaris (ITS#9591)
Fixed compile warning in libldap/tpool.c (ITS#9601)
Fixed compile wraning in libldap/tls_o.c (ITS#9602)
Contrib
Fixed ppm module for sysconfdir (ITS#7832)
Documentation
Updated guide to document multival, idlexp, and maxentrysize 
(ITS#9613, ITS#9614)

OpenLDAP 2.5.5 Release (2021/06/03)
Added libldap LDAP_OPT_TCP_USER_TIMEOUT support (ITS#9502)
Added lloadd tcp-user-timeout support (ITS#9502)
Added slapd-asyncmeta tcp-user-timeout support (ITS#9502)
Added slapd-ldap tcp-user-timeout support (ITS#9502)
Added slapd-meta tcp-user-timeout support (ITS#9502)
Fixed incorrect control OIDs for AuthZ Identity (ITS#9542)
Fixed libldap typo in util-int.c (ITS#9541)
Fixed libldap double free of LDAP_OPT_DEFBASE (ITS#9530)
Fixed libldap better TLS1.3 cipher suite handling (ITS#9521, ITS#9546)
Fixed lloadd multiple issues (ITS#8747)
Fixed slapd slap_op_time to avoid duplicates across restarts (ITS#9537)
Fixed slapd typo in daemon.c (ITS#9541)
Fixed slapd slapi compilation (ITS#9544)
Fixed slapd to handle empty DN in extended filters (ITS#9551)
Fixed slapd syncrepl searches with empty base (ITS#6467)
Fixed slapd syncrepl refresh on startup (ITS#9324, ITS#9534)
Fixed slapd abort due to typo (ITS#9561)
Fixed slapd-asyncmeta quarantine handling (ITS#8721)
Fixed slapd-asyncmeta to have a default operations timeout (ITS#9555)
Fixed slapd-ldap quarantine handling (ITS#8721)
Fixed slapd-mdb deletion of context entry (ITS#9531)
Fixed slapd-mdb off-by-one affecting search scope (ITS#9557)
Fixed slapd-meta quarantine handling (ITS#8721)
Fixed slapo-accesslog to record reqNewDN for modRDN ops (ITS#9552)
Fixed slapo-pcache locking during expiration (ITS#9529)
Build
Fixed slappw-argon2 module installation (ITS#9548)
Contrib
Update ldapc++/ldaptcl to use configure.ac (ITS#9554)
Documentation
ldap_first_attribute(3) - Document ldap_get_attribute_ber 
(ITS#8820)
ldap_modify(3) - Delete non-existent mod_next parameter (ITS#9559)

OpenLDAP 2.5.4 Release (2021/04/29)
Initial release for "general use".

OpenLDAP 2.4.59 Release (2021/06/03)
Fixed libldap TLSv1.3 cipher suites with OpenSSL 1.1.1 (ITS#9521)
Fixed libldap double free of LDAP_OPT_DEFBASE (ITS#9530)
Fixed slapd syncrepl handling of add+delete on single value attr 
(ITS#9295)
Fixed slapd-mdb cursor init check (ITS#9526)
Fixed slapd-mdb deletion of context entry (ITS#9531)
Fixed slapd-mdb off-by-one affecting search scope (ITS#9557)
Fixed slapo-pcache locking during expiration (ITS#9529)
Contrib
Fixed slapo-autogroup to not thrash thread context (ITS#9494)
Documentation
ldap_modify(3) - Delete non-existent mod_next parameter 
(ITS#9559)

OpenLDAP 2.4.58 Release (2021/03/16)
Fixed slapd validity checks for issuerAndThisUpdateCheck (ITS#9454)
Fixed slapd to alloc new conn struct after freeing old one (ITS#9458)
Fixed slapd syncrepl to check all contextCSNs (ITS#9282)
Fixed slapd-bdb lockdetect config (ITS#9449)

OpenLDAP 2.4.57 Release (2021/01/18)
Fixed ldapexop to use correct return code (ITS#9417)
Fixed slapd to remove asserts in UUIDNormalize (ITS#9391)
Fixed slapd to remove assert in csnValidate (ITS#9410)
Fixed slapd validity checks for issuerAndThisUpdateCheck (ITS#9411, 
ITS#9427)
Fixed slapd validity checks for serialNumberAndIssuerCheck (ITS#9404, 
ITS#9424)
Fixed slapd AVA sort with invalid RDN (ITS#9412)
Fixed slapd ldap_X509dn2bv to check for invalid BER after RDN count 
(ITS#9423, ITS#9425)
Fixed slapd saslauthz to remove asserts in validation (ITS#9406, 
ITS#9407)
Fixed slapd saslauthz to use slap_sl_free on normalized DN (ITS#9409)
Fixed slapd saslauthz SEGV in slap_parse_user (ITS#9413)
Fixed slapd modrdn memory leak (ITS#9420)

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

2021-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 11 11:16:49 UTC 2021

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

Log Message:
PR/56355: Brad Harder: dtrace triggers double-fault in supervisor mode


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c

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

Modified files:

Index: src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.3 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.4
--- src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.3	Sat May  2 07:37:17 2020
+++ src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c	Wed Aug 11 07:16:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.3 2020/05/02 11:37:17 maxv Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.4 2021/08/11 11:16:49 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -251,8 +251,9 @@ fbt_provide_module_cb(const char *name, 
 	/*
 	 * Exclude some more symbols which can be called from probe context.
 	 */
-	if (strcmp(name, "x86_curcpu") == 0 ||
-	strcmp(name, "x86_curlwp") == 0) {
+	if (strncmp(name, "trap", 4) ||
+	strncmp(name, "x86_curcpu", 10) == 0 ||
+	strncmp(name, "x86_curlwp", 10) == 0) {
 		return 0;
 	}
 #endif



CVS commit: src/lib/libpam/libpam

2021-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 11 09:12:07 UTC 2021

Modified Files:
src/lib/libpam/libpam: Makefile

Log Message:
cast from strchr fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libpam/libpam/Makefile

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

Modified files:

Index: src/lib/libpam/libpam/Makefile
diff -u src/lib/libpam/libpam/Makefile:1.27 src/lib/libpam/libpam/Makefile:1.28
--- src/lib/libpam/libpam/Makefile:1.27	Wed Aug 11 01:23:05 2021
+++ src/lib/libpam/libpam/Makefile	Wed Aug 11 05:12:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2021/08/11 05:23:05 rillig Exp $
+# $NetBSD: Makefile,v 1.28 2021/08/11 09:12:07 christos Exp $
 #-
 # Copyright (c) 1998 Juniper Networks, Inc.
 # All rights reserved.
@@ -54,8 +54,6 @@ NOPROFILE=
 
 WARNS=		6
 LINTFLAGS+=	-w
-# warning: call to 'strchr' effectively discards 'const' from argument
-LINTFLAGS.pam_putenv.c+= -X 346
 
 CPPFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR} -DHAVE_CONFIG_H -I${.CURDIR}
 #CPPFLAGS+= -DOPENPAM_DEBUG



CVS commit: src/external/bsd/openpam/dist/lib/libpam

2021-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 11 09:11:05 UTC 2021

Modified Files:
src/external/bsd/openpam/dist/lib/libpam: pam_putenv.c

Log Message:
use const for strchr assignment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/openpam/dist/lib/libpam/pam_putenv.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/openpam/dist/lib/libpam/pam_putenv.c
diff -u src/external/bsd/openpam/dist/lib/libpam/pam_putenv.c:1.3 src/external/bsd/openpam/dist/lib/libpam/pam_putenv.c:1.4
--- src/external/bsd/openpam/dist/lib/libpam/pam_putenv.c:1.3	Sat May  6 15:50:10 2017
+++ src/external/bsd/openpam/dist/lib/libpam/pam_putenv.c	Wed Aug 11 05:11:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_putenv.c,v 1.3 2017/05/06 19:50:10 christos Exp $	*/
+/*	$NetBSD: pam_putenv.c,v 1.4 2021/08/11 09:11:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: pam_putenv.c,v 1.3 2017/05/06 19:50:10 christos Exp $");
+__RCSID("$NetBSD: pam_putenv.c,v 1.4 2021/08/11 09:11:04 christos Exp $");
 
 #include 
 #include 
@@ -63,7 +63,8 @@ int
 pam_putenv(pam_handle_t *pamh,
 	const char *namevalue)
 {
-	char **env, *p;
+	char **env; 
+	const char *p;
 	size_t env_size;
 	int i;
 
@@ -78,10 +79,11 @@ pam_putenv(pam_handle_t *pamh,
 	/* see if the variable is already in the environment */
 	if ((i = openpam_findenv(pamh, namevalue,
 	(size_t)(p - namevalue))) >= 0) {
-		if ((p = strdup(namevalue)) == NULL)
+		char *q;
+		if ((q = strdup(namevalue)) == NULL)
 			RETURNC(PAM_BUF_ERR);
 		FREE(pamh->env[i]);
-		pamh->env[i] = p;
+		pamh->env[i] = q;
 		RETURNC(PAM_SUCCESS);
 	}
 



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

2021-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 10 10:43:42 UTC 2021

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.7 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.8
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.7	Mon Apr 26 14:06:09 2021
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc	Tue Aug 10 06:43:42 2021
@@ -1,6 +1,7 @@
 .include "mips.inc"
 
-.if ${MIPS_LE}
+# Don't include mips.S for 32 bit mips because it does not work for mips1
+.if ${MIPS_LE} && ${MIPS_64} == "64"
 .PATH.S: ${.PARSEDIR}
 
 BN_SRCS = mips${MIPS_64}.S



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

2021-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 10 10:38:42 UTC 2021

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc:1.2	Sun Jun 21 18:16:08 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc	Tue Aug 10 06:38:42 2021
@@ -1,5 +1,8 @@
 .PATH.S: ${.PARSEDIR}
+# Limit bn-sparcv8.S to sparc64; breaks on sparcstation 2 (sun4c)
+.if ${MACHINE} == "sparc64"
 # XXX bn-sparcv8plus.S doesn't work well. why?
 BN_SRCS = bn-sparcv8.S
 AFLAGS.bn-sparcv8.S+= -Wa,-Av9
+.endif
 .include "../../bn.inc"



CVS commit: src/sys/netinet

2021-08-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug  4 08:47:10 UTC 2021

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

Log Message:
Get the value of the right variable (from RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/sys/netinet/tcp_usrreq.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/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.229 src/sys/netinet/tcp_usrreq.c:1.230
--- src/sys/netinet/tcp_usrreq.c:1.229	Mon Mar  8 13:17:27 2021
+++ src/sys/netinet/tcp_usrreq.c	Wed Aug  4 04:47:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.229 2021/03/08 18:17:27 christos Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.230 2021/08/04 08:47:10 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.229 2021/03/08 18:17:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.230 2021/08/04 08:47:10 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -480,7 +480,7 @@ tcp_ctloutput(int op, struct socket *so,
 			optval = tp->t_keepcnt;
 			goto setval;
 		case TCP_KEEPINIT:
-			optval = tp->t_keepcnt;
+			optval = tp->t_keepinit;
 setval:			error = sockopt_set(sopt, , sizeof(optval));
 			break;
 		default:



CVS commit: src/usr.bin/ldd

2021-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 22 17:39:53 UTC 2021

Modified Files:
src/usr.bin/ldd: ldd.c ldd.h ldd_elfxx.c

Log Message:
rtld expects an absolute path in execname provided via AUXV in order to
handle $ORIGIN properly and checks for that. Since we are calling its guts
directly, provide one.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ldd/ldd.h src/usr.bin/ldd/ldd_elfxx.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/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.23 src/usr.bin/ldd/ldd.c:1.24
--- src/usr.bin/ldd/ldd.c:1.23	Mon Dec 25 00:08:49 2017
+++ src/usr.bin/ldd/ldd.c	Thu Jul 22 13:39:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $	*/
+/*	$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -123,6 +123,7 @@ main(int argc, char **argv)
 {
 	const char *fmt1 = NULL, *fmt2 = NULL;
 	int c, exit_status = EXIT_SUCCESS;
+	char cwd[MAXPATHLEN], path[MAXPATHLEN];
 
 #ifdef DEBUG
 	debug = 1;
@@ -154,22 +155,28 @@ main(int argc, char **argv)
 		usage();
 		/*NOTREACHED*/
 	}
+	if (getcwd(cwd, sizeof(cwd)) == NULL)
+		err(EXIT_FAILURE, "Can't get working directory");
 
 	for (; argc != 0; argc--, argv++) {
 		int fd;
 
+		if (**argv != '/')
+			snprintf(path, sizeof(path), "%s/%s", cwd, *argv);
+		else
+			strlcpy(path, *argv, sizeof(path));
 		fd = open(*argv, O_RDONLY);
 		if (fd == -1) {
 			exit_status = EXIT_FAILURE;
 			warn("%s", *argv);
 			continue;
 		}
-		if (elf_ldd(fd, *argv, fmt1, fmt2) == -1
+		if (elf_ldd(fd, *argv, path, fmt1, fmt2) == -1
 		/* Alpha never had 32 bit support. */
 #if (defined(_LP64) && !defined(ELF64_ONLY)) || defined(MIPS_N32)
-		&& elf32_ldd(fd, *argv, fmt1, fmt2) == -1
+		&& elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1
 #if defined(__mips__) && 0 /* XXX this is still hosed for some reason */
-		&& elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1
+		&& elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1
 #endif
 #endif
 		) {

Index: src/usr.bin/ldd/ldd.h
diff -u src/usr.bin/ldd/ldd.h:1.7 src/usr.bin/ldd/ldd.h:1.8
--- src/usr.bin/ldd/ldd.h:1.7	Sat Jul  7 20:53:44 2012
+++ src/usr.bin/ldd/ldd.h	Thu Jul 22 13:39:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.h,v 1.7 2012/07/08 00:53:44 matt Exp $	*/
+/*	$NetBSD: ldd.h,v 1.8 2021/07/22 17:39:53 christos Exp $	*/
 
 /*
  * Copyright (c) 2008 Matthew R. Green
@@ -28,14 +28,14 @@
  * SUCH DAMAGE.
  */
 
-int elf32_ldd(int, char *, const char *, const char *);
+int elf32_ldd(int, char *, char *, const char *, const char *);
 
 #ifdef _LP64
 #define LDD_ELF64
 #endif
 
 #ifdef LDD_ELF64
-int elf64_ldd(int, char *, const char *, const char *);
+int elf64_ldd(int, char *, char *, const char *, const char *);
 #define elf_ldd elf64_ldd
 #elif defined(ELF32_COMPAT)
 #define elf_ldd elf32_compat_ldd
Index: src/usr.bin/ldd/ldd_elfxx.c
diff -u src/usr.bin/ldd/ldd_elfxx.c:1.7 src/usr.bin/ldd/ldd_elfxx.c:1.8
--- src/usr.bin/ldd/ldd_elfxx.c:1.7	Tue Jan 10 16:11:25 2017
+++ src/usr.bin/ldd/ldd_elfxx.c	Thu Jul 22 13:39:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $	*/
+/*	$NetBSD: ldd_elfxx.c,v 1.8 2021/07/22 17:39:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $");
+__RCSID("$NetBSD: ldd_elfxx.c,v 1.8 2021/07/22 17:39:53 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -93,7 +93,7 @@ static void fmtprint(const char *, Obj_E
  * returns 0 on success and -1 on failure.
  */
 int
-ELFNAME(ldd)(int fd, char *path, const char *fmt1, const char *fmt2)
+ELFNAME(ldd)(int fd, char *prog, char *path, const char *fmt1, const char *fmt2)
 {
 	struct stat st;
 
@@ -132,7 +132,7 @@ ELFNAME(ldd)(int fd, char *path, const c
 	(void) _rtld_load_needed_objects(_rtld_objmain, 0);
 
 	if (fmt1 == NULL)
-		printf("%s:\n", _rtld_objmain->path);
+		printf("%s:\n", prog);
 	main_local = path;
 	main_progname = _rtld_objmain->path;
 	print_needed(_rtld_objmain, fmt1, fmt2);



CVS commit: src/lib/libc/stdio

2021-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 22 17:09:01 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c

Log Message:
revert changes to fflush.c (1.18) and fvwrite.c (1.25) until we investigate
collateral damage. Breaks h_intr.c test. Requested by RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/stdio/fflush.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.23 src/lib/libc/stdio/fflush.c:1.24
--- src/lib/libc/stdio/fflush.c:1.23	Fri Jul  9 05:24:16 2021
+++ src/lib/libc/stdio/fflush.c	Thu Jul 22 13:09:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.24 2021/07/22 17:09:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.24 2021/07/22 17:09:01 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,8 +45,6 @@ __RCSID("$NetBSD: fflush.c,v 1.23 2021/0
 #include 
 #include 
 #include 
-#include 
-
 #include "reentrant.h"
 #include "local.h"
 
@@ -107,18 +105,7 @@ __sflush(FILE *fp)
 
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
-		if (t == 0)
-			goto out;
-		if (t < 0) {
-			/* Reset _p and _w. */
-			if (p > fp->_p) {
-/* Some was written. */
-memmove(fp->_p, p, n);
-			}
-			fp->_p += n;
-			if ((fp->_flags & (__SLBF | __SNBF)) == 0)
-fp->_w -= n;
-out:
+		if (t <= 0) {
 			fp->_flags |= __SERR;
 			return EOF;
 		}



CVS commit: src/lib/libc/stdio

2021-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 22 17:08:15 UTC 2021

Modified Files:
src/lib/libc/stdio: fvwrite.c

Log Message:
revert changes to fflush.c (1.18) and fvwrite.c (1.25) until we investigate
collateral damage. Breaks h_intr.c test. Requested by RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/stdio/fvwrite.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/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.29 src/lib/libc/stdio/fvwrite.c:1.30
--- src/lib/libc/stdio/fvwrite.c:1.29	Mon Jul 19 06:00:32 2021
+++ src/lib/libc/stdio/fvwrite.c	Thu Jul 22 13:08:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.30 2021/07/22 17:08:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.30 2021/07/22 17:08:15 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -51,39 +51,6 @@ __RCSID("$NetBSD: fvwrite.c,v 1.29 2021/
 #include "local.h"
 #include "fvwrite.h"
 
-static int
-flush_adj(FILE *fp, struct __suio *uio, ssize_t w)
-{
-	int rc;
-
-	_DIAGASSERT(w >= 0);
-	_DIAGASSERT(fp->_w >= 0);
-
-	if ((rc = fflush(fp)) == 0)
-		return 0;
-
-	/*
-	 * If we have to return without writing the whole buffer,
-	 * adjust for how much fflush() has written for us.
-	 * `w' is the amt. of new user data just copied into our
-	 * internal buffer in _this_ fwrite() call.
- */
-	if (fp->_w < w)	{
-		/* some new data was also written */
-		ssize_t i = w - fp->_w;
-
-		/* adjust amt. written */
-		uio->uio_resid -= i;
-	} else {
-		/* only old stuff was written */
-
-		/* adjust _p and _w so user can retry */
-		fp->_p -= w;
-		fp->_w += w;
-	}
-	return rc;
-}
-
 /*
  * Write some memory regions.  Return zero on success, EOF on error.
  *
@@ -130,21 +97,15 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 		len = iov->iov_len; \
 		iov++; \
 	}
-#define WRITE(nw) \
-	w = (*fp->_write)(fp->_cookie, p, nw); \
-	if (w <= 0) \
-		goto err
-#define FLUSH(nw) \
-	if (flush_adj(fp, uio, nw)) \
-		goto err
-
 	if (fp->_flags & __SNBF) {
 		/*
 		 * Unbuffered: write up to BUFSIZ bytes at a time.
 		 */
 		do {
 			GETIOV(;);
-			WRITE(MIN(len, BUFSIZ));
+			w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ));
+			if (w <= 0)
+goto err;
 			p += w;
 			len -= w;
 		} while ((uio->uio_resid -= w) != 0);
@@ -195,10 +156,13 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 COPY(w);
 /* fp->_w -= w; */ /* unneeded */
 fp->_p += w;
-FLUSH(w);
+if (fflush(fp))
+	goto err;
 			} else if (len >= (size_t)(w = fp->_bf._size)) {
 /* write directly */
-WRITE((size_t)w);
+w = (*fp->_write)(fp->_cookie, p, (size_t)w);
+if (w <= 0)
+	goto err;
 			} else {
 /* fill and done */
 w = len;
@@ -232,9 +196,12 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 COPY(w);
 /* fp->_w -= w; */
 fp->_p += w;
-FLUSH(w);
+if (fflush(fp))
+	goto err;
 			} else if (s >= (w = fp->_bf._size)) {
-WRITE((size_t)w);
+w = (*fp->_write)(fp->_cookie, p, (size_t)w);
+if (w <= 0)
+ 	goto err;
 			} else {
 w = s;
 COPY(w);
@@ -243,7 +210,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 			}
 			if ((nldist -= w) == 0) {
 /* copied the newline: flush and forget */
-FLUSH(w);
+if (fflush(fp))
+	goto err;
 nlknown = 0;
 			}
 			p += w;



CVS commit: src/sys/ddb

2021-07-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 20 11:39:16 UTC 2021

Modified Files:
src/sys/ddb: db_panic.c

Log Message:
need  for COHERENCY_UNIT


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/ddb/db_panic.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/ddb/db_panic.c
diff -u src/sys/ddb/db_panic.c:1.9 src/sys/ddb/db_panic.c:1.10
--- src/sys/ddb/db_panic.c:1.9	Sat Jan 26 21:08:41 2019
+++ src/sys/ddb/db_panic.c	Tue Jul 20 07:39:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_panic.c,v 1.9 2019/01/27 02:08:41 pgoyette Exp $	*/
+/*	$NetBSD: db_panic.c,v 1.10 2021/07/20 11:39:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2002, 2006, 2007, 2009, 2013 The NetBSD Foundation, Inc.
@@ -27,8 +27,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_panic.c,v 1.9 2019/01/27 02:08:41 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_panic.c,v 1.10 2021/07/20 11:39:16 christos Exp $");
 
+#include 
 #include 
 #include 
 



CVS commit: src/sys/sys

2021-07-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 19 19:13:33 UTC 2021

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

Log Message:
Mention caution changing the defaults.


To generate a diff of this commit:
cvs rdiff -u -r1.697 -r1.698 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.697 src/sys/sys/param.h:1.698
--- src/sys/sys/param.h:1.697	Tue Jun 29 17:03:37 2021
+++ src/sys/sys/param.h	Mon Jul 19 15:13:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.697 2021/06/29 21:03:37 pgoyette Exp $	*/
+/*	$NetBSD: param.h,v 1.698 2021/07/19 19:13:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -200,13 +200,19 @@
 #define	dbtob(x)	((x) << DEV_BSHIFT)
 #define	btodb(x)	((x) >> DEV_BSHIFT)
 
-/* Coherency unit: assumed cache line size.  See also MIN_LWP_ALIGNMENT. */
+/*
+ * Coherency unit: assumed cache line size.  See also MIN_LWP_ALIGNMENT.
+ * The MD code depends on the current values of these constants. Don't
+ * change them without coordinating.
+ */
 #ifndef COHERENCY_UNIT
 #define	COHERENCY_UNIT		64
 #endif
 #ifndef CACHE_LINE_SIZE
 #define	CACHE_LINE_SIZE		64
 #endif
+
+
 #ifndef MAXCPUS
 #define	MAXCPUS			32
 #endif



CVS commit: src/sys/arch

2021-07-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 19 10:28:58 UTC 2021

Modified Files:
src/sys/arch/alpha/include: param.h
src/sys/arch/arm/include: param.h
src/sys/arch/riscv/include: param.h

Log Message:
Remove definitions for CACHE_LINE_SIZE and COHERENCY_UNIT which are the same
as the default.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/alpha/include/param.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/include/param.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/include/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/arch/alpha/include/param.h
diff -u src/sys/arch/alpha/include/param.h:1.49 src/sys/arch/alpha/include/param.h:1.50
--- src/sys/arch/alpha/include/param.h:1.49	Tue Jul  6 08:20:52 2021
+++ src/sys/arch/alpha/include/param.h	Mon Jul 19 06:28:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.49 2021/07/06 12:20:52 thorpej Exp $ */
+/* $NetBSD: param.h,v 1.50 2021/07/19 10:28:58 christos Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -84,8 +84,6 @@
  * EV4 (21064) and EV5 (21164) have a 32-byte cache line size.
  * EV6 (21264) and EV7 (21364) have a 64-byte cache line size.
  */
-#define	COHERENCY_UNIT	64
-#define	CACHE_LINE_SIZE	64
 
 /*
  * Constants related to network buffer management.

Index: src/sys/arch/arm/include/param.h
diff -u src/sys/arch/arm/include/param.h:1.23 src/sys/arch/arm/include/param.h:1.24
--- src/sys/arch/arm/include/param.h:1.23	Sun Aug 16 05:37:30 2020
+++ src/sys/arch/arm/include/param.h	Mon Jul 19 06:28:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.23 2020/08/16 09:37:30 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.24 2021/07/19 10:28:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -186,7 +186,4 @@
 #endif
 #endif /* _KERNEL */
 
-#define COHERENCY_UNIT		64
-#define CACHE_LINE_SIZE		64
-
 #endif /* _ARM_PARAM_H_ */

Index: src/sys/arch/riscv/include/param.h
diff -u src/sys/arch/riscv/include/param.h:1.5 src/sys/arch/riscv/include/param.h:1.6
--- src/sys/arch/riscv/include/param.h:1.5	Mon May 31 10:38:57 2021
+++ src/sys/arch/riscv/include/param.h	Mon Jul 19 06:28:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.5 2021/05/31 14:38:57 simonb Exp $ */
+/* $NetBSD: param.h,v 1.6 2021/07/19 10:28:58 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -96,9 +96,6 @@
 #define MSGBUFSIZE		65536	/* default message buffer size */
 #endif
 
-#define COHERENCY_UNIT		64
-#define CACHE_LINE_SIZE		64
-
 #define MAXCPUS			32
 
 #ifdef _KERNEL



CVS commit: src/lib/libkvm

2021-07-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 19 10:30:36 UTC 2021

Modified Files:
src/lib/libkvm: kvm_proc.c

Log Message:
Match the declaration in 


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/lib/libkvm/kvm_proc.c

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

Modified files:

Index: src/lib/libkvm/kvm_proc.c
diff -u src/lib/libkvm/kvm_proc.c:1.94 src/lib/libkvm/kvm_proc.c:1.95
--- src/lib/libkvm/kvm_proc.c:1.94	Wed Dec 11 15:19:27 2019
+++ src/lib/libkvm/kvm_proc.c	Mon Jul 19 06:30:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_proc.c,v 1.94 2019/12/11 20:19:27 ad Exp $	*/
+/*	$NetBSD: kvm_proc.c,v 1.95 2021/07/19 10:30:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_proc.c	8.3 (Berkeley) 9/23/93";
 #else
-__RCSID("$NetBSD: kvm_proc.c,v 1.94 2019/12/11 20:19:27 ad Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.95 2021/07/19 10:30:36 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -159,7 +159,9 @@ struct miniproc {
  */
 struct kvm_kauth_cred {
 	u_int cr_refcnt;		/* reference count */
-	uint8_t cr_pad[CACHE_LINE_SIZE - sizeof(u_int)];
+#if COHERENCY_UNIT > 4
+	uint8_t cr_pad[COHERENCY_UNIT - 4];
+#endif
 	uid_t cr_uid;			/* user id */
 	uid_t cr_euid;			/* effective user id */
 	uid_t cr_svuid;			/* saved effective user id */



CVS commit: src/lib/libc/stdio

2021-07-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 19 10:00:33 UTC 2021

Modified Files:
src/lib/libc/stdio: fvwrite.c

Log Message:
There's no need to adjust `iov' in the error path.
Returning the amount written is all that's needed.
from RVP


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdio/fvwrite.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/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.28 src/lib/libc/stdio/fvwrite.c:1.29
--- src/lib/libc/stdio/fvwrite.c:1.28	Fri Jul 16 08:34:10 2021
+++ src/lib/libc/stdio/fvwrite.c	Mon Jul 19 06:00:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: fvwrite.c,v 1.28 2021/
 #include "fvwrite.h"
 
 static int
-flush_adj(FILE *fp, struct __suio *uio, struct __siov *iov, ssize_t w)
+flush_adj(FILE *fp, struct __suio *uio, ssize_t w)
 {
 	int rc;
 
@@ -74,7 +74,6 @@ flush_adj(FILE *fp, struct __suio *uio, 
 
 		/* adjust amt. written */
 		uio->uio_resid -= i;
-		iov->iov_len -= i;
 	} else {
 		/* only old stuff was written */
 
@@ -136,7 +135,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	if (w <= 0) \
 		goto err
 #define FLUSH(nw) \
-	if (flush_adj(fp, uio, iov - 1, nw)) \
+	if (flush_adj(fp, uio, nw)) \
 		goto err
 
 	if (fp->_flags & __SNBF) {



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

2021-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 17 16:31:51 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h

Log Message:
provide an equivalent alignment for __float128 for clang and i386 that
does not have it. Idea from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h
diff -u src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.11
--- src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10	Wed Jul 14 09:24:58 2021
+++ src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h	Sat Jul 17 12:31:51 2021
@@ -420,9 +420,14 @@ typedef struct {
  use __float128 here; that is only available on some
  architectures, but only on i386 is extra alignment needed for
  __float128.  */
-#if defined(__i386__) && !defined(__clang__)
+#if defined(__i386__)
+#ifdef __clang__
+  // 16 is the gcc alignment for __float128
+  long long __max_align_128 __attribute__((__aligned__(16)));
+#else
   __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128;
 #endif
+#endif
 } max_align_t;
 #endif
 #endif /* C11 or C++11.  */



CVS commit: src/lib/libc/stdio

2021-07-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 16 12:34:10 UTC 2021

Modified Files:
src/lib/libc/stdio: fvwrite.c

Log Message:
When fflush fails, adjust pointers and the io vectors. From RVP. Fixes
core-dump at cvs(1) exit(3).


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/stdio/fvwrite.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/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.27 src/lib/libc/stdio/fvwrite.c:1.28
--- src/lib/libc/stdio/fvwrite.c:1.27	Thu Jul  8 05:06:51 2021
+++ src/lib/libc/stdio/fvwrite.c	Fri Jul 16 08:34:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.27 2021/07/08 09:06:51 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.27 2021/07/08 09:06:51 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -51,6 +51,40 @@ __RCSID("$NetBSD: fvwrite.c,v 1.27 2021/
 #include "local.h"
 #include "fvwrite.h"
 
+static int
+flush_adj(FILE *fp, struct __suio *uio, struct __siov *iov, ssize_t w)
+{
+	int rc;
+
+	_DIAGASSERT(w >= 0);
+	_DIAGASSERT(fp->_w >= 0);
+
+	if ((rc = fflush(fp)) == 0)
+		return 0;
+
+	/*
+	 * If we have to return without writing the whole buffer,
+	 * adjust for how much fflush() has written for us.
+	 * `w' is the amt. of new user data just copied into our
+	 * internal buffer in _this_ fwrite() call.
+ */
+	if (fp->_w < w)	{
+		/* some new data was also written */
+		ssize_t i = w - fp->_w;
+
+		/* adjust amt. written */
+		uio->uio_resid -= i;
+		iov->iov_len -= i;
+	} else {
+		/* only old stuff was written */
+
+		/* adjust _p and _w so user can retry */
+		fp->_p -= w;
+		fp->_w += w;
+	}
+	return rc;
+}
+
 /*
  * Write some memory regions.  Return zero on success, EOF on error.
  *
@@ -102,10 +136,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	if (w <= 0) \
 		goto err
 #define FLUSH(nw) \
-	if (fflush(fp)) { \
-		fp->_p -= nw;	/* rewind unwritten */ \
-		goto err; \
-	}
+	if (flush_adj(fp, uio, iov - 1, nw)) \
+		goto err
 
 	if (fp->_flags & __SNBF) {
 		/*



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

2021-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 14 13:24:59 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h

Log Message:
clang does not support __float128 in our configuration and i386


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h
diff -u src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.9 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10
--- src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.9	Sat Apr 10 20:02:17 2021
+++ src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h	Wed Jul 14 09:24:58 2021
@@ -420,7 +420,7 @@ typedef struct {
  use __float128 here; that is only available on some
  architectures, but only on i386 is extra alignment needed for
  __float128.  */
-#ifdef __i386__
+#if defined(__i386__) && !defined(__clang__)
   __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128;
 #endif
 } max_align_t;



CVS commit: src/usr.sbin/npf/npfctl

2021-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 14 09:15:01 UTC 2021

Modified Files:
src/usr.sbin/npf/npfctl: npfctl.c

Log Message:
PR/56307: Konrad Schroder: npfctl's error messages don't report the failing
filename.
Add the filename (but in quotes for consistency with other places in the file).
Also fix an err -> errx


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.sbin/npf/npfctl/npfctl.c

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npfctl.c
diff -u src/usr.sbin/npf/npfctl/npfctl.c:1.64 src/usr.sbin/npf/npfctl/npfctl.c:1.65
--- src/usr.sbin/npf/npfctl/npfctl.c:1.64	Sat May 30 10:16:56 2020
+++ src/usr.sbin/npf/npfctl/npfctl.c	Wed Jul 14 05:15:01 2021
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: npfctl.c,v 1.64 2020/05/30 14:16:56 rmind Exp $");
+__RCSID("$NetBSD: npfctl.c,v 1.65 2021/07/14 09:15:01 christos Exp $");
 
 #include 
 #include 
@@ -301,17 +301,18 @@ npfctl_import(const char *path)
 	 * just leaving this responsibility for the caller.
 	 */
 	if ((fd = open(path, O_RDONLY)) == -1) {
-		err(EXIT_FAILURE, "could not open `%s'", path);
+		err(EXIT_FAILURE, "open: '%s'", path);
 	}
 	if (fstat(fd, ) == -1) {
-		err(EXIT_FAILURE, "stat");
+		err(EXIT_FAILURE, "stat: '%s'", path);
 	}
 	if ((blen = sb.st_size) == 0) {
-		err(EXIT_FAILURE, "the binary configuration file is empty");
+		errx(EXIT_FAILURE,
+		"the binary configuration file '%s' is empty", path);
 	}
 	blob = mmap(NULL, blen, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
 	if (blob == MAP_FAILED) {
-		err(EXIT_FAILURE, "mmap");
+		err(EXIT_FAILURE, "mmap: '%s'", path);
 	}
 	ncf = npf_config_import(blob, blen);
 	munmap(blob, blen);
@@ -329,7 +330,7 @@ npfctl_load(int fd)
 	 */
 	ncf = npfctl_import(NPF_DB_PATH);
 	if (ncf == NULL) {
-		err(EXIT_FAILURE, "npf_config_import");
+		err(EXIT_FAILURE, "npf_config_import: '%s'", NPF_DB_PATH);
 	}
 	if ((errno = npf_config_submit(ncf, fd, )) != 0) {
 		npfctl_print_error();
@@ -345,7 +346,7 @@ npfctl_open_dev(const char *path)
 	int fd;
 
 	if (lstat(path, ) == -1) {
-		err(EXIT_FAILURE, "fstat");
+		err(EXIT_FAILURE, "fstat: '%s'", path);
 	}
 	if ((st.st_mode & S_IFMT) == S_IFSOCK) {
 		struct sockaddr_un addr;
@@ -358,11 +359,11 @@ npfctl_open_dev(const char *path)
 		strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1);
 
 		if (connect(fd, (struct sockaddr *), sizeof(addr)) == -1) {
-			err(EXIT_FAILURE, "connect");
+			err(EXIT_FAILURE, "connect: '%s'", path);
 		}
 	} else {
 		if ((fd = open(path, O_RDONLY)) == -1) {
-			err(EXIT_FAILURE, "cannot open '%s'", path);
+			err(EXIT_FAILURE, "open: '%s'", path);
 		}
 	}
 	return fd;
@@ -416,7 +417,8 @@ npfctl_debug(int argc, char **argv)
 		puts("Loading the active configuration");
 		fd = npfctl_open_dev(NPF_DEV_PATH);
 		if ((ncf = npf_config_retrieve(fd)) == NULL) {
-			err(EXIT_FAILURE, "npf_config_retrieve");
+			err(EXIT_FAILURE, "npf_config_retrieve: '%s'",
+			NPF_DEV_PATH);
 		}
 	}
 



CVS commit: src/lib/libedit

2021-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 14 07:47:23 UTC 2021

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

Log Message:
Via Jess Thrysoee, from Adrian Bunk: Fix libedit build on Linux/Alpha
Alpha is the only Linux architecture that has SIGINFO:
https://sources.debian.org/src/manpages/5.10-1/man7/signal.7/#L522

But even on Alpha Ctrl-T is not supported, and therefore no VSTATUS:
https://sources.debian.org/src/manpages/5.10-1/man3/termios.3/#L603-L608

For consistency check both signal existence and character existence


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/lib/libedit/tty.c

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

Modified files:

Index: src/lib/libedit/tty.c
diff -u src/lib/libedit/tty.c:1.69 src/lib/libedit/tty.c:1.70
--- src/lib/libedit/tty.c:1.69	Sun May 31 19:24:23 2020
+++ src/lib/libedit/tty.c	Wed Jul 14 03:47:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.69 2020/05/31 23:24:23 christos Exp $	*/
+/*	$NetBSD: tty.c,v 1.70 2021/07/14 07:47:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)tty.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tty.c,v 1.69 2020/05/31 23:24:23 christos Exp $");
+__RCSID("$NetBSD: tty.c,v 1.70 2021/07/14 07:47:23 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -1350,19 +1350,19 @@ tty_get_signal_character(EditLine *el, i
 		return -1;
 #endif
 	switch (sig) {
-#ifdef SIGINT
+#if defined(SIGINT) && defined(VINTR)
 	case SIGINT:
 		return el->el_tty.t_c[ED_IO][VINTR];
 #endif
-#ifdef SIGQUIT
+#if defined(SIGQUIT) && defined(VQUIT)
 	case SIGQUIT:
 		return el->el_tty.t_c[ED_IO][VQUIT];
 #endif
-#ifdef SIGINFO
+#if defined(SIGINFO) && defined(VSTATUS)
 	case SIGINFO:
 		return el->el_tty.t_c[ED_IO][VSTATUS];
 #endif
-#ifdef SIGTSTP
+#if defined(SIGTSTP) && defined(VSUSP)
 	case SIGTSTP:
 		return el->el_tty.t_c[ED_IO][VSUSP];
 #endif



CVS commit: src/sys/ufs/ffs

2021-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 14 07:24:14 UTC 2021

Modified Files:
src/sys/ufs/ffs: ffs_vnops.c

Log Message:
Hook up ffsext_strategy to fifos. Pointed out by dholland@


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/ufs/ffs/ffs_vnops.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/ufs/ffs/ffs_vnops.c
diff -u src/sys/ufs/ffs/ffs_vnops.c:1.134 src/sys/ufs/ffs/ffs_vnops.c:1.135
--- src/sys/ufs/ffs/ffs_vnops.c:1.134	Tue Jun 29 18:34:09 2021
+++ src/sys/ufs/ffs/ffs_vnops.c	Wed Jul 14 03:24:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vnops.c,v 1.134 2021/06/29 22:34:09 dholland Exp $	*/
+/*	$NetBSD: ffs_vnops.c,v 1.135 2021/07/14 07:24:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.134 2021/06/29 22:34:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.135 2021/07/14 07:24:14 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -261,7 +261,7 @@ const struct vnodeopv_entry_desc ffs_fif
 	{ _lock_desc, ufs_lock },			/* lock */
 	{ _unlock_desc, ufs_unlock },		/* unlock */
 	{ _bmap_desc, vn_fifo_bypass },		/* bmap */
-	{ _strategy_desc, vn_fifo_bypass },		/* strategy */
+	{ _strategy_desc, ffsext_strategy },	/* strategy */
 	{ _print_desc, ufs_print },			/* print */
 	{ _islocked_desc, ufs_islocked },		/* islocked */
 	{ _pathconf_desc, vn_fifo_bypass },		/* pathconf */



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

2021-07-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 10 07:50:33 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_fmemopen.c

Log Message:
add more info to ease future debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/t_fmemopen.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/stdio/t_fmemopen.c
diff -u src/tests/lib/libc/stdio/t_fmemopen.c:1.4 src/tests/lib/libc/stdio/t_fmemopen.c:1.5
--- src/tests/lib/libc/stdio/t_fmemopen.c:1.4	Sat Oct 19 13:45:00 2013
+++ src/tests/lib/libc/stdio/t_fmemopen.c	Sat Jul 10 03:50:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fmemopen.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
+/* $NetBSD: t_fmemopen.c,v 1.5 2021/07/10 07:50:33 christos Exp $ */
 
 /*-
  * Copyright (c)2010 Takehiko NOZAKI,
@@ -964,7 +964,8 @@ ATF_TC_BODY(test19, tc)
 
 /* don't accept non nul character at end of buffer */
 			ATF_CHECK(fputc(0x1, fp) == EOF);
-			ATF_CHECK(ftello(fp) == (off_t)t->n);
+			ATF_CHECK_MSG(ftello(fp) == (off_t)t->n,
+"%td != %td", ftello(fp), (off_t)t->n);
 			ATF_CHECK(feof(fp) == 0);
 
 /* accept nul character at end of buffer */



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

2021-07-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 10 07:50:20 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: h_intr.c

Log Message:
space before star


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/h_intr.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/stdio/h_intr.c
diff -u src/tests/lib/libc/stdio/h_intr.c:1.4 src/tests/lib/libc/stdio/h_intr.c:1.5
--- src/tests/lib/libc/stdio/h_intr.c:1.4	Fri Jul  9 16:00:26 2021
+++ src/tests/lib/libc/stdio/h_intr.c	Sat Jul 10 03:50:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $	*/
+/*	$NetBSD: h_intr.c,v 1.5 2021/07/10 07:50:20 christos Exp $	*/
 
 /**
  * Test of interrupted I/O to popen()ed commands.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $");
+__RCSID("$NetBSD: h_intr.c,v 1.5 2021/07/10 07:50:20 christos Exp $");
 
 #include 
 #include 
@@ -48,12 +48,12 @@ static int rndmode(void);
 static sig_t xsignal(int signo, sig_t handler);
 static void alarmtimer(int wait);
 static void pr_star(int signo);
-static int do_opts(int argc, char* argv[]);
+static int do_opts(int argc, char *argv[]);
 static void usage(FILE *fp);
 
 /* Globals */
 static struct options {
-	const char* cmd;	/* cmd to run (which must read from stdin) */
+	const char *cmd;	/* cmd to run (which must read from stdin) */
 	size_t bsize;		/* block size to use */
 	size_t asize;		/* alt. stdio buffer size */
 	int btype;		/* buffering type: _IONBF, ... */
@@ -74,8 +74,8 @@ static const struct {
 
 static void (*alarm_fn)(int);/* real/dummy alarm fn. */
 static int (*sintr_fn)(int, int);			/*  " siginterrupt fn. */
-static ssize_t (*rd_fn)(FILE*, void*, size_t);		/* read fn. */
-static ssize_t (*wr_fn)(FILE*, const void*, size_t);	/* write fn. */
+static ssize_t (*rd_fn)(FILE *, void *, size_t);	/* read fn. */
+static ssize_t (*wr_fn)(FILE *, const void *, size_t);	/* write fn. */
 
 enum {
 	MB = 1024 * 1024,	/* a megabyte */
@@ -91,7 +91,7 @@ enum {
  * M A I N
  */
 int
-main(int argc, char* argv[])
+main(int argc, char *argv[])
 {
 	int i, rc = EXIT_SUCCESS;
 
@@ -205,9 +205,9 @@ fail:
  * maxread - syscall version
  */
 ssize_t
-smaxread(FILE* fp, void* buf, size_t size)
+smaxread(FILE* fp, void *buf, size_t size)
 {
-	char* p = buf;
+	char *p = buf;
 	ssize_t nrd = 0;
 	ssize_t n;
 
@@ -231,9 +231,9 @@ smaxread(FILE* fp, void* buf, size_t siz
  * maxread - stdio version
  */
 ssize_t
-maxread(FILE* fp, void* buf, size_t size)
+maxread(FILE* fp, void *buf, size_t size)
 {
-	char* p = buf;
+	char *p = buf;
 	ssize_t nrd = 0;
 	size_t n;
 
@@ -262,9 +262,9 @@ maxread(FILE* fp, void* buf, size_t size
  * maxwrite - syscall version
  */
 ssize_t
-smaxwrite(FILE* fp, const void* buf, size_t size)
+smaxwrite(FILE* fp, const void *buf, size_t size)
 {
-	const char* p = buf;
+	const char *p = buf;
 	ssize_t nwr = 0;
 	ssize_t n;
 
@@ -287,9 +287,9 @@ smaxwrite(FILE* fp, const void* buf, siz
  * maxwrite - stdio version (warning: substrate may be buggy)
  */
 ssize_t
-maxwrite(FILE* fp, const void* buf, size_t size)
+maxwrite(FILE* fp, const void *buf, size_t size)
 {
-	const char* p = buf;
+	const char *p = buf;
 	ssize_t nwr = 0;
 	size_t n;
 
@@ -412,7 +412,7 @@ btype2str(int val)
 }
 
 static int
-str2btype(const char* s)
+str2btype(const char *s)
 {
 	for (size_t i = 0; i < __arraycount(btypes); i++)
 		if (strcmp(btypes[i].name, s) == 0)



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

2021-07-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  9 15:26:59 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: h_intr.c t_intr.sh

Log Message:
fixes from RVP


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/stdio/h_intr.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdio/t_intr.sh

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

Modified files:

Index: src/tests/lib/libc/stdio/h_intr.c
diff -u src/tests/lib/libc/stdio/h_intr.c:1.2 src/tests/lib/libc/stdio/h_intr.c:1.3
--- src/tests/lib/libc/stdio/h_intr.c:1.2	Thu Jul  8 11:21:40 2021
+++ src/tests/lib/libc/stdio/h_intr.c	Fri Jul  9 11:26:59 2021
@@ -1,20 +1,20 @@
-/*	$NetBSD: h_intr.c,v 1.2 2021/07/08 15:21:40 christos Exp $	*/
+/*	$NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $	*/
 
 /**
- * Test of interrupted writes to popen()'ed commands.
+ * Test of interrupted I/O to popen()ed commands.
  *
  * Example 1:
- * ./h_fwrite -c "gzip -t" *.gz
+ * ./h_intr -c "gzip -t" *.gz
  *
  * Example 2:
- * while :; do ./h_fwrite -b $((12*1024)) -t 10 -c "bzip2 -t" *.bz2; sleep 2; done
+ * while :; do ./h_intr -b $((12*1024)) -t 10 -c "bzip2 -t" *.bz2; sleep 2; done
  *
  * Example 3:
  * Create checksum file:
  * find /mnt -type f -exec sha512 -n {} + >SHA512
  *
  * Check program:
- * find /mnt -type f -exec ./h_fwrite -b 512 -c run.sh {} +
+ * find /mnt -type f -exec ./h_intr -b 512 -c run.sh {} +
  * 
  * ./run.sh:
 	#!/bin/sh
@@ -25,7 +25,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: h_intr.c,v 1.2 2021/07/08 15:21:40 christos Exp $");
+__RCSID("$NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $");
 
 #include 
 #include 
@@ -38,25 +38,29 @@ __RCSID("$NetBSD: h_intr.c,v 1.2 2021/07
 #include 
 #include 
 
-static int process(const char *fn);
+static bool process(const char *fn);
 ssize_t maxread(FILE *fp, void *buf, size_t size);
 ssize_t smaxread(FILE *fp, void *buf, size_t size);
 ssize_t maxwrite(FILE *fp, const void *buf, size_t size);
 ssize_t smaxwrite(FILE *fp, const void *buf, size_t size);
+static int rndbuf(void);
+static int rndmode(void);
 static sig_t xsignal(int signo, sig_t handler);
 static void alarmtimer(int wait);
 static void pr_star(int signo);
-static bool isvalid(const char *s);
 static int do_opts(int argc, char* argv[]);
-static void usage(FILE* fp);
+static void usage(FILE *fp);
 
 /* Globals */
 static struct options {
-	size_t bsize;
-	size_t ssize;
-	int btype;
-	int tmout;
-	const char *cmd;
+	char* cmd;		/* cmd to run (which must read from stdin) */
+	size_t bsize;		/* block size to use */
+	size_t asize;		/* alt. stdio buffer size */
+	int btype;		/* buffering type: _IONBF, ... */
+	int tmout;		/* alarm timeout */
+	int flush;		/* call fflush() after write if 1 */
+	int rndbuf;		/* switch buffer randomly if 1 */
+	int rndmod;		/* switch buffering modes randomly if 1 */
 } opts;
 
 static const struct {
@@ -68,15 +72,24 @@ static const struct {
 	{ "IOFBF", _IOFBF },
 };
 
+static void (*alarm_fn)(int);/* real/dummy alarm fn. */
+static int (*sintr_fn)(int, int);			/*  " siginterrupt fn. */
+static ssize_t (*rd_fn)(FILE*, void*, size_t);		/* read fn. */
+static ssize_t (*wr_fn)(FILE*, const void*, size_t);	/* write fn. */
+
 enum {
-	MB = 1024 * 1024,
-	BSIZE = 16 * 1024,
-	DEF_MS = 100,
-	MS = 1000,
+	MB = 1024 * 1024,	/* a megabyte */
+	BSIZE = 16 * 1024,	/* default RW buffer size */
+	DEF_MS = 100,		/* interrupt 10x a second */
+	MS = 1000,		/* msecs. in a second */
 };
 
 
 
+
+/**
+ * M A I N
+ */
 int
 main(int argc, char* argv[])
 {
@@ -100,8 +113,8 @@ main(int argc, char* argv[])
 
 		sig_t osig = xsignal(SIGALRM, pr_star);
 
-		if (process(argv[i]) == 0)
-			printf("ok\n");
+		if (process(argv[i]) == true)
+			printf(" OK\n");
 		else
 			rc = EXIT_FAILURE;
 
@@ -111,46 +124,79 @@ main(int argc, char* argv[])
 	return rc;
 }
 
-static int
+static bool
 process(const char *fn)
 {
 	FILE *ifp, *ofp;
-	char *buf;
+	char *buf, *abuf;
+	int rc = false;
 	size_t nw = 0;
-	int rc = EXIT_FAILURE;
 	ssize_t n;
 
-	if ((buf = malloc(opts.bsize)) == NULL)
-		err(rc, "buffer alloc failed");
+	abuf = NULL;
+
+	if ((buf = malloc(opts.bsize)) == NULL) {
+		warn("buffer alloc failed");
+		return rc;
+	}
+
+	if ((abuf = malloc(opts.asize)) == NULL) {
+		warn("alt. buffer alloc failed");
+		goto fail;
+	}
 
 	if ((ifp = fopen(fn, "r")) == NULL) {
 		warn("fopen failed: %s", fn);
-		return rc;
+		goto fail;
+	}
+
+	if ((ofp = popen(opts.cmd, "w")) == NULL) {
+		warn("popen failed `%s'", opts.cmd);
+		goto fail;
 	}
 
-	if ((ofp = popen(opts.cmd, "w")) == NULL)
-		err(rc, "popen failed `%s'", opts.cmd);
+	setvbuf(ofp, NULL, opts.btype, opts.asize);
+	setvbuf(ifp, NULL, opts.btype, opts.asize);
 
-	setvbuf(ofp, NULL, opts.btype, opts.ssize);
-	setvbuf(ifp, NULL, opts.btype, opts.ssize);
+	alarm_fn(opts.tmout);
 
-	alarmtimer(opts.tmout);
-	while ((n = maxread(ifp, buf, opts.bsize)) > 0) {
+	while 

CVS commit: src/lib/libc/stdio

2021-07-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  9 09:24:16 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c

Log Message:
Don't adjust the buffers when write returns 0. This happens with fmemopen
and other synthetic write functions. This fixes the unit-tests for fmemopen,
but adjusting should be the right behavior for all cases?


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdio/fflush.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.22 src/lib/libc/stdio/fflush.c:1.23
--- src/lib/libc/stdio/fflush.c:1.22	Thu Jul  8 11:44:44 2021
+++ src/lib/libc/stdio/fflush.c	Fri Jul  9 05:24:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.22 2021/07/08 15:44:44 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.22 2021/07/08 15:44:44 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -107,7 +107,9 @@ __sflush(FILE *fp)
 
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
-		if (t <= 0) {
+		if (t == 0)
+			goto out;
+		if (t < 0) {
 			/* Reset _p and _w. */
 			if (p > fp->_p) {
 /* Some was written. */
@@ -116,6 +118,7 @@ __sflush(FILE *fp)
 			fp->_p += n;
 			if ((fp->_flags & (__SLBF | __SNBF)) == 0)
 fp->_w -= n;
+out:
 			fp->_flags |= __SERR;
 			return EOF;
 		}



CVS commit: src/lib/libc/stdio

2021-07-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  8 15:44:44 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c

Log Message:
Include the 0 return from write. Although the real write system call does
not return 0, the synthetic writes from funopen/fmemopen could. This avoids
infinite loops in >= test19 in fmemopen, but the tests still fail, perhaps
because they assume the previous behavior, where flush does not adjust the
stdio pointers on error.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/stdio/fflush.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.21 src/lib/libc/stdio/fflush.c:1.22
--- src/lib/libc/stdio/fflush.c:1.21	Thu Jul  8 05:06:51 2021
+++ src/lib/libc/stdio/fflush.c	Thu Jul  8 11:44:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.21 2021/07/08 09:06:51 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.22 2021/07/08 15:44:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.21 2021/07/08 09:06:51 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.22 2021/07/08 15:44:44 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -107,7 +107,7 @@ __sflush(FILE *fp)
 
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
-		if (t < 0) {
+		if (t <= 0) {
 			/* Reset _p and _w. */
 			if (p > fp->_p) {
 /* Some was written. */



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

2021-07-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  8 15:21:40 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: h_intr.c

Log Message:
fix printf format strings


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdio/h_intr.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/stdio/h_intr.c
diff -u src/tests/lib/libc/stdio/h_intr.c:1.1 src/tests/lib/libc/stdio/h_intr.c:1.2
--- src/tests/lib/libc/stdio/h_intr.c:1.1	Thu Jul  8 05:07:46 2021
+++ src/tests/lib/libc/stdio/h_intr.c	Thu Jul  8 11:21:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_intr.c,v 1.1 2021/07/08 09:07:46 christos Exp $	*/
+/*	$NetBSD: h_intr.c,v 1.2 2021/07/08 15:21:40 christos Exp $	*/
 
 /**
  * Test of interrupted writes to popen()'ed commands.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: h_intr.c,v 1.1 2021/07/08 09:07:46 christos Exp $");
+__RCSID("$NetBSD: h_intr.c,v 1.2 2021/07/08 15:21:40 christos Exp $");
 
 #include 
 #include 
@@ -144,7 +144,7 @@ process(const char *fn)
 		nw += i;
 	}
 	alarmtimer(0);
-	// printf("%lu\n", nw);
+	// printf("%zu\n", nw);
 
 	fclose(ifp);
 	if (pclose(ofp) != 0)
@@ -341,11 +341,11 @@ usage(FILE* fp)
 	fprintf(fp, "%s: Test interrupted writes to popen()ed CMD.\n",
 	getprogname());
 	fprintf(fp, "\n");
-	fprintf(fp, "  -b SIZE   Buffer size (%lu)\n", opts.bsize);
+	fprintf(fp, "  -b SIZE   Buffer size (%zu)\n", opts.bsize);
 	fprintf(fp, "  -c CMDCommand to run on each FILE.\n");
 	fprintf(fp, "  -hThis message.\n");
 	fprintf(fp, "  -pBuffering type %s.\n", getbtype(opts.btype));
-	fprintf(fp, "  -s SIZE   stdio buffer size (%lu)\n", opts.ssize);
+	fprintf(fp, "  -s SIZE   stdio buffer size (%zu)\n", opts.ssize);
 	fprintf(fp, "  -t TMOUT  Interrupt writing to CMD every (%d) ms\n",
 	opts.tmout);
 }



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

2021-07-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  8 12:30:20 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: Makefile

Log Message:
need to set BINDIR


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/stdio/Makefile

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/stdio/Makefile
diff -u src/tests/lib/libc/stdio/Makefile:1.15 src/tests/lib/libc/stdio/Makefile:1.16
--- src/tests/lib/libc/stdio/Makefile:1.15	Thu Jul  8 05:07:46 2021
+++ src/tests/lib/libc/stdio/Makefile	Thu Jul  8 08:30:20 2021
@@ -1,10 +1,12 @@
-# $NetBSD: Makefile,v 1.15 2021/07/08 09:07:46 christos Exp $
+# $NetBSD: Makefile,v 1.16 2021/07/08 12:30:20 christos Exp $
 
 NOMAN=
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/stdio
 
+BINDIR= ${TESTSDIR}
+
 TESTS_C+=	t_clearerr
 TESTS_C+=	t_fflush
 TESTS_C+=	t_fmemopen



CVS commit: src/distrib/sets/lists

2021-07-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  8 09:16:25 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
Add new interrupted stdio tests


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1078 -r1.1079 src/distrib/sets/lists/tests/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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.353 src/distrib/sets/lists/debug/mi:1.354
--- src/distrib/sets/lists/debug/mi:1.353	Mon May 17 00:07:41 2021
+++ src/distrib/sets/lists/debug/mi	Thu Jul  8 05:16:24 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.353 2021/05/17 04:07:41 yamaguchi Exp $
+# $NetBSD: mi,v 1.354 2021/07/08 09:16:24 christos Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2088,6 +2088,9 @@
 ./usr/libdata/debug/usr/tests/lib/libc/ssp/h_strncpy.debug		tests-lib-debug		debug,atf,ssp,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/ssp/h_vsnprintf.debug		tests-lib-debug		debug,atf,ssp,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/ssp/h_vsprintf.debug		tests-lib-debug		debug,atf,ssp,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdio/h_intr.debug		tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdio/h_makenumbers.debug	tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdio/h_testnumbers.debug	tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdio/t_clearerr.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdio/t_fflush.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdio/t_fmemopen.debug		tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1078 src/distrib/sets/lists/tests/mi:1.1079
--- src/distrib/sets/lists/tests/mi:1.1078	Thu Jul  8 01:18:49 2021
+++ src/distrib/sets/lists/tests/mi	Thu Jul  8 05:16:24 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1078 2021/07/08 05:18:49 rillig Exp $
+# $NetBSD: mi,v 1.1079 2021/07/08 09:16:24 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3063,12 +3063,16 @@
 ./usr/tests/lib/libc/stdiotests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/Atffile			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/Kyuafile			tests-lib-tests		compattestfile,atf,kyua
+./usr/tests/lib/libc/stdio/h_intr			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdio/h_makenumbers		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdio/h_testnumbers		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_clearerr			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_fflush			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_fmemopen			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_fopen			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_format			tests-obsolete		obsolete
 ./usr/tests/lib/libc/stdio/t_fputc			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdio/t_intr			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_mktemp			tests-obsolete		obsolete
 ./usr/tests/lib/libc/stdio/t_open_memstream		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_popen			tests-lib-tests		compattestfile,atf



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

2021-07-08 Thread Christos Zoulas
(EXIT_FAILURE, "Please specify a valid command with -c");
+
+	return optind;
+}
Index: src/tests/lib/libc/stdio/h_makenumbers.c
diff -u /dev/null src/tests/lib/libc/stdio/h_makenumbers.c:1.1
--- /dev/null	Thu Jul  8 05:07:46 2021
+++ src/tests/lib/libc/stdio/h_makenumbers.c	Thu Jul  8 05:07:46 2021
@@ -0,0 +1,19 @@
+#include 
+#include 
+#include 
+
+int
+main(int argc, char *argv[])
+{
+	size_t i = 0;
+	size_t maxi;
+
+	if (argc != 2)
+		errx(EXIT_FAILURE, "missing argument");
+
+	maxi = atoi(argv[1]);
+
+	while (i < maxi)
+		printf("%zu\n", i++);
+	return EXIT_SUCCESS;
+}
Index: src/tests/lib/libc/stdio/h_testnumbers.c
diff -u /dev/null src/tests/lib/libc/stdio/h_testnumbers.c:1.1
--- /dev/null	Thu Jul  8 05:07:46 2021
+++ src/tests/lib/libc/stdio/h_testnumbers.c	Thu Jul  8 05:07:46 2021
@@ -0,0 +1,16 @@
+#include 
+#include 
+#include 
+
+int
+main(void)
+{
+	char line[1024];
+	size_t i = 0;
+	while (fgets(line, sizeof(line), stdin) != NULL) {
+		if ((size_t)atoi(line) != i)
+			errx(EXIT_FAILURE, "bad line %s\n", line);
+		i++;
+	}
+	return EXIT_SUCCESS;
+}
Index: src/tests/lib/libc/stdio/t_intr.sh
diff -u /dev/null src/tests/lib/libc/stdio/t_intr.sh:1.1
--- /dev/null	Thu Jul  8 05:07:46 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Thu Jul  8 05:07:46 2021
@@ -0,0 +1,81 @@
+# $NetBSD: t_intr.sh,v 1.1 2021/07/08 09:07:46 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 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.
+#
+
+DIR=$(atf_get_srcdir)
+MAX=1000
+LMAX=100
+BSIZE=128000
+SSIZE=256000
+TMOUT=20
+
+h_test() {
+	"${DIR}/h_makenumbers" "$1" > numbers.in
+	"${DIR}/h_intr" \
+	-p "$2" -b ${BSIZE} -s ${SSIZE} -t ${TMOUT} \
+	-c "dd of=numbers.out msgfmt=quiet" numbers.in
+	"${DIR}/h_testnumbers" < numbers.out
+}
+
+atf_test_case stdio_intr_ionbf
+stdio_intr_ionbf_head()
+{
+	atf_set "descr" "Checks stdio EINTR _IONBF"
+}
+stdio_intr_ionbf_body()
+{
+	h_test ${MAX} IONBF
+}
+
+atf_test_case stdio_intr_iolbf
+stdio_intr_iolbf_head()
+{
+	atf_set "descr" "Checks stdio EINTR _IOLBF"
+}
+stdio_intr_iolbf_body()
+{
+	h_test ${LMAX} IOLBF
+}
+
+atf_test_case stdio_intr_iofbf
+stdio_intr_iofbf_head()
+{
+	atf_set "descr" "Checks stdio EINTR _IOFBF"
+}
+stdio_intr_iofbf_body()
+{
+	h_test ${MAX} IOFBF
+}
+
+atf_init_test_cases()
+{
+	atf_add_test_case stdio_intr_ionbf
+	atf_add_test_case stdio_intr_iolbf
+	atf_add_test_case stdio_intr_iofbf
+}



CVS commit: src/lib/libc/stdio

2021-07-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  8 09:06:51 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c fvwrite.c

Log Message:
Obey EINTR and return immediately adjusting for unwritten. From RVP


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/stdio/fflush.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/stdio/fvwrite.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.20 src/lib/libc/stdio/fflush.c:1.21
--- src/lib/libc/stdio/fflush.c:1.20	Tue Jul  6 10:22:16 2021
+++ src/lib/libc/stdio/fflush.c	Thu Jul  8 05:06:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.20 2021/07/06 14:22:16 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.21 2021/07/08 09:06:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.20 2021/07/06 14:22:16 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.21 2021/07/08 09:06:51 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -108,18 +108,14 @@ __sflush(FILE *fp)
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
 		if (t < 0) {
-			if (errno == EINTR) {
-t = 0;
-continue;
-			}
 			/* Reset _p and _w. */
 			if (p > fp->_p) {
 /* Some was written. */
 memmove(fp->_p, p, n);
-fp->_p += n;
-if ((fp->_flags & (__SLBF | __SNBF)) == 0)
-	fp->_w -= n;
 			}
+			fp->_p += n;
+			if ((fp->_flags & (__SLBF | __SNBF)) == 0)
+fp->_w -= n;
 			fp->_flags |= __SERR;
 			return EOF;
 		}

Index: src/lib/libc/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.26 src/lib/libc/stdio/fvwrite.c:1.27
--- src/lib/libc/stdio/fvwrite.c:1.26	Tue Jul  6 10:22:16 2021
+++ src/lib/libc/stdio/fvwrite.c	Thu Jul  8 05:06:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.26 2021/07/06 14:22:16 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.27 2021/07/08 09:06:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.26 2021/07/06 14:22:16 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.27 2021/07/08 09:06:51 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -99,12 +99,14 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	}
 #define WRITE(nw) \
 	w = (*fp->_write)(fp->_cookie, p, nw); \
-	if (w < 0) { \
-		if (errno != EINTR) \
-			goto err; \
-		w = 0; \
-	} else \
-		w = w
+	if (w <= 0) \
+		goto err
+#define FLUSH(nw) \
+	if (fflush(fp)) { \
+		fp->_p -= nw;	/* rewind unwritten */ \
+		goto err; \
+	}
+
 	if (fp->_flags & __SNBF) {
 		/*
 		 * Unbuffered: write up to BUFSIZ bytes at a time.
@@ -162,8 +164,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 COPY(w);
 /* fp->_w -= w; */ /* unneeded */
 fp->_p += w;
-if (fflush(fp))
-	goto err;
+FLUSH(w);
 			} else if (len >= (size_t)(w = fp->_bf._size)) {
 /* write directly */
 WRITE((size_t)w);
@@ -200,8 +201,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 COPY(w);
 /* fp->_w -= w; */
 fp->_p += w;
-if (fflush(fp))
-	goto err;
+FLUSH(w);
 			} else if (s >= (w = fp->_bf._size)) {
 WRITE((size_t)w);
 			} else {
@@ -212,8 +212,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 			}
 			if ((nldist -= w) == 0) {
 /* copied the newline: flush and forget */
-if (fflush(fp))
-	goto err;
+FLUSH(w);
 nlknown = 0;
 			}
 			p += w;



CVS commit: src/sbin/dump

2021-07-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul  7 11:06:37 UTC 2021

Modified Files:
src/sbin/dump: traverse.c

Log Message:
PR/56270: Matthias Scheler: dump fails on ffsv1: Zero c_extsize since ffsv1
does not support extended attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sbin/dump/traverse.c

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

Modified files:

Index: src/sbin/dump/traverse.c
diff -u src/sbin/dump/traverse.c:1.53 src/sbin/dump/traverse.c:1.54
--- src/sbin/dump/traverse.c:1.53	Sat Jun 19 09:56:34 2021
+++ src/sbin/dump/traverse.c	Wed Jul  7 07:06:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: traverse.c,v 1.53 2021/06/19 13:56:34 christos Exp $	*/
+/*	$NetBSD: traverse.c,v 1.54 2021/07/07 11:06:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1988, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)traverse.c	8.7 (Berkeley) 6/15/95";
 #else
-__RCSID("$NetBSD: traverse.c,v 1.53 2021/06/19 13:56:34 christos Exp $");
+__RCSID("$NetBSD: traverse.c,v 1.54 2021/07/07 11:06:37 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -502,6 +502,7 @@ dumpino(union dinode *dp, ino_t ino)
 			ffs_dinode1_swap(>dp1, _dinode);
 		else
 			spcl.c_dinode = dp->dp1;
+		spcl.c_extsize = 0;
 	} else {
 		if (needswap)
 			ffs_dinode2_swap(>dp2, >dp2);



CVS commit: src/lib/libc/stdio

2021-07-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  6 14:22:16 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c fvwrite.c

Log Message:
Handle EINTR, from RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/stdio/fflush.c
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/stdio/fvwrite.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.19 src/lib/libc/stdio/fflush.c:1.20
--- src/lib/libc/stdio/fflush.c:1.19	Mon Jul  5 03:26:00 2021
+++ src/lib/libc/stdio/fflush.c	Tue Jul  6 10:22:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.19 2021/07/05 07:26:00 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.20 2021/07/06 14:22:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.19 2021/07/05 07:26:00 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.20 2021/07/06 14:22:16 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -107,7 +107,11 @@ __sflush(FILE *fp)
 
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
-		if (t <= 0) {
+		if (t < 0) {
+			if (errno == EINTR) {
+t = 0;
+continue;
+			}
 			/* Reset _p and _w. */
 			if (p > fp->_p) {
 /* Some was written. */

Index: src/lib/libc/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.25 src/lib/libc/stdio/fvwrite.c:1.26
--- src/lib/libc/stdio/fvwrite.c:1.25	Tue Mar 27 11:05:42 2012
+++ src/lib/libc/stdio/fvwrite.c	Tue Jul  6 10:22:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.25 2012/03/27 15:05:42 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.26 2021/07/06 14:22:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.25 2012/03/27 15:05:42 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.26 2021/07/06 14:22:16 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -97,15 +97,21 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 		len = iov->iov_len; \
 		iov++; \
 	}
+#define WRITE(nw) \
+	w = (*fp->_write)(fp->_cookie, p, nw); \
+	if (w < 0) { \
+		if (errno != EINTR) \
+			goto err; \
+		w = 0; \
+	} else \
+		w = w
 	if (fp->_flags & __SNBF) {
 		/*
 		 * Unbuffered: write up to BUFSIZ bytes at a time.
 		 */
 		do {
 			GETIOV(;);
-			w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ));
-			if (w <= 0)
-goto err;
+			WRITE(MIN(len, BUFSIZ));
 			p += w;
 			len -= w;
 		} while ((uio->uio_resid -= w) != 0);
@@ -160,9 +166,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	goto err;
 			} else if (len >= (size_t)(w = fp->_bf._size)) {
 /* write directly */
-w = (*fp->_write)(fp->_cookie, p, (size_t)w);
-if (w <= 0)
-	goto err;
+WRITE((size_t)w);
 			} else {
 /* fill and done */
 w = len;
@@ -199,9 +203,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 if (fflush(fp))
 	goto err;
 			} else if (s >= (w = fp->_bf._size)) {
-w = (*fp->_write)(fp->_cookie, p, (size_t)w);
-if (w <= 0)
- 	goto err;
+WRITE((size_t)w);
 			} else {
 w = s;
 COPY(w);



CVS commit: src/doc

2021-07-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  6 12:26:03 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new acpica


To generate a diff of this commit:
cvs rdiff -u -r1.1804 -r1.1805 src/doc/3RDPARTY
cvs rdiff -u -r1.2813 -r1.2814 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.1804 src/doc/3RDPARTY:1.1805
--- src/doc/3RDPARTY:1.1804	Wed Jun 16 21:16:55 2021
+++ src/doc/3RDPARTY	Tue Jul  6 08:26:03 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1804 2021/06/17 01:16:55 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1805 2021/07/06 12:26:03 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -41,12 +41,12 @@
 #
 
 Package:	acpica
-Version:	20210331
-Current Vers:	20210331
+Version:	20210604
+Current Vers:	20210604
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/
 Home Page:	http://www.acpica.org/
-Date:		2021-04-03
+Date:		2021-07-06
 Mailing List:	de...@acpica.org
 License:	BSD-like
 Responsible:	jruoho

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2813 src/doc/CHANGES:1.2814
--- src/doc/CHANGES:1.2813	Tue Jun 29 06:26:17 2021
+++ src/doc/CHANGES	Tue Jul  6 08:26:03 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2813 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2814 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -335,7 +335,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bind: Import version 9.16.12. [christos 20210219]
 	OpenSSL: Imported 1.1.1j. [christos 20210219]
 	byacc: Update to 20210109. [christos 20210220]
-	regex: Add NLS support and gnu regex extensions (off by default).
+	regex(3): Add NLS support and gnu regex extensions (off by default).
 		[christos 20210223]
 	wpa: Import wpa_supplicant and hostapd 2.9. [christos 20210228]
 	tzcode: Updated to 2021a. [christos 20210228]
@@ -346,7 +346,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbppc: Add support for DHT Walnut 405GP evaluation board.
 		[rin 20210402]
 	acpi(4): Updated ACPICA to 20210331. [christos 20210403]
-	libevent: Import libevent 2.1.12 [christos 20210406]
+	event(3): Import libevent 2.1.12 [christos 20210406]
 	services(5), protocols(5): Pull iana-generated services and protocols.
 		[christos 20210408]
 	file(1): Upgraded to 5.40. [christos 20210409]
@@ -384,3 +384,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	m68k: Switch to GCC 10.  [mrg 20210619]
 	arm: Switch to GCC 10.  [mrg 20210619]
 	uscanner(4): Removed from the tree. [nia 20210629]
+	acpi(4): Updated ACPICA to 20210604. [christos 20210706]



CVS commit: src/sys/external/bsd/acpica/dist

2021-07-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  6 12:23:46 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/compiler: aslcompiler.h aslutils.c
dtfield.c dtutils.c
src/sys/external/bsd/acpica/dist/include: acdisasm.h acpixf.h actbl1.h
acutils.h
src/sys/external/bsd/acpica/dist/namespace: nsrepair2.c
src/sys/external/bsd/acpica/dist/utilities: utdelete.c utprint.c
utuuid.c

Log Message:
merge changes for acpica-20210604


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h
cvs rdiff -u -r1.28 -r1.29 \
src/sys/external/bsd/acpica/dist/compiler/aslutils.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/compiler/dtfield.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/compiler/dtutils.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/external/bsd/acpica/dist/include/acdisasm.h
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/acpica/dist/include/acpixf.h
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/acpica/dist/include/actbl1.h
cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/acpica/dist/include/acutils.h
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/namespace/nsrepair2.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/acpica/dist/utilities/utdelete.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/acpica/dist/utilities/utprint.c
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/acpica/dist/utilities/utuuid.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/acpica/dist/compiler/aslcompiler.h
diff -u src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h:1.18 src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h:1.19
--- src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h:1.18	Sat Apr  3 13:45:02 2021
+++ src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h	Tue Jul  6 08:23:46 2021
@@ -1116,6 +1116,10 @@ DbgPrint (
 #define ASL_PARSE_OUTPUT1
 #define ASL_TREE_OUTPUT 2
 
+BOOLEAN
+UtIsIdInteger (
+UINT8   *Target);
+
 UINT8
 UtIsBigEndianMachine (
 void);

Index: src/sys/external/bsd/acpica/dist/compiler/aslutils.c
diff -u src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.28 src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.29
--- src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.28	Sat Apr  3 13:45:02 2021
+++ src/sys/external/bsd/acpica/dist/compiler/aslutils.c	Tue Jul  6 08:23:46 2021
@@ -98,6 +98,46 @@ UtIsBigEndianMachine (
 }
 
 
+/***
+ *
+ * FUNCTION:UtIsIdInteger
+ *
+ * PARAMETERS:  Pointer to an ACPI ID (HID, CID) string
+ *
+ * RETURN:  TRUE if string is an integer
+ *  FALSE if string is not an integer
+ *
+ * DESCRIPTION: Determine whether the input ACPI ID string can be converted to
+ *  an integer value.
+ *
+ **/
+
+BOOLEAN
+UtIsIdInteger (
+UINT8   *Target)
+{
+UINT32  i;
+
+
+/* The first three characters of the string must be alphabetic */
+
+for (i = 0; i < 3; i++)
+{
+if (!isalpha ((int) Target[i]))
+{
+break;
+}
+}
+
+if (i < 3)
+{
+return (TRUE);
+}
+
+return (FALSE);
+}
+
+
 /**
  *
  * FUNCTION:UtQueryForOverwrite

Index: src/sys/external/bsd/acpica/dist/compiler/dtfield.c
diff -u src/sys/external/bsd/acpica/dist/compiler/dtfield.c:1.17 src/sys/external/bsd/acpica/dist/compiler/dtfield.c:1.18
--- src/sys/external/bsd/acpica/dist/compiler/dtfield.c:1.17	Sat Apr  3 13:45:02 2021
+++ src/sys/external/bsd/acpica/dist/compiler/dtfield.c	Tue Jul  6 08:23:46 2021
@@ -326,14 +326,14 @@ DtCompileInteger (
 {
 if (Value != 1)
 {
-DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+DtError (ASL_WARNING, ASL_MSG_RESERVED_FIELD, Field,
 "Must be one, setting to one");
 Value = 1;
 }
 }
 else if (Value != 0)
 {
-DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+DtError (ASL_WARNING, ASL_MSG_RESERVED_FIELD, Field,
 "Must be zero, setting to zero");
 Value = 0;
 }

Index: src/sys/external/bsd/acpica/dist/compiler/dtutils.c
diff -u src/sys/external/bsd/acpica/dist/compiler/dtutils.c:1.16 src/sys/external/bsd/acpica/dist/compiler/dtutils.c:1.17
--- src/sys/external/bsd/acpica/dist/compiler/dtutils.c:1.16	Sat Apr  3 13:45:02 2021
+++ src/sys/external/bsd/acpica/dist/compiler/dtutils.c	Tue Jul  6 08:23:46 2021
@@ -318,6 +318,7 @@ DtGetFieldType 

CVS import: src/sys/external/bsd/acpica/dist

2021-07-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  6 11:53:01 UTC 2021

Update of /cvsroot/src/sys/external/bsd/acpica/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv19767

Log Message:
Import acpica-20210604


04 June 2021. Summary of changes for version 20210604:

1) ACPICA kernel-resident subsystem:

Cleaned up (delete) the context mutex during local address handler object 
deletion.

Fixed a memory leak caused by the _CID repair function.

Added support for PlatformRtMechanism OperationRegion handler. Adds a new 
utility function, AcpiUtConvertUuidToString. Writing a buffer to a 
PlatformRtMechanism fieldunit invokes a bidirectional transaction. The 
input buffer contains 26 bytes containing 9 bytes of status, a command 
byte and a 16-byte UUID. This change will simply pass this incoming 
buffer to a handler registered by the OS.

2) iASL Compiler/Disassembler and ACPICA tools:

Added full support for the PRMT ACPI table (Platform Runtime Mechanism 
Table). Includes support in the iASL compiler, the disassembler, and the 
template generator.

Added full support for the BDAT (BIOS Data ACPI Table) ACPI table.

Added full support for the RGRT (Regulatory Graphics Resource Table) ACPI 
table.

Added full support for the SVKL (Storage Volume Key Location Table) ACPI 
table. Header file support from Kuppuswamy Sathyanarayanan 
.

Completed full support for the IVRS (I/O Virtualization Reporting 
Structure) ACPI table. Added compiler support for IVRS, updated 
disassembler support. Adds a new utility, UtIsIdInteger, to determine if 
a HID/CID is an integer or a string.

Headers: Added more structs to the CEDT table: CXL fixed memory window 
structure.

ACPI 6.4: MADT: added Multiprocessor Wakeup Mailbox Structure.


Status:

Vendor Tag: intel
Release Tags:   acpica-20210604

U src/sys/external/bsd/acpica/dist/changes.txt
U src/sys/external/bsd/acpica/dist/Makefile
U src/sys/external/bsd/acpica/dist/generate/lint/files.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/lint.bat
U src/sys/external/bsd/acpica/dist/generate/lint/lset.bat
U src/sys/external/bsd/acpica/dist/generate/lint/options.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/readme.txt
U src/sys/external/bsd/acpica/dist/generate/lint/std16.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std32.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std64.lnt
U src/sys/external/bsd/acpica/dist/generate/release/build.sh
U src/sys/external/bsd/acpica/dist/generate/release/release.sh
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.common
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.config
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.rules
U src/sys/external/bsd/acpica/dist/generate/unix/readme.txt
U src/sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpihelp/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile
U src/sys/external/bsd/acpica/dist/common/acfileio.c
U src/sys/external/bsd/acpica/dist/common/acgetline.c
U src/sys/external/bsd/acpica/dist/common/adfile.c
U src/sys/external/bsd/acpica/dist/common/adisasm.c
U src/sys/external/bsd/acpica/dist/common/adwalk.c
U src/sys/external/bsd/acpica/dist/common/ahids.c
U src/sys/external/bsd/acpica/dist/common/ahpredef.c
U src/sys/external/bsd/acpica/dist/common/ahtable.c
U src/sys/external/bsd/acpica/dist/common/ahuuids.c
U src/sys/external/bsd/acpica/dist/common/cmfsize.c
U src/sys/external/bsd/acpica/dist/common/dmextern.c
U src/sys/external/bsd/acpica/dist/common/dmrestag.c
U src/sys/external/bsd/acpica/dist/common/dmswitch.c
U src/sys/external/bsd/acpica/dist/common/dmtable.c
U src/sys/external/bsd/acpica/dist/common/dmtables.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump1.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump2.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump3.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo1.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo2.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo3.c
U src/sys/external/bsd/acpica/dist/common/getopt.c
U src/sys/external/bsd/acpica/dist/tests/misc/badcode.asl
U src/sys/external/bsd/acpica/dist/tests/misc/converterSample.asl
U src/sys/external/bsd/acpica/dist/tests/misc/grammar.asl
U src/sys/external/bsd/acpica/dist/tests/templates/Makefile
U src/sys/external/bsd/acpica/dist/tests/templates/templates.sh
U 

CVS commit: src/usr.bin/ftp

2021-07-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  6 09:26:47 UTC 2021

Modified Files:
src/usr.bin/ftp: fetch.c

Log Message:
Use raw write(2) instead of fwrite(3) to avoid stream corruption because
of the progress bar interrupts. From RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/usr.bin/ftp/fetch.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/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.232 src/usr.bin/ftp/fetch.c:1.233
--- src/usr.bin/ftp/fetch.c:1.232	Fri Jul 10 20:29:38 2020
+++ src/usr.bin/ftp/fetch.c	Tue Jul  6 05:26:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.232 2020/07/11 00:29:38 lukem Exp $	*/
+/*	$NetBSD: fetch.c,v 1.233 2021/07/06 09:26:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.232 2020/07/11 00:29:38 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.233 2021/07/06 09:26:47 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -138,6 +138,43 @@ static int	redirect_loop;
 	((urltype) == HTTP_URL_T)
 #endif
 
+/**
+ * fwrite(3) replacement that just uses write(2). Many stdio implementations
+ * don't handle interrupts properly and corrupt the output. We are taking
+ * alarm interrupts because of the progress bar.
+ *
+ * Assumes `fp' is pristine with no prior I/O calls on it.
+ */
+static size_t
+maxwrite(const void *buf, size_t size, size_t nmemb, FILE *fp)
+{
+	const char *p = buf;
+	ssize_t nwr = 0;
+	ssize_t n;
+	int fd = fileno(fp);
+
+	size *= nmemb;	/* assume no overflow */
+
+	while (size > 0) {
+		if ((n = write(fd, p, size)) == -1) {
+			switch (errno) {
+			case EINTR:
+			case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+			case EWOULDBLOCK:
+#endif
+continue;
+			default:
+return nwr;
+			}
+		}
+		p += n;
+		nwr += n;
+		size -= n;
+	}
+	return nwr;
+}
+
 /*
  * Determine if token is the next word in buf (case insensitive).
  * If so, advance buf past the token and any trailing LWS, and
@@ -1650,7 +1687,7 @@ fetch_url(const char *url, const char *p
 }
 bytes += flen;
 bufrem -= flen;
-if (fwrite(xferbuf, sizeof(char), flen, fout)
+if (maxwrite(xferbuf, sizeof(char), flen, fout)
 != flen) {
 	warn("Writing `%s'", savefile);
 	goto cleanup_fetch_url;



CVS commit: src/lib/libc/stdio

2021-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul  5 07:26:00 UTC 2021

Modified Files:
src/lib/libc/stdio: fflush.c

Log Message:
Account for partial writes when interrupted (from FreeBSD).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/stdio/fflush.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/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.18 src/lib/libc/stdio/fflush.c:1.19
--- src/lib/libc/stdio/fflush.c:1.18	Tue Mar 27 11:05:42 2012
+++ src/lib/libc/stdio/fflush.c	Mon Jul  5 03:26:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.18 2012/03/27 15:05:42 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.19 2021/07/05 07:26:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.18 2012/03/27 15:05:42 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.19 2021/07/05 07:26:00 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,6 +45,8 @@ __RCSID("$NetBSD: fflush.c,v 1.18 2012/0
 #include 
 #include 
 #include 
+#include 
+
 #include "reentrant.h"
 #include "local.h"
 
@@ -106,6 +108,14 @@ __sflush(FILE *fp)
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
 		if (t <= 0) {
+			/* Reset _p and _w. */
+			if (p > fp->_p) {
+/* Some was written. */
+memmove(fp->_p, p, n);
+fp->_p += n;
+if ((fp->_flags & (__SLBF | __SNBF)) == 0)
+	fp->_w -= n;
+			}
 			fp->_flags |= __SERR;
 			return EOF;
 		}



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd

2021-07-04 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sun Jul  4 07:03:16 UTC 2021

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd:
ppc_video.c

Log Message:
elide cast warning: error: cast from pointer to integer of different size


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.14 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.15
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.14	Sat Jul  3 05:43:29 2021
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c	Sun Jul  4 03:03:16 2021
@@ -61,7 +61,7 @@ volatile unsigned char *ioBase = MAP_FAI
 
 /* XXX why the hell is this necessary?! */
 #if defined(__arm__) || defined(__mips__)
-unsigned PORT_SIZE IOPortBase = (unsigned PORT_SIZE)MAP_FAILED;
+unsigned PORT_SIZE IOPortBase = (unsigned PORT_SIZE)(intptr_t)MAP_FAILED;
 #endif
 
 Bool



CVS commit: src/libexec/ftpd

2021-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  3 14:59:49 UTC 2021

Modified Files:
src/libexec/ftpd: ftpd.c

Log Message:
Treat failed chdir/chroot for guest and chroot accounts as fatal.
Also treat failed set{e,}(u,g}id calls as fatal.
Addresses CVE-2020-7468, via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/libexec/ftpd/ftpd.c

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

Modified files:

Index: src/libexec/ftpd/ftpd.c
diff -u src/libexec/ftpd/ftpd.c:1.205 src/libexec/ftpd/ftpd.c:1.206
--- src/libexec/ftpd/ftpd.c:1.205	Tue Oct 15 14:29:32 2019
+++ src/libexec/ftpd/ftpd.c	Sat Jul  3 10:59:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp $	*/
+/*	$NetBSD: ftpd.c,v 1.206 2021/07/03 14:59:49 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)ftpd.c	8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.206 2021/07/03 14:59:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1547,8 +1547,7 @@ do_pass(int pass_checked, int pass_rval,
 			"GUEST user %s: can't chdir to %s: %m",
 			pw->pw_name, homedir);
  bad_guest:
-			reply(550, "Can't set guest privileges.");
-			goto bad;
+			fatal("Can't set guest privileges.");
 		}
 		break;
 	case CLASS_CHROOT:
@@ -1571,8 +1570,7 @@ do_pass(int pass_checked, int pass_rval,
 			"CHROOT user %s: can't chdir to %s: %m",
 			pw->pw_name, homedir);
  bad_chroot:
-			reply(550, "Can't change root.");
-			goto bad;
+			fatal("Can't change root.");
 		}
 		break;
 	case CLASS_REAL:
@@ -1618,16 +1616,16 @@ do_pass(int pass_checked, int pass_rval,
 		dropprivs++;
 		if (setgid((gid_t)pw->pw_gid) < 0) {
 			reply(550, "Can't set gid.");
-			goto bad;
+			goto bad_perms;
 		}
 		if (setuid((uid_t)pw->pw_uid) < 0) {
 			reply(550, "Can't set uid.");
-			goto bad;
+			goto bad_perms;
 		}
 	} else {
 		if (seteuid((uid_t)pw->pw_uid) < 0) {
 			reply(550, "Can't set uid.");
-			goto bad;
+			goto bad_perms;
 		}
 	}
 	setenv("HOME", homedir, 1);
@@ -1686,6 +1684,11 @@ do_pass(int pass_checked, int pass_rval,
 #endif
 			/* Forget all about it... */
 	end_login();
+	return;
+
+bad_perms:
+	syslog(LOG_NOTICE, "user %s: can't setuid/gid: %m", pw->pw_name);
+	fatal("Can't drop privileges.");
 }
 
 void



CVS commit: src/lib/libc/gmon

2021-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  3 14:08:55 UTC 2021

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

Log Message:
PR/56246: Yuichiro Naito: gprof(1) never show call graphs when profiling
multi-threaded application


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/gmon/gmon.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/gmon/gmon.c
diff -u src/lib/libc/gmon/gmon.c:1.35 src/lib/libc/gmon/gmon.c:1.36
--- src/lib/libc/gmon/gmon.c:1.35	Thu Sep 18 09:58:20 2014
+++ src/lib/libc/gmon/gmon.c	Sat Jul  3 10:08:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: gmon.c,v 1.35 2014/09/18 13:58:20 christos Exp $	*/
+/*	$NetBSD: gmon.c,v 1.36 2021/07/03 14:08:55 christos Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #if 0
 static char sccsid[] = "@(#)gmon.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: gmon.c,v 1.35 2014/09/18 13:58:20 christos Exp $");
+__RCSID("$NetBSD: gmon.c,v 1.36 2021/07/03 14:08:55 christos Exp $");
 #endif
 #endif
 
@@ -231,6 +231,7 @@ _m_gmon_alloc(void)
 		PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, (off_t)0);
 		p = (void *)cp;
 		*p = _gmonparam;
+		p->state = GMON_PROF_ON;
 		p->kcount = NULL;
 		cp += sizeof (struct gmonparam);
 		memset(cp, 0, (size_t)(p->fromssize + p->tossize));



CVS commit: src/include

2021-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  3 14:07:13 UTC 2021

Modified Files:
src/include: stdlib.h

Log Message:
PR/56250: Michael Forney: mkstemp/mkdtemp not declared with
_POSIX_C_SOURCE=200809L


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/include/stdlib.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/stdlib.h
diff -u src/include/stdlib.h:1.122 src/include/stdlib.h:1.123
--- src/include/stdlib.h:1.122	Tue May 26 17:49:29 2020
+++ src/include/stdlib.h	Sat Jul  3 10:07:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdlib.h,v 1.122 2020/05/26 21:49:29 joerg Exp $	*/
+/*	$NetBSD: stdlib.h,v 1.123 2021/07/03 14:07:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -190,8 +190,6 @@ int	 mkostemp(char *, int);
 int	 mkostemps(char *, int, int);
 #endif
 
-char	*mkdtemp(char *);
-int	 mkstemp(char *);
 char	*mktemp(char *)
 #ifdef __MKTEMP_OK__
 	__RENAME(_mktemp)
@@ -206,8 +204,6 @@ int	 ttyslot(void);
 
 void	*valloc(size_t);		/* obsoleted by malloc() */
 
-int	 getsubopt(char **, char * const *, char **);
-
 int	 grantpt(int);
 int	 unlockpt(int);
 char	*ptsname(int);
@@ -256,6 +252,20 @@ int	 posix_memalign(void **, size_t, siz
 #endif
 
 /*
+ * The Open Group Base Specifications, Issue 7; IEEE Std 1003.1-2008 (POSIX)
+ *   or
+ * X/Open Portability Guide >= Issue 4 Version 2
+ */
+#if (_POSIX_C_SOURCE - 0) >= 200809L || \
+(defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
+(_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
+char	*mkdtemp(char *);
+int	 mkstemp(char *);
+
+int	 getsubopt(char **, char * const *, char **);
+#endif
+
+/*
  * Implementation-defined extensions
  */
 #if defined(_NETBSD_SOURCE)



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd

2021-07-02 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Fri Jul  2 19:31:47 UTC 2021

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd:
ppc_video.c

Log Message:
use PORT_SIZE from compiler.h instead of int.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.12 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.13
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.12	Tue Jun  1 20:33:22 2021
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c	Fri Jul  2 15:31:47 2021
@@ -60,7 +60,7 @@ volatile unsigned char *ioBase = MAP_FAI
 
 /* XXX why the hell is this necessary?! */
 #if defined(__arm__) || defined(__mips__)
-unsigned int IOPortBase = (int)MAP_FAILED;
+unsigned PORT_SIZE IOPortBase = (unsigned PORT_SIZE)MAP_FAILED;
 #endif
 
 Bool
@@ -95,7 +95,7 @@ xf86DisableIO()
 munmap(__UNVOLATILE(ioBase), 0x1);
 ioBase = MAP_FAILED;
 #ifdef __arm__
-IOPortBase = (unsigned int)MAP_FAILED;
+IOPortBase = (unsigned PORT_SIZE)MAP_FAILED;
 #endif
 }
 #endif



CVS commit: src/sys/kern

2021-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  1 04:25:51 UTC 2021

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

Log Message:
don't clear the error before we use it to determine if we are moving or duping.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/kern/vfs_vnops.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_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.218 src/sys/kern/vfs_vnops.c:1.219
--- src/sys/kern/vfs_vnops.c:1.218	Wed Jun 30 13:51:49 2021
+++ src/sys/kern/vfs_vnops.c	Thu Jul  1 00:25:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.218 2021/06/30 17:51:49 dholland Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.218 2021/06/30 17:51:49 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $");
 
 #include "veriexec.h"
 
@@ -339,10 +339,10 @@ out:
 			error = EOPNOTSUPP;
 			break;
 		}
-		error = 0;
 		*ret_vp = NULL;
 		*ret_domove = error == EMOVEFD;
 		*ret_fd = l->l_dupfd;
+		error = 0;
 		break;
 	case 0:
 		*ret_vp = vp;



CVS commit: src/sys/kern

2021-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 30 11:20:33 UTC 2021

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

Log Message:
PR/56286: Martin Husemann: Fix NULL deref on kmod load.
- No need to set ret_domove and ret_fd in the regular case, they are meaningless
- KASSERT instead of setting errno and then doing the NULL deref.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/kern/vfs_vnops.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_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.216 src/sys/kern/vfs_vnops.c:1.217
--- src/sys/kern/vfs_vnops.c:1.216	Tue Jun 29 18:40:53 2021
+++ src/sys/kern/vfs_vnops.c	Wed Jun 30 07:20:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.216 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.217 2021/06/30 11:20:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.216 2021/06/29 22:40:53 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.217 2021/06/30 11:20:32 christos Exp $");
 
 #include "veriexec.h"
 
@@ -328,35 +328,20 @@ bad:
 out:
 	pathbuf_stringcopy_put(nd.ni_pathbuf, pathstring);
 
-	/* if the caller isn't prepared to handle fds, fail for them */
-	if (ret_fd == NULL && (error == EDUPFD || error == EMOVEFD)) {
-		/*
-		 * XXX: for EMOVEFD (cloning devices) this leaks the
-		 * device's file descriptor. That's not good, but
-		 * fixing it here would still be a layer violation and
-		 * callers not currently prepared to deal weren't
-		 * prepared before I rearranged things either and
-		 * would still have leaked the fd, so it's at least
-		 * not a regression.
-		 *-- dholland 20210627
-		 */
-		error = EOPNOTSUPP;
-	}
-
-	if (error == EDUPFD) {
+	switch (error) {
+	case EDUPFD:
+	case EMOVEFD:
+		/* if the caller isn't prepared to handle fds, fail for them */
+		KASSERTMSG(ret_domove && ret_fd,
+		"caller did not supply ret_domove and ret_fd for %d",
+		error);
 		*ret_vp = NULL;
-		*ret_domove = false;
+		*ret_domove = error == EMOVEFD;
 		*ret_fd = l->l_dupfd;
-		error = 0;
-	} else if (error == EMOVEFD) {
-		*ret_vp = NULL;
-		*ret_domove = true;
-		*ret_fd = l->l_dupfd;
-		error = 0;
-	} else if (error == 0) {
+		break;
+	case 0:
 		*ret_vp = vp;
-		*ret_domove = false;
-		*ret_fd = -1;
+		break;
 	}
 	l->l_dupfd = 0;
 	return error;



CVS commit: src/lib/libcurses

2021-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 27 16:24:52 UTC 2021

Modified Files:
src/lib/libcurses: Makefile

Log Message:
Fix SSP build


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/lib/libcurses/Makefile

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

Modified files:

Index: src/lib/libcurses/Makefile
diff -u src/lib/libcurses/Makefile:1.94 src/lib/libcurses/Makefile:1.95
--- src/lib/libcurses/Makefile:1.94	Mon Mar 23 09:37:36 2020
+++ src/lib/libcurses/Makefile	Sun Jun 27 12:24:52 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.94 2020/03/23 13:37:36 roy Exp $
+#	$NetBSD: Makefile,v 1.95 2021/06/27 16:24:52 christos Exp $
 #	@(#)Makefile	8.2 (Berkeley) 1/2/94
 
 .include 
@@ -9,6 +9,9 @@ CPPFLAGS+=-I${.CURDIR} -I${NETBSDSRCDIR}
 .if defined(DEBUG_CURSES)
 CPPFLAGS+=-g -DDEBUG
 .endif
+
+COPTS.slk.c += -Wno-stack-protector
+
 .if defined(SMALL)
 CPPFLAGS+=-DSMALL
 .endif



CVS commit: src/sys/kern

2021-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 27 09:13:08 UTC 2021

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

Log Message:
factor out the ktrace printing into their own functions.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/vfs_xattr.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_xattr.c
diff -u src/sys/kern/vfs_xattr.c:1.35 src/sys/kern/vfs_xattr.c:1.36
--- src/sys/kern/vfs_xattr.c:1.35	Sat May 16 14:31:50 2020
+++ src/sys/kern/vfs_xattr.c	Sun Jun 27 05:13:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_xattr.c,v 1.35 2020/05/16 18:31:50 christos Exp $	*/
+/*	$NetBSD: vfs_xattr.c,v 1.36 2021/06/27 09:13:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.35 2020/05/16 18:31:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.36 2021/06/27 09:13:08 christos Exp $");
 
 #include 
 #include 
@@ -89,6 +89,18 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,
 
 #include 
 
+static void
+ktr_xattr_name(const char *str)
+{
+	ktrkuser("xattr-name", (void *)__UNCONST(str), strlen(str));
+}
+
+static void
+ktr_xattr_val(const void *data, size_t cnt)
+{
+	ktruser("xattr-val", __UNCONST(data), cnt, 0);
+}
+
 /*
  * Credential check based on process requesting service, and per-attribute
  * permissions.
@@ -250,8 +262,8 @@ extattr_set_vp(struct vnode *vp, int att
 	auio.uio_vmspace = l->l_proc->p_vmspace;
 	cnt = nbytes;
 
-	ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
-	ktruser("xattr-val", __UNCONST(data), nbytes, 0);
+	ktr_xattr_name(attrname);
+	ktr_xattr_val(data, nbytes);
 
 	error = VOP_SETEXTATTR(vp, attrnamespace, attrname, , l->l_cred);
 	cnt -= auio.uio_resid;
@@ -305,7 +317,7 @@ extattr_get_vp(struct vnode *vp, int att
 	} else
 		sizep = 
 
-	ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
+	ktr_xattr_name(attrname);
 
 	error = VOP_GETEXTATTR(vp, attrnamespace, attrname, auiop, sizep,
 	l->l_cred);
@@ -314,7 +326,7 @@ extattr_get_vp(struct vnode *vp, int att
 		cnt -= auio.uio_resid;
 		retval[0] = cnt;
 
-		ktruser("xattr-val", data, cnt, 0);
+		ktr_xattr_val(data, cnt);
 	} else
 		retval[0] = size;
 
@@ -336,7 +348,7 @@ extattr_delete_vp(struct vnode *vp, int 
 
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 
-	ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
+	ktr_xattr_name(attrname);
 
 	error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, l->l_cred);
 	if (error == EOPNOTSUPP)



CVS commit: src/distrib/sets/lists

2021-06-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 23 18:30:33 UTC 2021

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/distrib/sets/lists/debug: md.amd64

Log Message:
build gdbserver only when we build gdb (from adam)


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.114 -r1.115 src/distrib/sets/lists/debug/md.amd64

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/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.284 src/distrib/sets/lists/base/md.amd64:1.285
--- src/distrib/sets/lists/base/md.amd64:1.284	Mon Jun  7 10:24:42 2021
+++ src/distrib/sets/lists/base/md.amd64	Wed Jun 23 14:30:32 2021
@@ -1,9 +1,9 @@
-# $NetBSD: md.amd64,v 1.284 2021/06/07 14:24:42 christos Exp $
+# $NetBSD: md.amd64,v 1.285 2021/06/23 18:30:32 christos Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
 ./usr/bin/fdformatbase-util-bin
-./usr/bin/gdbserverbase-util-bin
+./usr/bin/gdbserverbase-util-bin		gdb
 ./usr/bin/pmc	base-obsolete		obsolete
 ./usr/lib/i386/libi386.so.2			base-compat-shlib	compat,pic
 ./usr/lib/i386/libi386.so.2.0			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/debug/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.114 src/distrib/sets/lists/debug/md.amd64:1.115
--- src/distrib/sets/lists/debug/md.amd64:1.114	Mon Jun  7 10:24:42 2021
+++ src/distrib/sets/lists/debug/md.amd64	Wed Jun 23 14:30:33 2021
@@ -1,5 +1,5 @@
-# $NetBSD: md.amd64,v 1.114 2021/06/07 14:24:42 christos Exp $
-./usr/libdata/debug/usr/bin/gdbserver.debug	base-util-debug		debug
+# $NetBSD: md.amd64,v 1.115 2021/06/23 18:30:33 christos Exp $
+./usr/libdata/debug/usr/bin/gdbserver.debug	base-util-debug		gdb,debug
 ./usr/lib/i386/12.202++_g.a			comp-c-debuglib		debuglib,compat,12.202xx
 ./usr/lib/i386/libi386_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/i386/libiberty_g.a			comp-obsolete		obsolete



CVS commit: src/sys/dev/pci

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:21:17 UTC 2021

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

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/radeonfb.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/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.114 src/sys/dev/pci/radeonfb.c:1.115
--- src/sys/dev/pci/radeonfb.c:1.114	Sat Apr 24 19:36:57 2021
+++ src/sys/dev/pci/radeonfb.c	Sun Jun 20 23:21:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.114 2021/04/24 23:36:57 thorpej Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.115 2021/06/21 03:21:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.114 2021/04/24 23:36:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.115 2021/06/21 03:21:17 christos Exp $");
 
 #include 
 #include 
@@ -812,7 +812,7 @@ radeonfb_attach(device_t parent, device_
 
 	/* setup default video mode from devprop (allows PROM override) */
 	sc->sc_defaultmode = radeonfb_default_mode;
-	if (prop_dictionary_get_cstring_nocopy(device_properties(sc->sc_dev),
+	if (prop_dictionary_get_string(device_properties(sc->sc_dev),
 	"videomode", )) {
 
 		strncpy(sc->sc_modebuf, mptr, sizeof(sc->sc_modebuf));



CVS commit: src/sys/dev/pci

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:19:21 UTC 2021

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

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/machfb.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/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.104 src/sys/dev/pci/machfb.c:1.105
--- src/sys/dev/pci/machfb.c:1.104	Sat Apr 24 19:36:57 2021
+++ src/sys/dev/pci/machfb.c	Sun Jun 20 23:19:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.104 2021/04/24 23:36:57 thorpej Exp $	*/
+/*	$NetBSD: machfb.c,v 1.105 2021/06/21 03:19:21 christos Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include 
 __KERNEL_RCSID(0,
-	"$NetBSD: machfb.c,v 1.104 2021/04/24 23:36:57 thorpej Exp $");
+	"$NetBSD: machfb.c,v 1.105 2021/06/21 03:19:21 christos Exp $");
 
 #include 
 #include 
@@ -520,7 +520,7 @@ mach64_attach(device_t parent, device_t 
 	default_mode.hdisplay = width;
 	default_mode.vdisplay = height;
 
-	prop_dictionary_get_cstring_nocopy(device_properties(sc->sc_dev),
+	prop_dictionary_get_string(device_properties(sc->sc_dev),
 	"videomode", );
 
 	memset(>sc_ei, 0, sizeof(sc->sc_ei));



CVS commit: src/sys/arch/arm/omap

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:18:40 UTC 2021

Modified Files:
src/sys/arch/arm/omap: omap3_ehci.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/omap/omap3_ehci.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/arm/omap/omap3_ehci.c
diff -u src/sys/arch/arm/omap/omap3_ehci.c:1.14 src/sys/arch/arm/omap/omap3_ehci.c:1.15
--- src/sys/arch/arm/omap/omap3_ehci.c:1.14	Sat Apr 24 19:36:28 2021
+++ src/sys/arch/arm/omap/omap3_ehci.c	Sun Jun 20 23:18:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.14 2021/04/24 23:36:28 thorpej Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.15 2021/06/21 03:18:40 christos Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.14 2021/04/24 23:36:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.15 2021/06/21 03:18:40 christos Exp $");
 
 #include "locators.h"
 
@@ -365,7 +365,7 @@ omap3_ehci_get_port_mode(prop_dictionary
 	const char *s = NULL;
 	enum omap3_ehci_port_mode mode = OMAP3_EHCI_PORT_MODE_NONE;
 
-	if (prop_dictionary_get_cstring_nocopy(prop, key, ) && s != NULL) {
+	if (prop_dictionary_get_string(prop, key, ) && s != NULL) {
 		if (strcmp(s, "phy") == 0) {
 			mode = OMAP3_EHCI_PORT_MODE_PHY;
 #ifdef OMAP_3XXX



CVS commit: src/sys/dev/sdmmc

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:18:00 UTC 2021

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/sdmmc/if_bwfm_sdio.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/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.25 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.26
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.25	Tue Jan 26 22:10:21 2021
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sun Jun 20 23:17:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.25 2021/01/27 03:10:21 thorpej Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.26 2021/06/21 03:17:59 christos Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -565,7 +565,7 @@ bwfm_fdt_find_phandle(device_t self, dev
 
 	/* locate in FDT */
 	dict = device_properties(self);
-	if (prop_dictionary_get_cstring_nocopy(dict, "fdt-path", )) {
+	if (prop_dictionary_get_string(dict, "fdt-path", )) {
 		/* search in FDT */
 		phandle = OF_finddevice(str);
 	} else {
@@ -576,7 +576,7 @@ bwfm_fdt_find_phandle(device_t self, dev
 			return -1;
 		/* locate in FDT */
 		dict = device_properties(dev);
-		if (!prop_dictionary_get_cstring_nocopy(dict, "fdt-path", ))
+		if (!prop_dictionary_get_string(dict, "fdt-path", ))
 			return -1;
 
 		/* are we the only FDT child ? */



CVS commit: src/sys/dev/dm

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:16:43 UTC 2021

Modified Files:
src/sys/dev/dm: dm_ioctl.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/dm/dm_ioctl.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/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.51 src/sys/dev/dm/dm_ioctl.c:1.52
--- src/sys/dev/dm/dm_ioctl.c:1.51	Fri May  7 05:53:39 2021
+++ src/sys/dev/dm/dm_ioctl.c	Sun Jun 20 23:16:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.51 2021/05/07 09:53:39 hannken Exp $  */
+/* $NetBSD: dm_ioctl.c,v 1.52 2021/06/21 03:16:43 christos Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.51 2021/05/07 09:53:39 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.52 2021/06/21 03:16:43 christos Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -910,8 +910,8 @@ dm_table_status_ioctl(prop_dictionary_t 
 	name = NULL;
 	flags = 0;
 
-	prop_dictionary_get_cstring_nocopy(dm_dict, DM_IOCTL_NAME, );
-	prop_dictionary_get_cstring_nocopy(dm_dict, DM_IOCTL_UUID, );
+	prop_dictionary_get_string(dm_dict, DM_IOCTL_NAME, );
+	prop_dictionary_get_string(dm_dict, DM_IOCTL_UUID, );
 	prop_dictionary_get_uint32(dm_dict, DM_IOCTL_FLAGS, );
 	prop_dictionary_get_uint32(dm_dict, DM_IOCTL_MINOR, );
 



CVS commit: src/sys/arch/arm/nvidia

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:15:22 UTC 2021

Modified Files:
src/sys/arch/arm/nvidia: tegra_cec.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_cec.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/arm/nvidia/tegra_cec.c
diff -u src/sys/arch/arm/nvidia/tegra_cec.c:1.9 src/sys/arch/arm/nvidia/tegra_cec.c:1.10
--- src/sys/arch/arm/nvidia/tegra_cec.c:1.9	Sat Apr 24 19:36:27 2021
+++ src/sys/arch/arm/nvidia/tegra_cec.c	Sun Jun 20 23:15:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_cec.c,v 1.9 2021/04/24 23:36:27 thorpej Exp $ */
+/* $NetBSD: tegra_cec.c,v 1.10 2021/06/21 03:15:22 christos Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.9 2021/04/24 23:36:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.10 2021/06/21 03:15:22 christos Exp $");
 
 #include 
 #include 
@@ -179,7 +179,7 @@ tegra_cec_attach(device_t parent, device
 	}
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
-	prop_dictionary_get_cstring_nocopy(prop, "hdmi-device",
+	prop_dictionary_get_string(prop, "hdmi-device",
 	>sc_hdmidevname);
 
 	fdtbus_reset_assert(sc->sc_rst);



CVS commit: src/sbin/ifconfig

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:14:41 UTC 2021

Modified Files:
src/sbin/ifconfig: agr.c env.c lagg.c pfsync.c vlan.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/ifconfig/agr.c src/sbin/ifconfig/vlan.c
cvs rdiff -u -r1.13 -r1.14 src/sbin/ifconfig/env.c
cvs rdiff -u -r1.1 -r1.2 src/sbin/ifconfig/lagg.c
cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/pfsync.c

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

Modified files:

Index: src/sbin/ifconfig/agr.c
diff -u src/sbin/ifconfig/agr.c:1.15 src/sbin/ifconfig/agr.c:1.16
--- src/sbin/ifconfig/agr.c:1.15	Tue Jul 15 17:27:58 2008
+++ src/sbin/ifconfig/agr.c	Sun Jun 20 23:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: agr.c,v 1.15 2008/07/15 21:27:58 dyoung Exp $	*/
+/*	$NetBSD: agr.c,v 1.16 2021/06/21 03:14:40 christos Exp $	*/
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: agr.c,v 1.15 2008/07/15 21:27:58 dyoung Exp $");
+__RCSID("$NetBSD: agr.c,v 1.16 2021/06/21 03:14:40 christos Exp $");
 #endif /* !defined(lint) */
 
 #include 
@@ -101,7 +101,7 @@ agrsetport(prop_dictionary_t env, prop_d
 		return -1;
 	}
 
-	if (!prop_dictionary_get_cstring_nocopy(env, "agrport", )) {
+	if (!prop_dictionary_get_string(env, "agrport", )) {
 		warnx("%s.%d", __func__, __LINE__);
 		errno = ENOENT;
 		return -1;
Index: src/sbin/ifconfig/vlan.c
diff -u src/sbin/ifconfig/vlan.c:1.15 src/sbin/ifconfig/vlan.c:1.16
--- src/sbin/ifconfig/vlan.c:1.15	Fri Aug 16 06:33:17 2019
+++ src/sbin/ifconfig/vlan.c	Sun Jun 20 23:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vlan.c,v 1.15 2019/08/16 10:33:17 msaitoh Exp $	*/
+/*	$NetBSD: vlan.c,v 1.16 2021/06/21 03:14:40 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: vlan.c,v 1.15 2019/08/16 10:33:17 msaitoh Exp $");
+__RCSID("$NetBSD: vlan.c,v 1.16 2021/06/21 03:14:40 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -140,7 +140,7 @@ setvlanif(prop_dictionary_t env, prop_di
 	if (getvlan(env, , false) == -1)
 		err(EXIT_FAILURE, "%s: getsock", __func__);
 
-	if (!prop_dictionary_get_cstring_nocopy(env, "vlanif", )) {
+	if (!prop_dictionary_get_string(env, "vlanif", )) {
 		errno = ENOENT;
 		return -1;
 	}

Index: src/sbin/ifconfig/env.c
diff -u src/sbin/ifconfig/env.c:1.13 src/sbin/ifconfig/env.c:1.14
--- src/sbin/ifconfig/env.c:1.13	Sun Jun  7 02:02:58 2020
+++ src/sbin/ifconfig/env.c	Sun Jun 20 23:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $	*/
+/*	$NetBSD: env.c,v 1.14 2021/06/21 03:14:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: env.c,v 1.13 2020/06/07 06:02:58 thorpej Exp $");
+__RCSID("$NetBSD: env.c,v 1.14 2021/06/21 03:14:40 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -122,7 +122,7 @@ getifname(prop_dictionary_t env)
 {
 	const char *s;
 
-	return prop_dictionary_get_cstring_nocopy(env, "if", ) ? s : NULL;
+	return prop_dictionary_get_string(env, "if", ) ? s : NULL;
 }
 
 ssize_t

Index: src/sbin/ifconfig/lagg.c
diff -u src/sbin/ifconfig/lagg.c:1.1 src/sbin/ifconfig/lagg.c:1.2
--- src/sbin/ifconfig/lagg.c:1.1	Mon May 17 00:07:42 2021
+++ src/sbin/ifconfig/lagg.c	Sun Jun 20 23:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $	*/
+/*	$NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $	*/
 
 /*
  * Copyright (c) 2021 Internet Initiative Japan Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $");
+__RCSID("$NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $");
 #endif /* !defined(lint) */
 
 #include 
@@ -391,7 +391,7 @@ setlaggport(prop_dictionary_t env, prop_
 	enum lagg_ioctl ioc;
 	int64_t lpcmd, pri;
 
-	if (!prop_dictionary_get_cstring_nocopy(env, "laggport", )) {
+	if (!prop_dictionary_get_string(env, "laggport", )) {
 		if (lagg_debug)
 			warnx("%s.%d", __func__, __LINE__);
 		errno = ENOENT;

Index: src/sbin/ifconfig/pfsync.c
diff -u src/sbin/ifconfig/pfsync.c:1.3 src/sbin/ifconfig/pfsync.c:1.4
--- src/sbin/ifconfig/pfsync.c:1.3	Sun Jun  7 02:02:58 2020
+++ src/sbin/ifconfig/pfsync.c	Sun Jun 20 23:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $	*/
+/*	$NetBSD: pfsync.c,v 1.4 2021/06/21 03:14:40 christos Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pfsync.c,v 1.3 2020/06/07 06:02:58 thorpej Exp $");
+__RCSID("$NetBSD: pfsync.c,v 1.4 2021/06/21 03:14:40 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -155,7 +155,7 @@ setpfsyncdev(prop_dictionary_t env, prop
 	struct pfsyncreq pfsyncr;
 	const 

CVS commit: src/sbin/devpubd

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:14:12 UTC 2021

Modified Files:
src/sbin/devpubd: devpubd.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/devpubd/devpubd.c

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

Modified files:

Index: src/sbin/devpubd/devpubd.c
diff -u src/sbin/devpubd/devpubd.c:1.6 src/sbin/devpubd/devpubd.c:1.7
--- src/sbin/devpubd/devpubd.c:1.6	Mon Feb 24 06:45:30 2020
+++ src/sbin/devpubd/devpubd.c	Sun Jun 20 23:14:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $	*/
+/*	$NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill 
@@ -36,7 +36,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2011-2015\
 Jared D. McNeill . All rights reserved.");
-__RCSID("$NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $");
+__RCSID("$NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $");
 
 #include 
 #include 
@@ -144,8 +144,8 @@ devpubd_eventloop(void)
 		res = prop_dictionary_recv_ioctl(drvctl_fd, DRVGETEVENT, );
 		if (res)
 			err(EXIT_FAILURE, "DRVGETEVENT failed");
-		prop_dictionary_get_cstring_nocopy(ev, "event", );
-		prop_dictionary_get_cstring_nocopy(ev, "device", [0]);
+		prop_dictionary_get_string(ev, "event", );
+		prop_dictionary_get_string(ev, "device", [0]);
 
 		printf("%s: event='%s', device='%s'\n", __func__,
 		event, device[0]);



CVS commit: src/lib/libdm

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:13:33 UTC 2021

Modified Files:
src/lib/libdm: libdm_ioctl.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libdm/libdm_ioctl.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/libdm/libdm_ioctl.c
diff -u src/lib/libdm/libdm_ioctl.c:1.5 src/lib/libdm/libdm_ioctl.c:1.6
--- src/lib/libdm/libdm_ioctl.c:1.5	Sun Jun  7 01:57:17 2020
+++ src/lib/libdm/libdm_ioctl.c	Sun Jun 20 23:13:32 2021
@@ -266,7 +266,7 @@ libdm_task_get_name(libdm_task_t libdm_t
 {
 	char *name;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
+	if (!prop_dictionary_get_string(libdm_task->ldm_task,
 	DM_IOCTL_NAME, (const char **)))
 		return NULL;
 
@@ -291,7 +291,7 @@ libdm_task_get_uuid(libdm_task_t libdm_t
 {
 	char *uuid;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
+	if (!prop_dictionary_get_string(libdm_task->ldm_task,
 	DM_IOCTL_UUID, (const char **)))
 		return NULL;
 
@@ -304,7 +304,7 @@ libdm_task_get_command(libdm_task_t libd
 {
 	char *command;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
+	if (!prop_dictionary_get_string(libdm_task->ldm_task,
 	DM_IOCTL_COMMAND, (const char **)))
 		return NULL;
 
@@ -755,7 +755,7 @@ libdm_table_get_target(libdm_table_t lib
 {
 	char *target;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_TYPE,
+	if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_TYPE,
 	(const char **)))
 		return NULL;
 
@@ -782,7 +782,7 @@ libdm_table_get_params(libdm_table_t  li
 {
 	char *params;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_PARAMS,
+	if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_PARAMS,
 	(const char **)))
 		return NULL;
 
@@ -816,7 +816,7 @@ libdm_target_get_name(libdm_target_t lib
 {
 	char *name;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_target->ldm_trgt,
+	if (!prop_dictionary_get_string(libdm_target->ldm_trgt,
 	DM_TARGETS_NAME, (const char **)))
 		return NULL;
 
@@ -860,7 +860,7 @@ libdm_dev_get_name(libdm_dev_t libdm_dev
 {
 	char *name;
 
-	if (!prop_dictionary_get_cstring_nocopy(libdm_dev->ldm_dev,
+	if (!prop_dictionary_get_string(libdm_dev->ldm_dev,
 	DM_DEV_NAME, (const char **)))
 		return NULL;
 



CVS commit: src/sys/dev/i2c

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:12:54 UTC 2021

Modified Files:
src/sys/dev/i2c: adm1021.c dbcool.c dstemp.c i2c.c lm75.c pcagpio.c
pcf8574.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/i2c/adm1021.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/dstemp.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/i2c/lm75.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/pcagpio.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/pcf8574.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/i2c/adm1021.c
diff -u src/sys/dev/i2c/adm1021.c:1.28 src/sys/dev/i2c/adm1021.c:1.29
--- src/sys/dev/i2c/adm1021.c:1.28	Tue Jun 15 00:41:01 2021
+++ src/sys/dev/i2c/adm1021.c	Sun Jun 20 23:12:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $ */
+/*	$NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $ */
 /*	$OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $	*/
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $");
 
 #include 
 #include 
@@ -409,11 +409,11 @@ admtemp_attach(device_t parent, device_t
 	sc->sc_sensor[ADMTEMP_EXT].flags =
 	ENVSYS_FMONLIMITS | ENVSYS_FHAS_ENTROPY;
 
-	if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", )) {
+	if (prop_dictionary_get_string(sc->sc_prop, "s00", )) {
 		strncpy(iname, desc, 64);
 	}
 
-	if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s01", )) {
+	if (prop_dictionary_get_string(sc->sc_prop, "s01", )) {
 		strncpy(ename, desc, 64);
 	}
 

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.61 src/sys/dev/i2c/dbcool.c:1.62
--- src/sys/dev/i2c/dbcool.c:1.61	Tue Jun 15 00:39:49 2021
+++ src/sys/dev/i2c/dbcool.c	Sun Jun 20 23:12:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $ */
+/*	$NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $");
 
 #include 
 #include 
@@ -1697,7 +1697,7 @@ dbcool_attach_sensor(struct dbcool_softc
 
 	name_index = sc->sc_dc.dc_chip->table[idx].name_index;
 	snprintf(name, 7, "s%02x", sc->sc_dc.dc_chip->table[idx].reg.val_reg);
-	if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, name, )) {
+	if (prop_dictionary_get_string(sc->sc_prop, name, )) {
 		 strlcpy(sc->sc_sensor[idx].desc, desc,
 			sizeof(sc->sc_sensor[idx].desc));
 	} else {

Index: src/sys/dev/i2c/dstemp.c
diff -u src/sys/dev/i2c/dstemp.c:1.13 src/sys/dev/i2c/dstemp.c:1.14
--- src/sys/dev/i2c/dstemp.c:1.13	Tue Jun 15 00:41:01 2021
+++ src/sys/dev/i2c/dstemp.c	Sun Jun 20 23:12:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $ */
+/* $NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $");
 
 #include 
 #include 
@@ -126,9 +126,9 @@ dstemp_attach(device_t parent, device_t 
 	sc->sc_sensor_temp.state = ENVSYS_SINVALID;
 	sc->sc_sensor_temp.flags = ENVSYS_FHAS_ENTROPY;
 
-	if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", )) {
+	if (prop_dictionary_get_string(sc->sc_prop, "s00", )) {
 		strncpy(name, desc, 64);
-	} else if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "saa", )) {
+	} else if (prop_dictionary_get_string(sc->sc_prop, "saa", )) {
 		strncpy(name, desc, 64);
 	}
 

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.78 src/sys/dev/i2c/i2c.c:1.79
--- src/sys/dev/i2c/i2c.c:1.78	Sat Apr 24 19:36:54 2021
+++ src/sys/dev/i2c/i2c.c	Sun Jun 20 23:12:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $");
 
 #include 
 #include 
@@ -452,7 +452,7 @@ iic_attach(device_t parent, device_t sel
 		for (i = 0; i < count; i++) {
 			dev = prop_array_get(child_devices, i);
 			if (!dev) continue;
- 			if (!prop_dictionary_get_cstring_nocopy(
+ 			if (!prop_dictionary_get_string(
 			dev, "name", )) {
 /* "name" property is optional. 

CVS commit: src/sys/dev

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:11:05 UTC 2021

Modified Files:
src/sys/dev: veriexec.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/veriexec.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/veriexec.c
diff -u src/sys/dev/veriexec.c:1.1 src/sys/dev/veriexec.c:1.2
--- src/sys/dev/veriexec.c:1.1	Wed Dec  9 13:25:32 2015
+++ src/sys/dev/veriexec.c	Sun Jun 20 23:11:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $	*/
+/*	$NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 Elad Efrat 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $");
 
 #include 
 #include 
@@ -110,7 +110,7 @@ veriexec_delete(prop_dictionary_t dict, 
 	const char *file;
 	int error;
 
-	if (!prop_dictionary_get_cstring_nocopy(dict, "file", ))
+	if (!prop_dictionary_get_string(dict, "file", ))
 		return (EINVAL);
 
 	error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, );
@@ -135,7 +135,7 @@ veriexec_query(prop_dictionary_t dict, p
 	const char *file;
 	int error;
 
-	if (!prop_dictionary_get_cstring_nocopy(dict, "file", ))
+	if (!prop_dictionary_get_string(dict, "file", ))
 		return (EINVAL);
 
 	error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, );



CVS commit: src/usr.sbin/hdaudioctl

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:09:52 UTC 2021

Modified Files:
src/usr.sbin/hdaudioctl: graph.c hdaudioctl.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/hdaudioctl/graph.c \
src/usr.sbin/hdaudioctl/hdaudioctl.c

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

Modified files:

Index: src/usr.sbin/hdaudioctl/graph.c
diff -u src/usr.sbin/hdaudioctl/graph.c:1.5 src/usr.sbin/hdaudioctl/graph.c:1.6
--- src/usr.sbin/hdaudioctl/graph.c:1.5	Mon Jun 15 09:06:39 2020
+++ src/usr.sbin/hdaudioctl/graph.c	Sun Jun 20 23:09:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: graph.c,v 1.5 2020/06/15 13:06:39 sborrill Exp $ */
+/* $NetBSD: graph.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -95,7 +95,7 @@ hdaudioctl_graph(int fd, int argc, char 
 		HDAUDIO_FGRP_WIDGET_INFO, );
 		if (error != 0)
 			break;
-		prop_dictionary_get_cstring_nocopy(response, "name", );
+		prop_dictionary_get_string(response, "name", );
 		prop_dictionary_get_uint32(response, "cap", );
 		prop_dictionary_get_uint32(response, "config", );
 		prop_dictionary_get_uint8(response, "type", );
@@ -174,7 +174,7 @@ next:
 		HDAUDIO_AFG_WIDGET_INFO, );
 		if (error != 0)
 			break;
-		prop_dictionary_get_cstring_nocopy(response, "name", );
+		prop_dictionary_get_string(response, "name", );
 		prop_dictionary_get_uint8(response, "type", );
 		prop_dictionary_get_uint8(response, "nid", );
 
@@ -197,7 +197,7 @@ next:
 		HDAUDIO_AFG_WIDGET_INFO, );
 		if (error != 0)
 			break;
-		prop_dictionary_get_cstring_nocopy(response, "name", );
+		prop_dictionary_get_string(response, "name", );
 		prop_dictionary_get_uint8(response, "type", );
 		prop_dictionary_get_uint8(response, "nid", );
 
Index: src/usr.sbin/hdaudioctl/hdaudioctl.c
diff -u src/usr.sbin/hdaudioctl/hdaudioctl.c:1.5 src/usr.sbin/hdaudioctl/hdaudioctl.c:1.6
--- src/usr.sbin/hdaudioctl/hdaudioctl.c:1.5	Wed Jul  1 08:19:45 2020
+++ src/usr.sbin/hdaudioctl/hdaudioctl.c	Sun Jun 20 23:09:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioctl.c,v 1.5 2020/07/01 12:19:45 sborrill Exp $ */
+/* $NetBSD: hdaudioctl.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -141,7 +141,7 @@ hdaudioctl_list(int fd)
 		prop_dictionary_get_uint16(dict, "vendor-id", );
 		prop_dictionary_get_uint16(dict, "product-id", );
 		prop_dictionary_get_uint32(dict, "subsystem-id", );
-		prop_dictionary_get_cstring_nocopy(dict, "device", );
+		prop_dictionary_get_string(dict, "device", );
 
 		printf("codecid 0x%02X nid 0x%02X vendor 0x%04X "
 		"product 0x%04X subsystem 0x%08X device %s\n",



CVS commit: src/sys/modules/panic

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:08:07 UTC 2021

Modified Files:
src/sys/modules/panic: panic.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/panic/panic.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/modules/panic/panic.c
diff -u src/sys/modules/panic/panic.c:1.1 src/sys/modules/panic/panic.c:1.2
--- src/sys/modules/panic/panic.c:1.1	Thu Feb 17 20:07:20 2011
+++ src/sys/modules/panic/panic.c	Sun Jun 20 23:08:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $ */
+/* $NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $");
 
 #include 
 
@@ -63,7 +63,7 @@ panic_modcmd(modcmd_t cmd, void *opaque)
 		unsigned int i;
 
 		if (props)
-			prop_dictionary_get_cstring_nocopy(props, "how", );
+			prop_dictionary_get_string(props, "how", );
 		if (how == NULL)
 			how = "panic";
 



CVS commit: src/sys/arch/zaurus/zaurus

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:05:24 UTC 2021

Modified Files:
src/sys/arch/zaurus/zaurus: autoconf.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/zaurus/zaurus/autoconf.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/zaurus/zaurus/autoconf.c
diff -u src/sys/arch/zaurus/zaurus/autoconf.c:1.13 src/sys/arch/zaurus/zaurus/autoconf.c:1.14
--- src/sys/arch/zaurus/zaurus/autoconf.c:1.13	Wed Nov 13 12:48:03 2019
+++ src/sys/arch/zaurus/zaurus/autoconf.c	Sun Jun 20 23:05:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $");
 
 #include "opt_md.h"
 
@@ -227,7 +227,7 @@ device_register(device_t dev, void *aux)
 	 */
 	if (device_is_a(dev, "iic") &&
 	device_is_a(dev->dv_parent, "ziic")) {
-		(void)prop_dictionary_set_cstring_nocopy(device_properties(dev),
+		(void)prop_dictionary_set_string_nocopy(device_properties(dev),
 		I2C_PROP_INDIRECT_PROBE_STRATEGY, I2C_PROBE_STRATEGY_NONE);
 	}
 }



CVS commit: src/usr.bin/audiocfg

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:04:27 UTC 2021

Modified Files:
src/usr.bin/audiocfg: drvctl.c

Log Message:
fix proplib deprecation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/audiocfg/drvctl.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/audiocfg/drvctl.c
diff -u src/usr.bin/audiocfg/drvctl.c:1.2 src/usr.bin/audiocfg/drvctl.c:1.3
--- src/usr.bin/audiocfg/drvctl.c:1.2	Wed Sep  1 22:17:35 2010
+++ src/usr.bin/audiocfg/drvctl.c	Sun Jun 20 23:04:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.2 2010/09/02 02:17:35 jmcneill Exp $ */
+/* $NetBSD: drvctl.c,v 1.3 2021/06/21 03:04:27 christos Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -64,9 +64,9 @@ drvctl_get_properties(int fd, const char
 	command_dict = prop_dictionary_create();
 	args_dict = prop_dictionary_create();
 
-	prop_dictionary_set_cstring_nocopy(command_dict, "drvctl-command",
+	prop_dictionary_set_string_nocopy(command_dict, "drvctl-command",
 	"get-properties");
-	prop_dictionary_set_cstring_nocopy(args_dict, "device-name", devnode);
+	prop_dictionary_set_string_nocopy(args_dict, "device-name", devnode);
 	prop_dictionary_set(command_dict, "drvctl-arguments", args_dict);
 	prop_object_release(args_dict);
 
@@ -115,7 +115,7 @@ drvctl_search(int fd, const char *curnod
 		rv = drvctl_get_properties(fd, laa.l_childname[i], );
 		if (rv == false || props == NULL)
 			continue;
-		rv = prop_dictionary_get_cstring_nocopy(props,
+		rv = prop_dictionary_get_string(props,
 		"device-driver", );
 		if (rv == true && strcmp(curdvname, dvname) == 0) {
 			rv = prop_dictionary_get_uint32(props,



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

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 03:01:23 UTC 2021

Modified Files:
src/sys/arch/x86/pci: pci_ranges.c

Log Message:
prop_dictionary_set_cstring_nocopy -> prop_dictionary_set_string_nocopy


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/pci_ranges.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/pci/pci_ranges.c
diff -u src/sys/arch/x86/pci/pci_ranges.c:1.8 src/sys/arch/x86/pci/pci_ranges.c:1.9
--- src/sys/arch/x86/pci/pci_ranges.c:1.8	Fri Mar  1 04:25:59 2019
+++ src/sys/arch/x86/pci/pci_ranges.c	Sun Jun 20 23:01:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_ranges.c,v 1.8 2019/03/01 09:25:59 msaitoh Exp $	*/
+/*	$NetBSD: pci_ranges.c,v 1.9 2021/06/21 03:01:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_ranges.c,v 1.8 2019/03/01 09:25:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_ranges.c,v 1.9 2021/06/21 03:01:23 christos Exp $");
 
 #include 
 #include 
@@ -784,7 +784,7 @@ pci_range_record(pci_chipset_tag_t pc, p
 		pci_decompose_tag(pc, pal->pal_tag, , , );
 
 		ok = ok &&
-		prop_dictionary_set_cstring_nocopy(rsvn, "type",
+		prop_dictionary_set_string_nocopy(rsvn, "type",
 		pci_alloc_regtype_string(pal->pal_type)) &&
 		prop_dictionary_set_uint64(rsvn, "address",
 		pal->pal_addr) &&



CVS commit: src/external/gpl2/xcvs/dist/doc

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 21 02:48:01 UTC 2021

Modified Files:
src/external/gpl2/xcvs/dist/doc: cvs.texinfo

Log Message:
PR/56256: Germain: cvs info doc incorrect for update -D


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl2/xcvs/dist/doc/cvs.texinfo

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

Modified files:

Index: src/external/gpl2/xcvs/dist/doc/cvs.texinfo
diff -u src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.14 src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.15
--- src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.14	Fri Jul  5 20:10:25 2019
+++ src/external/gpl2/xcvs/dist/doc/cvs.texinfo	Sun Jun 20 22:48:01 2021
@@ -11807,7 +11807,7 @@ them):
 @table @code
 @item -D date
 Use the most recent revision no later than @var{date}.
-This option is sticky, and implies @samp{-P}.
+This option is sticky.
 See @ref{Sticky tags}, for more information on sticky tags/dates.
 
 @item -f



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/hx509

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 20 12:01:07 UTC 2021

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/hx509: sel-gram.y sel-lex.l
sel.c sel.h
Removed Files:
src/crypto/external/bsd/heimdal/dist/lib/hx509: sel-gram.c sel-gram.h
sel-lex.c

Log Message:
remove generated files, custom #define prefixes to hide lex/yacc symbols
and yywrap.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 \
src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.c \
src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.h \
src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y \
src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h

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

Modified files:

Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y
diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.4
--- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y:1.3	Sun Dec 15 17:50:50 2019
+++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-gram.y	Sun Jun 20 08:01:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sel-gram.y,v 1.3 2019/12/15 22:50:50 christos Exp $	*/
+/*	$NetBSD: sel-gram.y,v 1.4 2021/06/20 12:01:07 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Kungliga Tekniska Högskolan
@@ -41,19 +41,6 @@
 #include 
 #include 
 
-#if !defined(yylex)
-#define yylex   _hx509_sel_yylex
-#define yywrap  _hx509_sel_yywrap
-#endif
-#if !defined(yyparse)
-#define yyparse _hx509_sel_yyparse
-#define yyerror _hx509_sel_yyerror
-#define yylval  _hx509_sel_yylval
-#define yychar  _hx509_sel_yychar
-#define yydebug _hx509_sel_yydebug
-#define yynerrs _hx509_sel_yynerrs
-#endif
-
 %}
 
 %union {
Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l
diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.3 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.4
--- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l:1.3	Sun Dec 15 17:50:50 2019
+++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel-lex.l	Sun Jun 20 08:01:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sel-lex.l,v 1.3 2019/12/15 22:50:50 christos Exp $	*/
+/*	$NetBSD: sel-lex.l,v 1.4 2021/06/20 12:01:07 christos Exp $	*/
 
 %{
 /*
@@ -72,6 +72,8 @@ struct hx_expr_input _hx509_expr_input;
 #undef ECHO
 
 %}
+
+%option noyywrap
 %%
 
 TRUE			{ return kw_TRUE; }
@@ -82,12 +84,12 @@ IN			{ return kw_IN; }
 TAILMATCH		{ return kw_TAILMATCH; }
 
 [A-Za-z][-A-Za-z0-9_]*	{
-			  yylval.string = strdup ((const char *)yytext);
+			  _hx509_sel_yylval.string = strdup ((const char *)_hx509_sel_yytext);
 			  return IDENTIFIER;
 			}
-"\""			{ yylval.string = handle_string(); return STRING; }
+"\""			{ _hx509_sel_yylval.string = handle_string(); return STRING; }
 \n			{ ++lineno; }
-[,.!={}()%]		{ return *yytext; }
+[,.!={}()%]		{ return *_hx509_sel_yytext; }
 [ \t]			;
 %%
 
@@ -122,16 +124,6 @@ handle_string(void)
 return strdup(x);
 }
 
-#if !defined(yywrap)
-#define yywrap  _hx509_sel_yywrap
-#endif
-
-int
-yywrap ()
-{
- return 1;
-}
-
 static int
 lex_input(char *buf, int max_size)
 {

Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.2 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.3
--- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c:1.2	Sat Jan 28 16:31:48 2017
+++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.c	Sun Jun 20 08:01:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sel.c,v 1.2 2017/01/28 21:31:48 christos Exp $	*/
+/*	$NetBSD: sel.c,v 1.3 2021/06/20 12:01:07 christos Exp $	*/
 
 /*
  * Copyright (c) 2008 Kungliga Tekniska Högskolan
@@ -219,7 +219,7 @@ _hx509_expr_parse(const char *buf)
 	_hx509_expr_input.error = NULL;
 }
 
-yyparse();
+_hx509_sel_yyparse();
 
 return _hx509_expr_input.expr;
 }

Index: src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h
diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.5 src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.6
--- src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h:1.5	Sun Dec 15 17:50:50 2019
+++ src/crypto/external/bsd/heimdal/dist/lib/hx509/sel.h	Sun Jun 20 08:01:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sel.h,v 1.5 2019/12/15 22:50:50 christos Exp $	*/
+/*	$NetBSD: sel.h,v 1.6 2021/06/20 12:01:07 christos Exp $	*/
 
 /*
  * Copyright (c) 2008 Kungliga Tekniska Högskolan
@@ -69,20 +69,6 @@ struct hx_expr_input {
 
 extern struct hx_expr_input _hx509_expr_input;
 
-#if !defined(yylex)
-#define yylex   _hx509_sel_yylex
-#define yywrap  _hx509_sel_yywrap
-#endif
-#if !defined(yyparse)

CVS commit: src/crypto/external/bsd/heimdal/lib/libhx509

2021-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 20 10:38:54 UTC 2021

Modified Files:
src/crypto/external/bsd/heimdal/lib/libhx509: Makefile

Log Message:
hide yyerrflag, yyval; centralize lex and yacc settings


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/heimdal/lib/libhx509/Makefile

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

Modified files:

Index: src/crypto/external/bsd/heimdal/lib/libhx509/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.6 src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.7
--- src/crypto/external/bsd/heimdal/lib/libhx509/Makefile:1.6	Sat Feb  3 22:19:51 2018
+++ src/crypto/external/bsd/heimdal/lib/libhx509/Makefile	Sun Jun 20 06:38:54 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2018/02/04 03:19:51 christos Exp $
+# $NetBSD: Makefile,v 1.7 2021/06/20 10:38:54 christos Exp $
 
 NOLINT=		# defined
 
@@ -19,6 +19,8 @@ LIBDPLIBS+=	asn1	${HEIMBASE}/lib/libasn1
 		wind	${HEIMBASE}/lib/libwind
 
 YHEADER=1
+YPREFIX=  _hx509_sel_yy
+LPREFIX=  _hx509_sel_yy
 
 INCSDIR=	/usr/include/krb5 
 INCS+=		hx509.h hx509-protos.h ${ASN1_INCS} ${COMPILE_ET_INCS}
@@ -56,7 +58,6 @@ SRCS=\
 	softp11.c		\
 	${BUILT_SOURCES}
 
-LPREFIX=  _hx509_sel_yy
 
 CPPFLAGS+=\
 	-I${HEIMDIST}/lib/hx509/ref	\



CVS commit: src

2021-06-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 19 13:56:35 UTC 2021

Modified Files:
src/include/protocols: dumprestore.h
src/sbin/dump: dump.h tape.c traverse.c
src/sbin/restore: dirs.c extern.h interactive.c main.c restore.c
restore.h symtab.c tape.c utilities.c
src/sys/sys: extattr.h

Log Message:
Add external attribute dumping and restoring support from FreeBSD.
Does not fully work yet, attributes are being saved and restored correctly,
but don't appear in the restored files somehow.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/include/protocols/dumprestore.h
cvs rdiff -u -r1.59 -r1.60 src/sbin/dump/dump.h
cvs rdiff -u -r1.56 -r1.57 src/sbin/dump/tape.c
cvs rdiff -u -r1.52 -r1.53 src/sbin/dump/traverse.c
cvs rdiff -u -r1.51 -r1.52 src/sbin/restore/dirs.c
cvs rdiff -u -r1.15 -r1.16 src/sbin/restore/extern.h
cvs rdiff -u -r1.28 -r1.29 src/sbin/restore/interactive.c
cvs rdiff -u -r1.36 -r1.37 src/sbin/restore/main.c
cvs rdiff -u -r1.21 -r1.22 src/sbin/restore/restore.c
cvs rdiff -u -r1.22 -r1.23 src/sbin/restore/restore.h
cvs rdiff -u -r1.29 -r1.30 src/sbin/restore/symtab.c
cvs rdiff -u -r1.70 -r1.71 src/sbin/restore/tape.c
cvs rdiff -u -r1.23 -r1.24 src/sbin/restore/utilities.c
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/extattr.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/protocols/dumprestore.h
diff -u src/include/protocols/dumprestore.h:1.19 src/include/protocols/dumprestore.h:1.20
--- src/include/protocols/dumprestore.h:1.19	Sun Apr  5 11:25:39 2020
+++ src/include/protocols/dumprestore.h	Sat Jun 19 09:56:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumprestore.h,v 1.19 2020/04/05 15:25:39 joerg Exp $	*/
+/*	$NetBSD: dumprestore.h,v 1.20 2021/06/19 13:56:34 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -95,7 +95,8 @@ extern union u_spcl {
 int64_t __uc_birthtime;
 int64_t __uc_atime;
 int64_t __uc_mtime;
-int32_t __uc_spare4[7];
+int32_t __uc_extsize;
+int32_t __uc_spare4[6];
 uint32_t __uc_file_flags;
 int32_t __uc_spare5[2];
 uint32_t __uc_uid;
@@ -125,6 +126,7 @@ extern union u_spcl {
 #define c_mode		__c_ino.__uc_ino.__uc_mode
 #define c_spare1	__c_ino.__uc_ino.__uc_spare1
 #define c_size		__c_ino.__uc_ino.__uc_size
+#define c_extsize	__c_ino.__uc_ino.__uc_extsize
 #define c_old_atime	__c_ino.__uc_ino.__uc_old_atime
 #define c_atime		__c_ino.__uc_ino.__uc_atime
 #define c_atimensec	__c_ino.__uc_ino.__uc_atimensec

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.59 src/sbin/dump/dump.h:1.60
--- src/sbin/dump/dump.h:1.59	Thu Dec  3 03:25:57 2020
+++ src/sbin/dump/dump.h	Sat Jun 19 09:56:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.59 2020/12/03 08:25:57 kre Exp $	*/
+/*	$NetBSD: dump.h,v 1.60 2021/06/19 13:56:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -205,7 +205,7 @@ int	mapdirs(ino_t, u_int64_t *);
 
 /* file dumping routines */
 void	blksout32(int32_t *, int, ino_t);
-void	blksout64(int64_t *, int, ino_t);
+void	blksout64(union dinode *, int64_t *, int, ino_t, int);
 void	dumpino(union dinode *, ino_t);
 #ifndef RRESTORE
 void	dumpmap(char *, int, ino_t);

Index: src/sbin/dump/tape.c
diff -u src/sbin/dump/tape.c:1.56 src/sbin/dump/tape.c:1.57
--- src/sbin/dump/tape.c:1.56	Mon Jun  7 10:07:32 2021
+++ src/sbin/dump/tape.c	Sat Jun 19 09:56:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tape.c,v 1.56 2021/06/07 14:07:32 hannken Exp $	*/
+/*	$NetBSD: tape.c,v 1.57 2021/06/19 13:56:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tape.c	8.4 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: tape.c,v 1.56 2021/06/07 14:07:32 hannken Exp $");
+__RCSID("$NetBSD: tape.c,v 1.57 2021/06/19 13:56:34 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -69,8 +69,8 @@ char	*nexttape;
 
 static	ssize_t atomic_read(int, void *, int);
 static	ssize_t atomic_write(int, const void *, int);
-static	void doslave(int, int);
-static	void enslave(void);
+static	void doworker(int, int);
+static	void create_workers(void);
 static	void flushtape(void);
 static	void killall(void);
 static	void proceed(int);
@@ -80,11 +80,11 @@ static	void tperror(int);
 
 /*
  * Concurrent dump mods (Caltech) - disk block reading and tape writing
- * are exported to several slave processes.  While one slave writes the
+ * are exported to several worker processes.  While one worker writes the
  * tape, the others read disk blocks; they pass control of the tape in
  * a ring via signals. The parent process traverses the file system and
- * sends writeheader()'s and lists of daddr's to the slaves via pipes.
- * The following structure defines the instruction packets sent to slaves.
+ * sends writeheader()'s and lists of daddr's to the workers via pipes.
+ * The following structure defines the instruction packets sent to workers.
  */
 

CVS commit: src/external/bsd/libfido2

2021-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 18 13:57:52 UTC 2021

Modified Files:
src/external/bsd/libfido2: Makefile.inc
src/external/bsd/libfido2/bin: Makefile.inc
src/external/bsd/libfido2/lib: Makefile

Log Message:
fix sun2 build


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 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/Makefile.inc
diff -u src/external/bsd/libfido2/Makefile.inc:1.3 src/external/bsd/libfido2/Makefile.inc:1.4
--- src/external/bsd/libfido2/Makefile.inc:1.3	Wed Jun 16 21:15:44 2021
+++ src/external/bsd/libfido2/Makefile.inc	Fri Jun 18 09:57:52 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.3 2021/06/17 01:15:44 christos Exp $
+# $NetBSD: Makefile.inc,v 1.4 2021/06/18 13:57:52 christos Exp $
 
 DIST:=${.PARSEDIR}/dist
 
@@ -13,6 +13,3 @@ FIDO_VERSION=${FIDO_MAJOR}.${FIDO_MINOR}
 CPPFLAGS+=-D_FIDO_MAJOR=${FIDO_MAJOR} -D_FIDO_MINOR=${FIDO_MINOR}
 CPPFLAGS+=-D_FIDO_PATCH=${FIDO_PATCH}
 CPPFLAGS+=-DHAVE_UNISTD_H -DHAVE_ARC4RANDOM_BUF -DHAVE_TIMESPECSUB
-
-LDFLAGS+=-lz
-DPFLAGS+=${LIBZ}

Index: src/external/bsd/libfido2/bin/Makefile.inc
diff -u src/external/bsd/libfido2/bin/Makefile.inc:1.2 src/external/bsd/libfido2/bin/Makefile.inc:1.3
--- src/external/bsd/libfido2/bin/Makefile.inc:1.2	Wed Mar  4 12:31:08 2020
+++ src/external/bsd/libfido2/bin/Makefile.inc	Fri Jun 18 09:57:52 2021
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile.inc,v 1.2 2020/03/04 17:31:08 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2021/06/18 13:57:52 christos Exp $
 
 .include "${.PARSEDIR}/../Makefile.inc"
 
 .PATH: ${DIST}/tools ${DIST}/man ${DIST}/openbsd-compat
 
-LDADD+=-lfido2 -lcbor -lusbhid -lcrypto  -lm
-DPADD+=${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID} ${LIBCRYPTO} ${LIBM}
+LDADD+=-lfido2 -lcbor -lusbhid -lcrypto -lz -lm 
+DPADD+=${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID} ${LIBCRYPTO} ${LIBZ} ${LIBM}

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.6 src/external/bsd/libfido2/lib/Makefile:1.7
--- src/external/bsd/libfido2/lib/Makefile:1.6	Thu Jun 17 08:38:53 2021
+++ src/external/bsd/libfido2/lib/Makefile	Fri Jun 18 09:57:52 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2021/06/17 12:38:53 christos Exp $
+# $NetBSD: Makefile,v 1.7 2021/06/18 13:57:52 christos Exp $
 
 NOLINT=
 .include 
@@ -8,8 +8,8 @@ NOLINT=
 
 CPPFLAGS+= -D_FIDO_INTERNAL -I${DIST}/src
 
-LDADD+=-lusbhid -lcbor
-DPADD+=${LIBUSBHID} ${LIBCBOR}
+LDADD+=-lusbhid -lcbor -lz
+DPADD+=${LIBUSBHID} ${LIBCBOR} ${LIBZ}
 
 LDFLAGS+=-Wl,--version-script=${DIST}/src/export.gnu
 



CVS commit: src/lib/libc/gen

2021-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 18 10:57:14 UTC 2021

Modified Files:
src/lib/libc/gen: vis.c

Log Message:
PR/56260: Alex Richardson: Out-of-bounds stack read in lib/libc/gen/vis.c
Also sync with other FreeBSD changes.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/lib/libc/gen/vis.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/gen/vis.c
diff -u src/lib/libc/gen/vis.c:1.74 src/lib/libc/gen/vis.c:1.75
--- src/lib/libc/gen/vis.c:1.74	Mon Nov 27 11:37:21 2017
+++ src/lib/libc/gen/vis.c	Fri Jun 18 06:57:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vis.c,v 1.74 2017/11/27 16:37:21 christos Exp $	*/
+/*	$NetBSD: vis.c,v 1.75 2021/06/18 10:57:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -57,7 +57,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.74 2017/11/27 16:37:21 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.75 2021/06/18 10:57:14 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 #ifdef __FBSDID
 __FBSDID("$FreeBSD$");
@@ -353,12 +353,15 @@ makeextralist(int flags, const char *src
 	wchar_t *dst, *d;
 	size_t len;
 	const wchar_t *s;
+	mbstate_t mbstate;
 
 	len = strlen(src);
 	if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL)
 		return NULL;
 
-	if ((flags & VIS_NOLOCALE) || mbstowcs(dst, src, len) == (size_t)-1) {
+	memset(, 0, sizeof(mbstate));
+	if ((flags & VIS_NOLOCALE)
+	|| mbsrtowcs(dst, , len, ) == (size_t)-1) {
 		size_t i;
 		for (i = 0; i < len; i++)
 			dst[i] = (wchar_t)(u_char)src[i];
@@ -401,6 +404,7 @@ istrsenvisx(char **mbdstp, size_t *dlen,
 	int clen = 0, cerr, error = -1, i, shft;
 	char *mbdst, *mdst;
 	ssize_t mbslength, maxolen;
+	mbstate_t mbstate;
 
 	_DIAGASSERT(mbdstp != NULL);
 	_DIAGASSERT(mbsrc != NULL || mblength == 0);
@@ -458,10 +462,12 @@ istrsenvisx(char **mbdstp, size_t *dlen,
 	 * stop at NULs because we may be processing a block of data
 	 * that includes NULs.
 	 */
+	memset(, 0, sizeof(mbstate));
 	while (mbslength > 0) {
 		/* Convert one multibyte character to wchar_t. */
 		if (!cerr)
-			clen = mbtowc(src, mbsrc, MB_LEN_MAX);
+			clen = mbrtowc(src, mbsrc, MIN(mbslength, MB_LEN_MAX),
+			);
 		if (cerr || clen < 0) {
 			/* Conversion error, process as a byte instead. */
 			*src = (wint_t)(u_char)*mbsrc;
@@ -534,9 +540,10 @@ istrsenvisx(char **mbdstp, size_t *dlen,
 	len = wcslen(start);
 	maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1);
 	olen = 0;
+	memset(, 0, sizeof(mbstate));
 	for (dst = start; len > 0; len--) {
 		if (!cerr)
-			clen = wctomb(mbdst, *dst);
+			clen = wcrtomb(mbdst, *dst, );
 		if (cerr || clen < 0) {
 			/*
 			 * Conversion error, process as a byte(s) instead.



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/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/distrib/sets/lists

2021-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 17 01:17:28 UTC 2021

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

Log Message:
new libfido2


To generate a diff of this commit:
cvs rdiff -u -r1.920 -r1.921 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2388 -r1.2389 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.277 -r1.278 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.920 src/distrib/sets/lists/base/shl.mi:1.921
--- src/distrib/sets/lists/base/shl.mi:1.920	Mon May 17 00:07:41 2021
+++ src/distrib/sets/lists/base/shl.mi	Wed Jun 16 21:17:27 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.920 2021/05/17 04:07:41 yamaguchi Exp $
+# $NetBSD: shl.mi,v 1.921 2021/06/17 01:17:27 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -328,8 +328,8 @@
 ./usr/lib/libfetch.so.3base-sys-shlib		compatfile
 ./usr/lib/libfetch.so.3.0			base-sys-shlib		compatfile
 ./usr/lib/libfido2.sobase-sys-shlib		compatfile
-./usr/lib/libfido2.so.2base-sys-shlib		compatfile
-./usr/lib/libfido2.so.2.1			base-sys-shlib		compatfile
+./usr/lib/libfido2.so.3base-sys-shlib		compatfile
+./usr/lib/libfido2.so.3.0			base-sys-shlib		compatfile
 ./usr/lib/libform.sobase-sys-shlib		compatfile
 ./usr/lib/libform.so.8base-sys-shlib		compatfile
 ./usr/lib/libform.so.8.0			base-sys-shlib		compatfile

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2388 src/distrib/sets/lists/comp/mi:1.2389
--- src/distrib/sets/lists/comp/mi:1.2388	Sat May 29 21:56:45 2021
+++ src/distrib/sets/lists/comp/mi	Wed Jun 16 21:17:28 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2388 2021/05/30 01:56:45 joerg Exp $
+#	$NetBSD: mi,v 1.2389 2021/06/17 01:17:28 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -952,6 +952,7 @@
 ./usr/include/fido.hcomp-c-include
 ./usr/include/fido/bio.h			comp-c-include
 ./usr/include/fido/credman.h			comp-c-include
+./usr/include/fido/config.h			comp-c-include
 ./usr/include/fido/eddsa.h			comp-c-include
 ./usr/include/fido/err.h			comp-c-include
 ./usr/include/fido/es256.h			comp-c-include
@@ -7356,9 +7357,11 @@
 ./usr/share/man/cat3/fido_cred_set_authdata.0		comp-c-catman	.cat
 ./usr/share/man/cat3/fido_cred_verify.0			comp-c-catman	.cat
 ./usr/share/man/cat3/fido_credman_metadata_new.0	comp-c-catman	.cat
+./usr/share/man/cat3/fido_dev_enable_entattest.0	comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_get_assert.0		comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_get_touch_begin.0		comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_info_manifest.0		comp-c-catman	.cat
+./usr/share/man/cat3/fido_dev_largeblob_get.0		comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_make_cred.0		comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_open.0			comp-c-catman	.cat
 ./usr/share/man/cat3/fido_dev_set_io_functions.0	comp-c-catman	.cat
@@ -15639,9 +15642,11 @@
 ./usr/share/man/html3/fido_cred_set_authdata.html	comp-c-htmlman	html
 ./usr/share/man/html3/fido_cred_verify.html		comp-c-htmlman	html
 ./usr/share/man/html3/fido_credman_metadata_new.html	comp-c-htmlman	html
+./usr/share/man/html3/fido_dev_enable_entattest.html	comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_get_assert.html		comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_get_touch_begin.html	comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_info_manifest.html	comp-c-htmlman	html
+./usr/share/man/html3/fido_dev_largeblob_get.html	comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_make_cred.html		comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_open.html		comp-c-htmlman	html
 ./usr/share/man/html3/fido_dev_set_io_functions.html	comp-c-htmlman	html
@@ -23860,9 +23865,11 @@
 ./usr/share/man/man3/fido_cred_set_authdata.3		comp-c-man	.man
 ./usr/share/man/man3/fido_cred_verify.3			comp-c-man	.man
 ./usr/share/man/man3/fido_credman_metadata_new.3	comp-c-man	.man
+./usr/share/man/man3/fido_dev_enable_entattest.3	comp-c-man	.man
 ./usr/share/man/man3/fido_dev_get_assert.3		comp-c-man	.man
 ./usr/share/man/man3/fido_dev_get_touch_begin.3		comp-c-man	.man
 ./usr/share/man/man3/fido_dev_info_manifest.3		comp-c-man	.man
+./usr/share/man/man3/fido_dev_largeblob_get.3		comp-c-man	.man
 ./usr/share/man/man3/fido_dev_make_cred.3		comp-c-man	.man
 ./usr/share/man/man3/fido_dev_open.3			comp-c-man	.man
 ./usr/share/man/man3/fido_dev_set_io_functions.3	comp-c-man	.man

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.277 src/distrib/sets/lists/debug/shl.mi:1.278
--- src/distrib/sets/lists/debug/shl.mi:1.277	Mon May 17 

  1   2   3   4   5   6   7   8   9   10   >