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

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 17 01:59:16 UTC 2021

Modified Files:
src/external/bsd/openldap/lib/libldap_r: Makefile

Log Message:
add missing tpool.c.  fixes libreoffice build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/openldap/lib/libldap_r/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/openldap/lib/libldap_r/Makefile
diff -u src/external/bsd/openldap/lib/libldap_r/Makefile:1.6 src/external/bsd/openldap/lib/libldap_r/Makefile:1.7
--- src/external/bsd/openldap/lib/libldap_r/Makefile:1.6	Sat Aug 14 16:15:04 2021
+++ src/external/bsd/openldap/lib/libldap_r/Makefile	Tue Aug 17 01:59:16 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2021/08/14 16:15:04 christos Exp $
+#	$NetBSD: Makefile,v 1.7 2021/08/17 01:59:16 mrg Exp $
 
 USE_FORT?=	yes
 CWARNFLAGS.clang=	-Wno-format-extra-args
@@ -11,7 +11,7 @@ LIB=		ldap_r
 
 SRCS+=		threads.c rdwr.c rq.c \
 		thr_posix.c thr_thr.c thr_nt.c \
-		thr_pth.c thr_debug.c
+		thr_pth.c thr_debug.c tpool.c
 
 COPTS+=		-pthread
 LIBDPLIBS+=	pthread	${.CURDIR}/../../../../../lib/libpthread



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

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

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

Log Message:
jemalloc: suppress two irrelevant lint warnings


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

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

Modified files:

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



CVS commit: src/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/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(&min2, mech, &mech_msg);
+#endif
+	gss_display_status(&min2, gss_rc, GSS_C_GSS_CODE,
+			   mech, &msg_ctx, &gss_msg);
+	gss_display_status(&min2, minor_status, GSS_C_MECH_CODE,
+			   mech, &msg_ctx, &minor_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(&min2, &mech_msg);
+	gss_release_buffer(&min2, &gss_msg);
+	gss_release_buffer(&min2, &minor_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(&minor_status,
+			gss_ctx,
+			NULL,
+			NULL,
+			NULL,
+			&ctx_mech,
+			&ctx_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(&minor_status, gss_ctx,
+ conf_req_flag, GSS_C_QOP_DEFAULT,
+ SEND_MAX_WIRE_SIZE, &max_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;
+	unwra

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
s

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/external/bsd/atf/dist/tools

2021-07-08 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jul  8 18:10:52 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.cpp

Log Message:
When running an individual test case under isolation, make the test
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/tools/atf-run.cpp

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/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.6 src/external/bsd/atf/dist/tools/atf-run.cpp:1.7
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.6	Sat Apr 10 10:32:57 2021
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Thu Jul  8 18:10:52 2021
@@ -388,7 +388,22 @@ atf_run::run_test_program(const tools::f
 tools::fs::temp_dir resdir(
 tools::fs::path(tools::config::get("atf_workdir")) / "atf-run.XX");
 
-w.start_tp(tp.str(), md.test_cases.size());
+size_t nseltcs;
+if (tc.empty()) {
+nseltcs = md.test_cases.size();
+} else {
+nseltcs = 0;
+for (std::map< std::string, vars_map >::const_iterator iter
+ = md.test_cases.begin(); iter != md.test_cases.end(); iter++) {
+const std::string& tcname = (*iter).first;
+if (tcname == tc)
+nseltcs++;
+}
+if (nseltcs == 0)
+throw std::runtime_error("No such test case");
+}
+
+w.start_tp(tp.str(), nseltcs);
 if (md.test_cases.empty()) {
 w.end_tp("Bogus test program: reported 0 test cases");
 errcode = EXIT_FAILURE;



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

2021-07-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jul  6 12:40:25 UTC 2021

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

Log Message:
Remove -O0 hack for alpha; root cause has been addressed.


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

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.13 src/external/bsd/jemalloc/lib/Makefile.inc:1.14
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.13	Wed Dec 16 01:21:32 2020
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Tue Jul  6 12:40:24 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2020/12/16 01:21:32 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2021/07/06 12:40:24 thorpej Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,14 +51,6 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
-.if ${MACHINE} == "alpha" && ${ACTIVE_CC} == "gcc"
-# These files need to be compiled with -O0, or build everything with
-# -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
-# reported in port-alpha/54307.
-COPTS.rtree.c+=	-O0
-COPTS.tcache.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "vax"
 # in merge_overlapping_regs, at regrename.c
 COPTS.arena.c+=-O0



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/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(&ucrd, 0, sizeof(ucrd));
+
+	if (ioctl(fd, IOCTL_REQ(USB_GET_REPORT_DESC), &ucrd) == -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,
+		&usage_page) < 0) {
+		fido_log_debug("%s: fido_hid_get_usage", __func__);
 		return (false);
 	}
-	isfido = false;
-	while ((hid_get_item(hdata, &hitem)) > 0) {
-		if (HID_PAGE(hitem.usage) == 0xf1d0) {
-			isfido = true;
-			break;
-		}
-	}
-	hid_end_parse(hdata);
-	hid_dispose_report_desc(rdesc);
-	if (!isfido)
+
+	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, &raw) == -1) {
-		fido_log_debug("%s: unable to set raw", __func__);
+	if (ioctl(fd, IOCTL_REQ(USB_HID_SET_RAW), &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(&udi, 0, sizeof(udi));
 
-	if ((fd = open(path, O_RDWR)) == -1) {
-		if (errno != EBUSY && errno != ENOENT)
-			fido_log_debug("%s: open %s: %s", __func__, path,
-			strerror(errno));
-		goto fail;
-	}
-	if (!is_fido(fd))
+	if ((fd = fido_hid_unix_open(path)) == -1 || is_fido(fd) == 0)
 		goto fail;
 
-	if (ioctl(fd, USB_GET_DEVICEINFO, &udi) == -1)
+	if (ioctl(fd, IOCTL_REQ(USB_GET_DEVICEINFO), &udi) == -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(&pfd, 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 = ca

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/external/bsd/libfido2/lib

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

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

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


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

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

Modified files:

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.4 src/external/bsd/libfido2/lib/Makefile:1.5
--- src/external/bsd/libfido2/lib/Makefile:1.4	Thu Jun 17 01:15:46 2021
+++ src/external/bsd/libfido2/lib/Makefile	Thu Jun 17 06:20:56 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2021/06/17 01:15:46 christos Exp $
+# $NetBSD: Makefile,v 1.5 2021/06/17 06:20:56 rin Exp $
 
 NOLINT=
 .include 
@@ -48,6 +48,7 @@ u2f.c
 
 SRCS+= \
 explicit_bzero.c \
+freezero.c \
 recallocarray.c \
 timingsafe_bcmp.c
 



CVS commit: src/external/bsd/libfido2

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

Modified Files:
src/external/bsd/libfido2: Makefile.inc
src/external/bsd/libfido2/bin/fido2-assert: Makefile
src/external/bsd/libfido2/bin/fido2-cred: Makefile
src/external/bsd/libfido2/bin/fido2-token: Makefile
src/external/bsd/libfido2/dist/src: hid_netbsd.c
src/external/bsd/libfido2/dist/tools: util.c
src/external/bsd/libfido2/lib: Makefile fido2.map
Removed Files:
src/external/bsd/libfido2/dist: .travis.yml x xx
src/external/bsd/libfido2/dist/.github/workflows: scan.yml windows.yml
src/external/bsd/libfido2/dist/.travis: build-linux-clang
build-linux-gcc build-linux-mingw build-osx-clang fuzz-linux-asan
fuzz-linux-msan
src/external/bsd/libfido2/dist/debian: changelog compat control
copyright fido2-tools.install fido2-tools.manpages
libfido2-1.install libfido2-1.symbols libfido2-dev.install
libfido2-dev.links libfido2-dev.manpages libfido2-udev.install
rules
src/external/bsd/libfido2/dist/debian/source: format
src/external/bsd/libfido2/dist/docker/bionic: Dockerfile
src/external/bsd/libfido2/dist/fuzz: corpus.tgz
src/external/bsd/libfido2/dist/openbsd-compat: diff.sh
src/external/bsd/libfido2/dist/tools: macos_pkg.sh

Log Message:
merge conflicts and update between libfido 1.5.0 and 1.7.0


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-assert/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-cred/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-token/Makefile
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/.travis.yml \
src/external/bsd/libfido2/dist/x src/external/bsd/libfido2/dist/xx
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/.github/workflows/scan.yml \
src/external/bsd/libfido2/dist/.github/workflows/windows.yml
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/.travis/build-linux-clang \
src/external/bsd/libfido2/dist/.travis/build-linux-gcc \
src/external/bsd/libfido2/dist/.travis/build-linux-mingw \
src/external/bsd/libfido2/dist/.travis/build-osx-clang \
src/external/bsd/libfido2/dist/.travis/fuzz-linux-asan \
src/external/bsd/libfido2/dist/.travis/fuzz-linux-msan
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/debian/changelog \
src/external/bsd/libfido2/dist/debian/compat \
src/external/bsd/libfido2/dist/debian/control \
src/external/bsd/libfido2/dist/debian/copyright \
src/external/bsd/libfido2/dist/debian/fido2-tools.install \
src/external/bsd/libfido2/dist/debian/fido2-tools.manpages \
src/external/bsd/libfido2/dist/debian/libfido2-1.install \
src/external/bsd/libfido2/dist/debian/libfido2-1.symbols \
src/external/bsd/libfido2/dist/debian/libfido2-dev.install \
src/external/bsd/libfido2/dist/debian/libfido2-dev.links \
src/external/bsd/libfido2/dist/debian/libfido2-dev.manpages \
src/external/bsd/libfido2/dist/debian/libfido2-udev.install \
src/external/bsd/libfido2/dist/debian/rules
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/debian/source/format
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/docker/bionic/Dockerfile
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/fuzz/corpus.tgz
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/openbsd-compat/diff.sh
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/dist/src/hid_netbsd.c
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/tools/macos_pkg.sh
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/libfido2/dist/tools/util.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/lib/Makefile
cvs rdiff -u -r1.2 -r1.3 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/Makefile.inc
diff -u src/external/bsd/libfido2/Makefile.inc:1.2 src/external/bsd/libfido2/Makefile.inc:1.3
--- src/external/bsd/libfido2/Makefile.inc:1.2	Fri Dec  4 13:27:44 2020
+++ src/external/bsd/libfido2/Makefile.inc	Wed Jun 16 21:15:44 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.2 2020/12/04 18:27:44 christos Exp $
+# $NetBSD: Makefile.inc,v 1.3 2021/06/17 01:15:44 christos Exp $
 
 DIST:=${.PARSEDIR}/dist
 
@@ -13,3 +13,6 @@ 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/fido2-assert/Makefile
diff -u src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.1 src/exte

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

2021-05-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun May 30 21:48:42 UTC 2021

Modified Files:
src/external/bsd/tcpdump/dist: print-icmp6.c

Log Message:
Minimal change to suppress unaligned access errors on NetBSD/alpha; add
the UNALIGNED decoration to icmp6 related structures.

PR bin/56199.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/tcpdump/dist/print-icmp6.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/tcpdump/dist/print-icmp6.c
diff -u src/external/bsd/tcpdump/dist/print-icmp6.c:1.13 src/external/bsd/tcpdump/dist/print-icmp6.c:1.14
--- src/external/bsd/tcpdump/dist/print-icmp6.c:1.13	Mon Feb 24 18:39:47 2020
+++ src/external/bsd/tcpdump/dist/print-icmp6.c	Sun May 30 21:48:42 2021
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-icmp6.c,v 1.13 2020/02/24 18:39:47 kamil Exp $");
+__RCSID("$NetBSD: print-icmp6.c,v 1.14 2021/05/30 21:48:42 thorpej Exp $");
 #endif
 
 /* \summary: IPv6 Internet Control Message Protocol (ICMPv6) printer */
@@ -91,7 +91,7 @@ struct icmp6_hdr {
 		uint16_t	icmp6_un_data16[2]; /* type-specific field */
 		uint8_t		icmp6_un_data8[4];  /* type-specific field */
 	} icmp6_dataun;
-};
+} UNALIGNED;
 
 #define icmp6_data32	icmp6_dataun.icmp6_un_data32
 #define icmp6_data16	icmp6_dataun.icmp6_un_data16
@@ -183,7 +183,7 @@ struct icmp6_hdr {
 struct mld6_hdr {
 	struct icmp6_hdr	mld6_hdr;
 	struct in6_addr		mld6_addr; /* multicast address */
-};
+} UNALIGNED;
 
 #define mld6_type	mld6_hdr.icmp6_type
 #define mld6_code	mld6_hdr.icmp6_code
@@ -201,7 +201,7 @@ struct mld6_hdr {
 struct nd_router_solicit {	/* router solicitation */
 	struct icmp6_hdr 	nd_rs_hdr;
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_rs_type	nd_rs_hdr.icmp6_type
 #define nd_rs_code	nd_rs_hdr.icmp6_code
@@ -213,7 +213,7 @@ struct nd_router_advert {	/* router adve
 	uint32_t		nd_ra_reachable;	/* reachable time */
 	uint32_t		nd_ra_retransmit;	/* retransmit timer */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_ra_type		nd_ra_hdr.icmp6_type
 #define nd_ra_code		nd_ra_hdr.icmp6_code
@@ -241,7 +241,7 @@ struct nd_neighbor_solicit {	/* neighbor
 	struct icmp6_hdr	nd_ns_hdr;
 	struct in6_addr		nd_ns_target;	/*target address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_ns_type		nd_ns_hdr.icmp6_type
 #define nd_ns_code		nd_ns_hdr.icmp6_code
@@ -252,7 +252,7 @@ struct nd_neighbor_advert {	/* neighbor 
 	struct icmp6_hdr	nd_na_hdr;
 	struct in6_addr		nd_na_target;	/* target address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_na_type		nd_na_hdr.icmp6_type
 #define nd_na_code		nd_na_hdr.icmp6_code
@@ -268,7 +268,7 @@ struct nd_redirect {		/* redirect */
 	struct in6_addr		nd_rd_target;	/* target address */
 	struct in6_addr		nd_rd_dst;	/* destination address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_rd_type		nd_rd_hdr.icmp6_type
 #define nd_rd_code		nd_rd_hdr.icmp6_code
@@ -301,7 +301,7 @@ struct nd_opt_prefix_info {	/* prefix in
 	nd_uint32_t		nd_opt_pi_preferred_time;
 	nd_uint32_t		nd_opt_pi_reserved2;
 	struct in6_addr	nd_opt_pi_prefix;
-};
+} UNALIGNED;
 
 #define ND_OPT_PI_FLAG_ONLINK		0x80
 #define ND_OPT_PI_FLAG_AUTO		0x40
@@ -313,14 +313,14 @@ struct nd_opt_rd_hdr { /* redire
 	uint16_t	nd_opt_rh_reserved1;
 	uint32_t	nd_opt_rh_reserved2;
 	/* followed by IP header and data */
-};
+} UNALIGNED;
 
 struct nd_opt_mtu {		/* MTU option */
 	uint8_t		nd_opt_mtu_type;
 	uint8_t		nd_opt_mtu_len;
 	uint16_t	nd_opt_mtu_reserved;
 	uint32_t	nd_opt_mtu_mtu;
-};
+} UNALIGNED;
 
 struct nd_opt_rdnss {		/* RDNSS RFC 6106 5.1 */
 	uint8_t		nd_opt_rdnss_type;
@@ -328,7 +328,7 @@ struct nd_opt_rdnss {		/* RDNSS RFC 6106
 	uint16_t	nd_opt_rdnss_reserved;
 	uint32_t	nd_opt_rdnss_lifetime;
 	struct in6_addr nd_opt_rdnss_addr[1];	/* variable-length */
-};
+} UNALIGNED;
 
 struct nd_opt_dnssl {		/* DNSSL RFC 6106 5.2 */
 	uint8_t  nd_opt_dnssl_type;
@@ -336,14 +336,14 @@ struct nd_opt_dnssl {		/* DNSSL RFC 6106
 	uint16_t nd_opt_dnssl_reserved;
 	uint32_t nd_opt_dnssl_lifetime;
 	/* followed by list of DNS search domains, variable-length */
-};
+} UNALIGNED;
 
 struct nd_opt_advinterval {	/* Advertisement interval option */
 	uint8_t		nd_opt_adv_type;
 	uint8_t		nd_opt_adv_len;
 	uint16_t	nd_opt_adv_reserved;
 	uint32_t	nd_opt_adv_interval;
-};
+} UNALIGNED;
 
 struct nd_opt_homeagent_info {	/* Home Agent info */
 	uint8_t		nd_opt_hai_type;
@@ -351,7 +351,7 @@ struct nd_opt_homeagent_info {	/* Home A
 	uint16_t	nd_opt_hai_reserved;
 	int16_t		nd_opt_hai_preference;
 	uint16_t	nd_opt_hai_lifetime;
-};
+} UNALIGNED;
 
 struct nd_opt_route_info {	/* route info */
 	uint8_t		nd_opt_rti_type;
@@ -360,7 +360,7 @@ struct nd_opt_route_info {	/* route info
 	uint8_t		nd_opt_rti_flags;
 	uint32_t	nd_opt_rti_lifetime;
 	/* prefix 

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

2021-05-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun May 30 21:01:43 UTC 2021

Modified Files:
src/external/bsd/tcpdump/dist: print-icmp.c

Log Message:
Minimal change to suppress unaligned access errors on NetBSD/alpha; add
the UNALIGNED decoration to struct icmp.

PR bin/56199.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tcpdump/dist/print-icmp.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/tcpdump/dist/print-icmp.c
diff -u src/external/bsd/tcpdump/dist/print-icmp.c:1.11 src/external/bsd/tcpdump/dist/print-icmp.c:1.12
--- src/external/bsd/tcpdump/dist/print-icmp.c:1.11	Mon Feb 24 18:39:47 2020
+++ src/external/bsd/tcpdump/dist/print-icmp.c	Sun May 30 21:01:43 2021
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-icmp.c,v 1.11 2020/02/24 18:39:47 kamil Exp $");
+__RCSID("$NetBSD: print-icmp.c,v 1.12 2021/05/30 21:01:43 thorpej Exp $");
 #endif
 
 /* \summary: Internet Control Message Protocol (ICMP) printer */
@@ -89,7 +89,7 @@ struct icmp {
 #define	icmp_ip		icmp_dun.id_ip.idi_ip
 #define	icmp_mask	icmp_dun.id_mask
 #define	icmp_data	icmp_dun.id_data
-};
+} UNALIGNED;
 
 #define ICMP_MPLS_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
 #define ICMP_MPLS_EXT_VERSION 2



CVS commit: src/external/bsd/libevent/dist/test

2021-05-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun May 30 00:19:09 UTC 2021

Modified Files:
src/external/bsd/libevent/dist/test: regress_ssl.c

Log Message:
Cast to enums via uintptr_t to avoid compiler warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/test/regress_ssl.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/libevent/dist/test/regress_ssl.c
diff -u src/external/bsd/libevent/dist/test/regress_ssl.c:1.5 src/external/bsd/libevent/dist/test/regress_ssl.c:1.6
--- src/external/bsd/libevent/dist/test/regress_ssl.c:1.5	Wed Apr  7 03:36:48 2021
+++ src/external/bsd/libevent/dist/test/regress_ssl.c	Sun May 30 00:19:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress_ssl.c,v 1.5 2021/04/07 03:36:48 christos Exp $	*/
+/*	$NetBSD: regress_ssl.c,v 1.6 2021/05/30 00:19:08 joerg Exp $	*/
 
 /*
  * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
@@ -891,7 +891,7 @@ regress_bufferevent_openssl_wm(void *arg
 	struct sockaddr_in sin;
 	struct sockaddr_storage ss;
 	enum regress_openssl_type type =
-		(enum regress_openssl_type)data->setup_data;
+		(enum regress_openssl_type)(uintptr_t)data->setup_data;
 	int bev_flags = BEV_OPT_CLOSE_ON_FREE;
 	ev_socklen_t slen;
 	SSL *ssl;



CVS commit: src/external/bsd/libc++/dist/libcxxrt/src

2021-05-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun May 30 00:12:31 UTC 2021

Modified Files:
src/external/bsd/libc++/dist/libcxxrt/src: exception.cc
libelftc_dem_gnu3.c unwind-itanium.h

Log Message:
Merge 47661d00cd4d6cd728ae31b0bb29a49a6c06272a


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/libc++/dist/libcxxrt/src/exception.cc \
src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c \
src/external/bsd/libc++/dist/libcxxrt/src/unwind-itanium.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/bsd/libc++/dist/libcxxrt/src/exception.cc
diff -u src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.2 src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.3
--- src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.2	Fri Jun 26 00:50:39 2015
+++ src/external/bsd/libc++/dist/libcxxrt/src/exception.cc	Sun May 30 00:12:31 2021
@@ -304,13 +304,17 @@ static pthread_key_t eh_key;
 static void exception_cleanup(_Unwind_Reason_Code reason, 
   struct _Unwind_Exception *ex)
 {
-	__cxa_free_exception(static_cast(ex));
+	// Exception layout:
+	// [__cxa_exception [_Unwind_Exception]] [exception object]
+	//
+	// __cxa_free_exception expects a pointer to the exception object
+	__cxa_free_exception(static_cast(ex + 1));
 }
 static void dependent_exception_cleanup(_Unwind_Reason_Code reason, 
   struct _Unwind_Exception *ex)
 {
 
-	__cxa_free_dependent_exception(static_cast(ex));
+	__cxa_free_dependent_exception(static_cast(ex + 1));
 }
 
 /**
@@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_
 		if (info->foreign_exception_state != __cxa_thread_info::none)
 		{
 			_Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions);
-			e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
+			if (e->exception_cleanup)
+e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
 		}
 		else
 		{
@@ -516,7 +521,7 @@ static void emergency_malloc_free(char *
 			break;
 		}
 	}
-	assert(buffer > 0 &&
+	assert(buffer >= 0 &&
 	   "Trying to free something that is not an emergency buffer!");
 	// emergency_malloc() is expected to return 0-initialized data.  We don't
 	// zero the buffer when allocating it, because the static buffers will
@@ -556,7 +561,7 @@ static void free_exception(char *e)
 {
 	// If this allocation is within the address range of the emergency buffer,
 	// don't call free() because it was not allocated with malloc()
-	if ((e > emergency_buffer) &&
+	if ((e >= emergency_buffer) &&
 	(e < (emergency_buffer + sizeof(emergency_buffer
 	{
 		emergency_malloc_free(e);
@@ -854,6 +859,13 @@ extern "C" void __cxa_rethrow()
 
 	assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!");
 
+	// `globals->uncaughtExceptions` was decremented by `__cxa_begin_catch`.
+	// It's normally incremented by `throw_exception`, but this path invokes
+	// `_Unwind_Resume_or_Rethrow` directly to rethrow the exception.
+	// This path is only reachable if we're rethrowing a C++ exception -
+	// foreign exceptions don't adjust any of this state.
+	globals->uncaughtExceptions++;
+
 	// ex->handlerCount will be decremented in __cxa_end_catch in enclosing
 	// catch block
 	
@@ -1199,11 +1211,13 @@ extern "C" void *__cxa_begin_catch(void 
 	// we see is a foreign exception then we won't have called it yet.
 	__cxa_thread_info *ti = thread_info();
 	__cxa_eh_globals *globals = &ti->globals;
-	globals->uncaughtExceptions--;
 	_Unwind_Exception *exceptionObject = static_cast<_Unwind_Exception*>(e);
 
 	if (isCXXException(exceptionObject->exception_class))
 	{
+		// Only exceptions thrown with a C++ exception throwing function will
+		// increment this, so don't decrement it here.
+		globals->uncaughtExceptions--;
 		__cxa_exception *ex =  exceptionFromPointer(exceptionObject);
 
 		if (ex->handlerCount == 0)
@@ -1280,12 +1294,13 @@ extern "C" void __cxa_end_catch()
 	
 	if (ti->foreign_exception_state != __cxa_thread_info::none)
 	{
-		globals->caughtExceptions = 0;
 		if (ti->foreign_exception_state != __cxa_thread_info::rethrown)
 		{
 			_Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ti->globals.caughtExceptions);
-			e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
+			if (e->exception_cleanup)
+e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
 		}
+		globals->caughtExceptions = 0;
 		ti->foreign_exception_state = __cxa_thread_info::none;
 		return;
 	}
@@ -1339,6 +1354,14 @@ extern "C" std::type_info *__cxa_current
 }
 
 /**
+ * Cleanup, ensures that `__cxa_end_catch` is called to balance an explicit
+ * `__cxa_begin_catch` call.
+ */
+static void end_catch(char *)
+{
+	__cxa_end_catch();
+}
+/**
  * ABI function, called when an exception specification is violated.
  *
  * This function does not return.
@@ -13

CVS commit: src/external/bsd/nvi/dist/regex

2021-05-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon May 17 04:01:58 UTC 2021

Modified Files:
src/external/bsd/nvi/dist/regex: regcomp.c

Log Message:
Fix search for collating symbols in form of [[.foo.]], as in a similar
manner as already done for POSIX character classes by upstream:

https://github.com/visrc/nvi/commit/fd5795cc9890581b9783a0ff96e0b44d6b38e26a#diff-42d58222b328681b9923634991312932089876a0242f78cf488157aa24969c1a

(We already have this change since initial import to external/bsd/nvi.)

Found by tnozaki. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/nvi/dist/regex/regcomp.c

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

Modified files:

Index: src/external/bsd/nvi/dist/regex/regcomp.c
diff -u src/external/bsd/nvi/dist/regex/regcomp.c:1.7 src/external/bsd/nvi/dist/regex/regcomp.c:1.8
--- src/external/bsd/nvi/dist/regex/regcomp.c:1.7	Sun Nov 12 16:33:31 2017
+++ src/external/bsd/nvi/dist/regex/regcomp.c	Mon May 17 04:01:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.7 2017/11/12 16:33:31 christos Exp $ */
+/*	$NetBSD: regcomp.c,v 1.8 2021/05/17 04:01:57 rin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994 Henry Spencer.
  * Copyright (c) 1992, 1993, 1994
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)regcomp.c	8.4 (Berkeley) 3/19/94";
 #endif /* LIBC_SCCS and not lint */
 #else
-__RCSID("$NetBSD: regcomp.c,v 1.7 2017/11/12 16:33:31 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.8 2021/05/17 04:01:57 rin Exp $");
 #endif
 
 #include 
@@ -934,7 +934,7 @@ p_b_coll_elem(struct parse *p, int endc)
 	}
 	len = p->next - sp;
 	for (cp = cnames; cp->name != NULL; cp++)
-		if (STRLEN(cp->name) == len && MEMCMP(cp->name, sp, len))
+		if (STRLEN(cp->name) == len && !MEMCMP(cp->name, sp, len))
 			return(cp->code);	/* known name */
 	if (len == 1)
 		return(*sp);	/* single character */



CVS commit: src/external/bsd/wpa/dist/src/common

2021-05-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 15 19:19:55 UTC 2021

Modified Files:
src/external/bsd/wpa/dist/src/common: dpp.c

Log Message:
wpa: fix Clang build

src/external/bsd/wpa/bin/hostapd/../../dist/src/common/dpp.c:5377:7:
error: format specifies type 'unsigned long' but the argument has type
'os_time_t' (aka 'long long') [-Werror,-Wformat]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/wpa/dist/src/common/dpp.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/wpa/dist/src/common/dpp.c
diff -u src/external/bsd/wpa/dist/src/common/dpp.c:1.1.1.2 src/external/bsd/wpa/dist/src/common/dpp.c:1.2
--- src/external/bsd/wpa/dist/src/common/dpp.c:1.1.1.2	Mon Mar  1 01:37:55 2021
+++ src/external/bsd/wpa/dist/src/common/dpp.c	Sat May 15 19:19:55 2021
@@ -5373,8 +5373,9 @@ int dpp_key_expired(const char *timestam
 	}
 
 	if (now.sec > utime) {
-		wpa_printf(MSG_DEBUG, "DPP: Key has expired (%lu < %lu)",
-			   utime, now.sec);
+		wpa_printf(MSG_DEBUG, "DPP: Key has expired (%llu < %llu)",
+			   (unsigned long long)utime,
+			   (unsigned long long)now.sec);
 		return 1;
 	}
 



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

2021-05-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  7 11:11:11 UTC 2021

Modified Files:
src/external/bsd/tmux/dist: mode-tree.c

Log Message:
Don't free things twice (Kengo Nakahara)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tmux/dist/mode-tree.c

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

Modified files:

Index: src/external/bsd/tmux/dist/mode-tree.c
diff -u src/external/bsd/tmux/dist/mode-tree.c:1.7 src/external/bsd/tmux/dist/mode-tree.c:1.8
--- src/external/bsd/tmux/dist/mode-tree.c:1.7	Sat Apr 17 16:42:09 2021
+++ src/external/bsd/tmux/dist/mode-tree.c	Fri May  7 07:11:11 2021
@@ -139,7 +139,7 @@ mode_tree_free_item(struct mode_tree_ite
 	mode_tree_free_items(&mti->children);
 
 	free(__UNCONST(mti->name));
-	free(__UNCONST(mti->name));
+	free(__UNCONST(mti->text));
 	free(__UNCONST(mti->keystr));
 
 	free(mti);



CVS commit: src/external/bsd/compiler_rt/lib/clang/lib/netbsd

2021-05-04 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue May  4 17:23:54 UTC 2021

Modified Files:
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64:
Makefile

Log Message:
compiler_rt: build .a.syms files as part of dependall

The previous target 'all' is a top-level target intended to be specified
by the user.  During the regular build, 'dependall' is used instead of
'all'.  The target 'realall' is common to those two.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64/Makefile
cvs rdiff -u -r1.5 -r1.6 \

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64/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/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.5 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.6
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.5	Fri Apr 30 22:48:37 2021
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile	Tue May  4 17:23:53 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2021/04/30 22:48:37 rillig Exp $
+#	$NetBSD: Makefile,v 1.6 2021/05/04 17:23:53 rillig Exp $
 
 NOSANITIZER=# defined
 
@@ -57,7 +57,7 @@ COPTS+=		-fPIC
 SYMS=		libclang_rt.asan-x86_64.a.syms
 SYMS_EXTRA=	${TOPDIR}/lib/asan/asan.syms.extra
 
-all:		${SYMS}
+realall:	${SYMS}
 
 CLEANFILES+=	${SYMS}
 FILES=		${SYMS}

Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.5 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.6
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.5	Fri Apr 30 22:48:37 2021
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile	Tue May  4 17:23:53 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2021/04/30 22:48:37 rillig Exp $
+#	$NetBSD: Makefile,v 1.6 2021/05/04 17:23:53 rillig Exp $
 
 NOSANITIZER=# defined
 
@@ -40,7 +40,7 @@ COPTS+=		-fPIC
 SYMS=		libclang_rt.asan_cxx-x86_64.a.syms
 SYMS_EXTRA=	${TOPDIR}/lib/asan/asan.syms.extra # Overlooked in upstream compiler-rt (8.0) ?
 
-all:		${SYMS}
+realall:	${SYMS}
 
 CLEANFILES+=	${SYMS}
 FILES=		${SYMS}

Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.5 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.6
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.5	Fri Apr 30 22:48:37 2021
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile	Tue May  4 17:23:54 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2021/04/30 22:48:37 rillig Exp $
+#	$NetBSD: Makefile,v 1.6 2021/05/04 17:23:54 rillig Exp $
 
 NOSANITIZER=# defined
 
@@ -52,7 +52,7 @@ COPTS+=		-fPIC
 SYMS=		libclang_rt.msan-x86_64.a.syms
 SYMS_EXTRA=	${TOPDIR}/lib/msan/msan.syms.extra
 
-all:		${SYMS}
+realall:	${SYMS}
 
 CLEANFILES+=	${SYMS}
 FILES=		${SYMS}

Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile:1.5 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile:1.6
--- src/external/bsd/compiler

CVS commit: src/external/bsd/compiler_rt/lib/clang/lib/netbsd

2021-04-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr 30 22:48:38 UTC 2021

Modified Files:
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64:
Makefile

Log Message:
compiler_rt: generate symbol table early

These libraries have the special feature that they install both the .a
library as well as the .a.syms that is generated from them.  To avoid
the transformation rule .a.a.syms to apply to the files in ${DESTDIR},
that rule has to be disabled during the installation phase.

If the transformation rule were active during installation, the .a.syms
file in ${DESTDIR} would have more than one possible source file, which
eventually leads to an error during installation since in the command
"install a b c", the last argument must be a directory, not a file.

The installation phase should be as minimal as possible anyway,
therefore move the generation of the .syms files to the build phase.

This hopefully fixes the build for HAVE_LLVM=yes, which has been broken
for several weeks now, at least for the official builds.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64/Makefile
cvs rdiff -u -r1.4 -r1.5 \

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64/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/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.4 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.5
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile:1.4	Fri Aug 30 23:36:40 2019
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile	Fri Apr 30 22:48:37 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2019/08/30 23:36:40 kamil Exp $
+#	$NetBSD: Makefile,v 1.5 2021/04/30 22:48:37 rillig Exp $
 
 NOSANITIZER=# defined
 
@@ -57,7 +57,7 @@ COPTS+=		-fPIC
 SYMS=		libclang_rt.asan-x86_64.a.syms
 SYMS_EXTRA=	${TOPDIR}/lib/asan/asan.syms.extra
 
-beforeinstall: ${SYMS}
+all:		${SYMS}
 
 CLEANFILES+=	${SYMS}
 FILES=		${SYMS}

Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.4 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.5
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile:1.4	Fri Aug 30 23:36:40 2019
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile	Fri Apr 30 22:48:37 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2019/08/30 23:36:40 kamil Exp $
+#	$NetBSD: Makefile,v 1.5 2021/04/30 22:48:37 rillig Exp $
 
 NOSANITIZER=# defined
 
@@ -40,7 +40,7 @@ COPTS+=		-fPIC
 SYMS=		libclang_rt.asan_cxx-x86_64.a.syms
 SYMS_EXTRA=	${TOPDIR}/lib/asan/asan.syms.extra # Overlooked in upstream compiler-rt (8.0) ?
 
-beforeinstall: ${SYMS}
+all:		${SYMS}
 
 CLEANFILES+=	${SYMS}
 FILES=		${SYMS}

Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.4 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.5
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile:1.4	Fri Aug 30 23:36:40 2019
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile	Fri Apr 30 22:48:37 2021
@@ -1,4 +1,4 

CVS commit: src/external/bsd/elftoolchain/dist/common

2021-04-29 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Apr 29 17:38:08 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: elfdefinitions.h

Log Message:
Add a version control system marker.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/elftoolchain/dist/common/elfdefinitions.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/bsd/elftoolchain/dist/common/elfdefinitions.h
diff -u src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.6 src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.7
--- src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.6	Thu Apr  8 19:37:43 2021
+++ src/external/bsd/elftoolchain/dist/common/elfdefinitions.h	Thu Apr 29 17:38:08 2021
@@ -1,3 +1,5 @@
+/*	$NetBSD: elfdefinitions.h,v 1.7 2021/04/29 17:38:08 jkoshy Exp $	*/
+
 /*-
  * Copyright (c) 2010,2021 Joseph Koshy
  * All rights reserved.



CVS commit: src/external/bsd/elftoolchain/dist/common

2021-04-24 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Sat Apr 24 09:42:00 UTC 2021

Removed Files:
src/external/bsd/elftoolchain/dist/common: native-elf-format
os.Linux.mk

Log Message:
Remove files that no longer exist upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 \
src/external/bsd/elftoolchain/dist/common/native-elf-format \
src/external/bsd/elftoolchain/dist/common/os.Linux.mk

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



CVS commit: src/external/bsd/compiler_rt/lib/clang/lib/netbsd

2021-04-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 20 23:19:53 UTC 2021

Modified Files:
src/external/bsd/compiler_rt/lib/clang/lib/netbsd: syms.mk

Log Message:
clang: fix build for installing libclang_rt.ubsan_minimal-x86_64.a

The build failed with:

--- install-ubsan_minimal-m64 ---
x86_64--netbsd-install: the last argument
(/.../libclang_rt.ubsan_minimal-x86_64.a.syms)
must name an existing directory

The cause of this is that the suffix transformation rule for .a.a.sym
was active even during 'make install'.

At that point, the make variable .ALLSRC for the target
${DESTDIR}/.../libclang_rt.ubsan_minimal-x86_64.a.sym included not only
the corresponding file from the source directory, but also the potential
source file from the transformation rule, in this case
libclang_rt.ubsan_minimal-x86_64.a.

This led to several file parameters for the command 'install', which is
only allowed if the last parameter names an existing directory.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/syms.mk

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/compiler_rt/lib/clang/lib/netbsd/syms.mk
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/syms.mk:1.3 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/syms.mk:1.4
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/syms.mk:1.3	Fri Aug 30 23:36:40 2019
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/syms.mk	Tue Apr 20 23:19:53 2021
@@ -1,7 +1,8 @@
-#	$NetBSD: syms.mk,v 1.3 2019/08/30 23:36:40 kamil Exp $
+#	$NetBSD: syms.mk,v 1.4 2021/04/20 23:19:53 rillig Exp $
 
 here := ${.PARSEDIR}
 
+.if !make(install)		# allow both .a and .a.syms to be installed
 .SUFFIXES: .a .a.syms
 .a.a.syms:
 	${_MKTARGET_CREATE}
@@ -10,3 +11,4 @@ here := ${.PARSEDIR}
 		${here}/gen_dynamic_list.sh \
 		--extra ${SYMS_EXTRA:Q} \
 		${.IMPSRC} > ${.TARGET}
+.endif



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

2021-04-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 20 17:42:31 UTC 2021

Modified Files:
src/external/bsd/tmux/dist: status.c tmux.h

Log Message:
tmux: move __printflike to the declaration in the header

Noted by Akihiko HAYASHI.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/tmux/dist/status.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/tmux/dist/tmux.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/bsd/tmux/dist/status.c
diff -u src/external/bsd/tmux/dist/status.c:1.12 src/external/bsd/tmux/dist/status.c:1.13
--- src/external/bsd/tmux/dist/status.c:1.12	Mon Apr 19 21:52:17 2021
+++ src/external/bsd/tmux/dist/status.c	Tue Apr 20 17:42:31 2021
@@ -422,7 +422,7 @@ status_redraw(struct client *c)
 }
 
 /* Set a status line message. */
-void __printflike(5, 0)
+void
 status_message_set(struct client *c, int delay, int ignore_styles,
 int ignore_keys, const char *fmt, ...)
 {

Index: src/external/bsd/tmux/dist/tmux.h
diff -u src/external/bsd/tmux/dist/tmux.h:1.18 src/external/bsd/tmux/dist/tmux.h:1.19
--- src/external/bsd/tmux/dist/tmux.h:1.18	Sat Apr 17 20:42:09 2021
+++ src/external/bsd/tmux/dist/tmux.h	Tue Apr 20 17:42:31 2021
@@ -2492,7 +2492,8 @@ struct style_range *status_get_range(str
 void	 status_init(struct client *);
 void	 status_free(struct client *);
 int	 status_redraw(struct client *);
-void status_message_set(struct client *, int, int, int, const char *, ...);
+void status_message_set(struct client *, int, int, int, const char *, ...)
+	__printflike(5, 0);
 void	 status_message_clear(struct client *);
 int	 status_message_redraw(struct client *);
 void	 status_prompt_set(struct client *, struct cmd_find_state *,



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

2021-04-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Apr 19 21:52:17 UTC 2021

Modified Files:
src/external/bsd/tmux/dist: control.c status.c

Log Message:
tmux: fix -Wformat-nonliteral for Clang

dist/control.c:394:17: error: format string is not a string literal
[-Werror,-Wformat-nonliteral]
xvasprintf(&s, fmt, ap);
   ^~~

dist/status.c:436:33: error: format string is not a string literal
[-Werror,-Wformat-nonliteral]
xvasprintf(&c->message_string, fmt, ap);
   ^~~


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tmux/dist/control.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tmux/dist/status.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/tmux/dist/control.c
diff -u src/external/bsd/tmux/dist/control.c:1.2 src/external/bsd/tmux/dist/control.c:1.3
--- src/external/bsd/tmux/dist/control.c:1.2	Sat Apr 17 20:42:09 2021
+++ src/external/bsd/tmux/dist/control.c	Mon Apr 19 21:52:17 2021
@@ -385,7 +385,7 @@ control_pause_pane(struct client *c, str
 }
 
 /* Write a line. */
-static void
+static void __printflike(2, 0)
 control_vwrite(struct client *c, const char *fmt, va_list ap)
 {
 	struct control_state	*cs = c->control_state;

Index: src/external/bsd/tmux/dist/status.c
diff -u src/external/bsd/tmux/dist/status.c:1.11 src/external/bsd/tmux/dist/status.c:1.12
--- src/external/bsd/tmux/dist/status.c:1.11	Sat Apr 17 20:42:09 2021
+++ src/external/bsd/tmux/dist/status.c	Mon Apr 19 21:52:17 2021
@@ -422,7 +422,7 @@ status_redraw(struct client *c)
 }
 
 /* Set a status line message. */
-void
+void __printflike(5, 0)
 status_message_set(struct client *c, int delay, int ignore_styles,
 int ignore_keys, const char *fmt, ...)
 {



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

2021-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 18 14:01:29 UTC 2021

Modified Files:
src/external/bsd/tmux/dist: cmd-display-menu.c window-customize.c
window-tree.c

Log Message:
fix the 32 bit build (I guess the authors don't have any 32 bit machines
anymore)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tmux/dist/cmd-display-menu.c \
src/external/bsd/tmux/dist/window-customize.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/tmux/dist/window-tree.c

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

Modified files:

Index: src/external/bsd/tmux/dist/cmd-display-menu.c
diff -u src/external/bsd/tmux/dist/cmd-display-menu.c:1.2 src/external/bsd/tmux/dist/cmd-display-menu.c:1.3
--- src/external/bsd/tmux/dist/cmd-display-menu.c:1.2	Sat Apr 17 16:42:09 2021
+++ src/external/bsd/tmux/dist/cmd-display-menu.c	Sun Apr 18 10:01:29 2021
@@ -155,7 +155,7 @@ cmd_display_menu_get_position(struct cli
 	else
 		format_add(ft, "popup_centre_x", "%ld", n);
 	n = (tty->sy - 1) / 2 + h / 2;
-	if (n >= tty->sy)
+	if ((unsigned long)n >= tty->sy)
 		format_add(ft, "popup_centre_y", "%u", tty->sy - h);
 	else
 		format_add(ft, "popup_centre_y", "%ld", n);
@@ -188,7 +188,7 @@ cmd_display_menu_get_position(struct cli
 	/* Position in pane. */
 	tty_window_offset(&tc->tty, &ox, &oy, &sx, &sy);
 	n = top + wp->yoff - oy + h;
-	if (n >= tty->sy)
+	if ((unsigned long)n >= tty->sy)
 		format_add(ft, "popup_pane_top", "%u", tty->sy - h);
 	else
 		format_add(ft, "popup_pane_top", "%ld", n);
@@ -236,7 +236,7 @@ cmd_display_menu_get_position(struct cli
 		yp = "#{popup_window_status_line_y}";
 	p = format_expand(ft, yp);
 	n = strtol(p, NULL, 10);
-	if (n < h)
+	if ((unsigned long)n < h)
 		n = 0;
 	else
 		n -= h;
Index: src/external/bsd/tmux/dist/window-customize.c
diff -u src/external/bsd/tmux/dist/window-customize.c:1.2 src/external/bsd/tmux/dist/window-customize.c:1.3
--- src/external/bsd/tmux/dist/window-customize.c:1.2	Sat Apr 17 16:42:10 2021
+++ src/external/bsd/tmux/dist/window-customize.c	Sun Apr 18 10:01:29 2021
@@ -116,7 +116,7 @@ window_customize_get_tag(struct options_
 	uint64_t	offset;
 
 	if (oe == NULL)
-		return ((uint64_t)o);
+		return ((uintptr_t)o);
 	offset = ((const char *)oe - (const char *)options_table) / sizeof *options_table;
 	return ((2ULL << 62)|(offset << 32)|((idx + 1) << 1)|1);
 }
@@ -484,7 +484,7 @@ window_customize_build_keys(struct windo
 		item->idx = -1;
 
 		expanded = format_expand(ft, data->format);
-		child = mode_tree_add(data->data, top, item, (uint64_t)bd,
+		child = mode_tree_add(data->data, top, item, (uintptr_t)bd,
 		expanded, NULL, 0);
 		free(expanded);
 

Index: src/external/bsd/tmux/dist/window-tree.c
diff -u src/external/bsd/tmux/dist/window-tree.c:1.8 src/external/bsd/tmux/dist/window-tree.c:1.9
--- src/external/bsd/tmux/dist/window-tree.c:1.8	Sat Apr 17 16:42:10 2021
+++ src/external/bsd/tmux/dist/window-tree.c	Sun Apr 18 10:01:29 2021
@@ -1257,10 +1257,10 @@ window_tree_key(struct window_mode_entry
 		data->offset++;
 		break;
 	case 'H':
-		mode_tree_expand(data->data, (uint64_t)fsp->s);
-		mode_tree_expand(data->data, (uint64_t)fsp->wl);
-		if (!mode_tree_set_current(data->data, (uint64_t)wme->wp))
-			mode_tree_set_current(data->data, (uint64_t)fsp->wl);
+		mode_tree_expand(data->data, (uintptr_t)fsp->s);
+		mode_tree_expand(data->data, (uintptr_t)fsp->wl);
+		if (!mode_tree_set_current(data->data, (uintptr_t)wme->wp))
+			mode_tree_set_current(data->data, (uintptr_t)fsp->wl);
 		break;
 	case 'm':
 		window_tree_pull_item(item, &ns, &nwl, &nwp);



CVS commit: src/external/bsd/top/dist/machine

2021-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 16 13:02:47 UTC 2021

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
go back to right-aligning the titles for CPU and WCPU.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/top/dist/machine/m_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/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.24 src/external/bsd/top/dist/machine/m_netbsd.c:1.25
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.24	Sat Apr  3 15:25:38 2021
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Fri Apr 16 09:02:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $
+ * $Id: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.25 2021/04/16 13:02:47 christos Exp $");
 #endif
 
 #include 
@@ -103,14 +103,14 @@ struct handle {
  */
 
 static char Proc_header[] =
-  "  PID XPRI NICE   SIZE   RES STATE   TIME  WCPU   CPU   COMMAND";
+  "  PID XPRI NICE   SIZE   RES STATE   TIME   WCPUCPU COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define PROC_UNAME_START 6
 #define Proc_format \
 	"%5d %-8.8s %3d %4d%7s %5s %-9.9s%7s %5.*f%% %5.*f%% %s"
 
 static char Thread_header[] =
-  "  PID   LID XPRI STATE   TIME  WCPU   CPU   NAME  COMMAND";
+  "  PID   LID XPRI STATE   TIME   WCPUCPU NAME  COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define THREAD_UNAME_START 12
 #define Thread_format \



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

2021-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Apr 12 08:55:22 UTC 2021

Modified Files:
src/external/bsd/ekermit/dist: kermit.c

Log Message:
properly size a buffer to include the trailing nul.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ekermit/dist/kermit.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/ekermit/dist/kermit.c
diff -u src/external/bsd/ekermit/dist/kermit.c:1.1.1.1 src/external/bsd/ekermit/dist/kermit.c:1.2
--- src/external/bsd/ekermit/dist/kermit.c:1.1.1.1	Fri Aug  8 19:20:39 2014
+++ src/external/bsd/ekermit/dist/kermit.c	Mon Apr 12 08:55:22 2021
@@ -1291,7 +1291,7 @@ gattr(struct k_data * k, UCHAR * s, stru
 UCHAR c;/* Workers */
 int aln, i, rc;
 
-UCHAR sizebuf[SIZEBUFL];
+UCHAR sizebuf[SIZEBUFL+1];
 
 rc = -1;
 while ((c = *s++)) {		/* Get attribute tag */



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

2021-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Apr 12 08:54:11 UTC 2021

Modified Files:
src/external/bsd/bc/dist: global.h

Log Message:
avoid common symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/global.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/bsd/bc/dist/global.h
diff -u src/external/bsd/bc/dist/global.h:1.1 src/external/bsd/bc/dist/global.h:1.2
--- src/external/bsd/bc/dist/global.h:1.1	Mon Apr 10 02:28:23 2017
+++ src/external/bsd/bc/dist/global.h	Mon Apr 12 08:54:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: global.h,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: global.h,v 1.2 2021/04/12 08:54:11 mrg Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -118,9 +118,9 @@ EXTERN int n_history;
 
 #if defined(LIBEDIT)
 /* LIBEDIT data */
-EditLine *edit INIT(NULL);
-History  *hist;
-HistEvent histev;
+EXTERN EditLine *edit INIT(NULL);
+EXTERN History  *hist;
+EXTERN HistEvent histev;
 #endif
 
 /* "Condition code" -- false (0) or true (1) */



CVS commit: src/external/bsd/ipf/dist/tools

2021-04-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Apr 12 04:09:26 UTC 2021

Modified Files:
src/external/bsd/ipf/dist/tools: ipnat.c

Log Message:
avoid common symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ipf/dist/tools/ipnat.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/ipf/dist/tools/ipnat.c
diff -u src/external/bsd/ipf/dist/tools/ipnat.c:1.3 src/external/bsd/ipf/dist/tools/ipnat.c:1.4
--- src/external/bsd/ipf/dist/tools/ipnat.c:1.3	Sun Feb  4 08:19:42 2018
+++ src/external/bsd/ipf/dist/tools/ipnat.c	Mon Apr 12 04:09:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipnat.c,v 1.3 2018/02/04 08:19:42 mrg Exp $	*/
+/*	$NetBSD: ipnat.c,v 1.4 2021/04/12 04:09:26 mrg Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -75,7 +75,6 @@ static __attribute__((__used__)) const c
 #define	bzero(a,b)	memset(a,0,b)
 #endif
 int	use_inet6 = 0;
-char	thishost[MAXHOSTNAMELEN];
 
 extern	char	*optarg;
 



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

2021-04-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 10 22:59:46 UTC 2021

Modified Files:
src/external/bsd/pkg_install/dist/add: main.c

Log Message:
Fix merge bug.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/add/main.c

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

Modified files:

Index: src/external/bsd/pkg_install/dist/add/main.c
diff -u src/external/bsd/pkg_install/dist/add/main.c:1.3 src/external/bsd/pkg_install/dist/add/main.c:1.4
--- src/external/bsd/pkg_install/dist/add/main.c:1.3	Sat Apr 10 19:49:59 2021
+++ src/external/bsd/pkg_install/dist/add/main.c	Sat Apr 10 22:59:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.3 2021/04/10 19:49:59 nia Exp $	*/
+/*	$NetBSD: main.c,v 1.4 2021/04/10 22:59:46 wiz Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD");
+__RCSID("$NetBSD: main.c,v 1.4 2021/04/10 22:59:46 wiz Exp $");
 
 /*
  *



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

2021-04-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 10 20:07:57 UTC 2021

Modified Files:
src/external/bsd/pkg_install/dist/add: perform.c

Log Message:
fix build, sign comparison is an issue here


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/pkg_install/dist/add/perform.c

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

Modified files:

Index: src/external/bsd/pkg_install/dist/add/perform.c
diff -u src/external/bsd/pkg_install/dist/add/perform.c:1.9 src/external/bsd/pkg_install/dist/add/perform.c:1.10
--- src/external/bsd/pkg_install/dist/add/perform.c:1.9	Sat Apr 10 19:49:59 2021
+++ src/external/bsd/pkg_install/dist/add/perform.c	Sat Apr 10 20:07:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: perform.c,v 1.9 2021/04/10 19:49:59 nia Exp $	*/
+/*	$NetBSD: perform.c,v 1.10 2021/04/10 20:07:57 nia Exp $	*/
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: perform.c,v 1.9 2021/04/10 19:49:59 nia Exp $");
+__RCSID("$NetBSD: perform.c,v 1.10 2021/04/10 20:07:57 nia Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie 
@@ -159,7 +159,7 @@ compatible_platform(const char *opsys, c
 		loc = strchr(host, '.');
 		if (loc != NULL) {
 			majorlen = loc - host;
-			if (majorlen != (strchr(package, '.') - package))
+			if (majorlen != (size_t)(strchr(package, '.') - package))
 return 0;
 			if (strncmp(host, package, majorlen) == 0)
 return 1;



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

2021-04-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 10 19:50:00 UTC 2021

Modified Files:
src/external/bsd/pkg_install/dist/add: add.h main.c perform.c pkg_add.1
src/external/bsd/pkg_install/dist/admin: audit-packages.8 audit.c
check.c download-vulnerability-list.8 pkg_admin.1
src/external/bsd/pkg_install/dist/create: build.c create.h main.c
perform.c pkg_create.1 pl.c
src/external/bsd/pkg_install/dist/delete: pkg_delete.1 pkg_delete.c
src/external/bsd/pkg_install/dist/info: info.h main.c perform.c
pkg_info.1 show.c
src/external/bsd/pkg_install/dist/lib: automatic.c conflicts.c defs.h
dewey.c dewey.h fexec.c file.c global.c gpgsig.c iterate.c lib.h
license.c lpkg.c opattern.c parse-config.c pkcs7.c
pkg_install.conf.5.in pkg_io.c pkg_signature.c pkg_summary.5
pkgdb.c pkgsrc.7 plist.c remove.c str.c var.c version.c version.h
vulnerabilities-file.c xwrapper.c
src/external/bsd/pkg_install/dist/x509: pkgsrc.cnf pkgsrc.sh

Log Message:
merge pkg_install-20210410

- simplified version checking for netbsd, treat 9.0 and 9.1 as compatible
- minor man page updates


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/add/add.h \
src/external/bsd/pkg_install/dist/add/main.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/pkg_install/dist/add/perform.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/add/pkg_add.1
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/pkg_install/dist/admin/audit-packages.8 \
src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.8
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/admin/audit.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/admin/check.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/pkg_install/dist/admin/pkg_admin.1
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/create/build.c \
src/external/bsd/pkg_install/dist/create/create.h \
src/external/bsd/pkg_install/dist/create/main.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/create/perform.c \
src/external/bsd/pkg_install/dist/create/pkg_create.1
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/create/pl.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/pkg_install/dist/delete/pkg_delete.1
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/pkg_install/dist/delete/pkg_delete.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/info/info.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/info/main.c \
src/external/bsd/pkg_install/dist/info/perform.c \
src/external/bsd/pkg_install/dist/info/pkg_info.1
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/info/show.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/lib/automatic.c \
src/external/bsd/pkg_install/dist/lib/conflicts.c \
src/external/bsd/pkg_install/dist/lib/dewey.h \
src/external/bsd/pkg_install/dist/lib/fexec.c \
src/external/bsd/pkg_install/dist/lib/file.c \
src/external/bsd/pkg_install/dist/lib/global.c \
src/external/bsd/pkg_install/dist/lib/gpgsig.c \
src/external/bsd/pkg_install/dist/lib/lpkg.c \
src/external/bsd/pkg_install/dist/lib/opattern.c \
src/external/bsd/pkg_install/dist/lib/pkgsrc.7 \
src/external/bsd/pkg_install/dist/lib/remove.c \
src/external/bsd/pkg_install/dist/lib/str.c \
src/external/bsd/pkg_install/dist/lib/version.c \
src/external/bsd/pkg_install/dist/lib/xwrapper.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/pkg_install/dist/lib/defs.h \
src/external/bsd/pkg_install/dist/lib/pkg_summary.5 \
src/external/bsd/pkg_install/dist/lib/pkgdb.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/lib/dewey.c \
src/external/bsd/pkg_install/dist/lib/parse-config.c \
src/external/bsd/pkg_install/dist/lib/pkcs7.c \
src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in \
src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/lib/iterate.c \
src/external/bsd/pkg_install/dist/lib/pkg_io.c \
src/external/bsd/pkg_install/dist/lib/pkg_signature.c \
src/external/bsd/pkg_install/dist/lib/var.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/pkg_install/dist/lib/lib.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/pkg_install/dist/lib/license.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/pkg_install/dist/lib/plist.c
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/pkg_install/dist/lib/version.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/x509/pkgsrc.cnf \
src/external/bsd/pkg_install/dist/x509/pkgsrc.sh

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

Modified files:

Index: src/external/bsd/pkg_install/dist/add/add.h
diff -u src/external/bsd/pkg_install/dist/add/add.h:1.2 src/external/bsd/pkg_install/dist/ad

CVS commit: src/external/bsd/libevent/dist/test

2021-04-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 10 19:27:16 UTC 2021

Modified Files:
src/external/bsd/libevent/dist/test: regress_http.c

Log Message:
tests/libevent: fix Clang build

No idea why GCC did not complain about this as well.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libevent/dist/test/regress_http.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/libevent/dist/test/regress_http.c
diff -u src/external/bsd/libevent/dist/test/regress_http.c:1.9 src/external/bsd/libevent/dist/test/regress_http.c:1.10
--- src/external/bsd/libevent/dist/test/regress_http.c:1.9	Sat Apr 10 19:18:45 2021
+++ src/external/bsd/libevent/dist/test/regress_http.c	Sat Apr 10 19:27:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $	*/
+/*	$NetBSD: regress_http.c,v 1.10 2021/04/10 19:27:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 2003-2007 Niels Provos 
@@ -36,7 +36,7 @@
 
 #include "event2/event-config.h"
 #include 
-__RCSID("$NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $");
+__RCSID("$NetBSD: regress_http.c,v 1.10 2021/04/10 19:27:16 rillig Exp $");
 
 #include 
 #include 
@@ -4580,7 +4580,11 @@ http_request_own_test(void *arg)
 	test_ok = 1;
 }
 
-static void http_run_bev_request(struct event_base *base, int port,
+static void
+#ifdef __GNUC__
+	__attribute__((format(printf, 3, 4)))
+#endif
+http_run_bev_request(struct event_base *base, int port,
 	const char *fmt, ...)
 {
 	struct bufferevent *bev = NULL;



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

2021-04-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 10 19:18:45 UTC 2021

Modified Files:
src/external/bsd/libevent/dist: bufferevent_ratelim.c evdns.c
event-internal.h event_tagging.c evmap.c evthread-internal.h
ht-internal.h log-internal.h select.c util-internal.h
src/external/bsd/libevent/dist/include/event2: rpc.h
src/external/bsd/libevent/dist/test: regress_http.c tinytest_macros.h

Log Message:
libevent: remove remaining CONSTCOND comments

Since lint1/tree.c 1.202 from 2021-01-31, lint no longer needs the
/*CONSTCOND*/ for do-while-0 "loops".

The comments from this commit were in do-while-0 loops that do not
follow the canonical form, therefore the previous commit did not catch
them.  Some of them have a trailing semicolon (which defies the whole
purpose of the do-while-0 loop), some are missing the space between
'while (0)', some start in column 1 instead of 9.

This reduces the local modifications, compared to the upstream code.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/bufferevent_ratelim.c \
src/external/bsd/libevent/dist/event_tagging.c \
src/external/bsd/libevent/dist/evmap.c \
src/external/bsd/libevent/dist/evthread-internal.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libevent/dist/evdns.c \
src/external/bsd/libevent/dist/log-internal.h \
src/external/bsd/libevent/dist/util-internal.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/event-internal.h \
src/external/bsd/libevent/dist/select.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/ht-internal.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/include/event2/rpc.h
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/libevent/dist/test/regress_http.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/libevent/dist/test/tinytest_macros.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/bsd/libevent/dist/bufferevent_ratelim.c
diff -u src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.5 src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.6
--- src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.5	Sat Apr 10 19:02:37 2021
+++ src/external/bsd/libevent/dist/bufferevent_ratelim.c	Sat Apr 10 19:18:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufferevent_ratelim.c,v 1.5 2021/04/10 19:02:37 rillig Exp $	*/
+/*	$NetBSD: bufferevent_ratelim.c,v 1.6 2021/04/10 19:18:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -213,7 +213,7 @@ bufferevent_get_rlim_max_(struct buffere
 	do {	\
 		if (max_so_far > (x))		\
 			max_so_far = (x);	\
-	} while (/*CONSTCOND*/0);
+	} while (0);
 
 	if (!bev->rate_limiting)
 		return max_so_far;
Index: src/external/bsd/libevent/dist/event_tagging.c
diff -u src/external/bsd/libevent/dist/event_tagging.c:1.5 src/external/bsd/libevent/dist/event_tagging.c:1.6
--- src/external/bsd/libevent/dist/event_tagging.c:1.5	Wed Apr  7 03:36:48 2021
+++ src/external/bsd/libevent/dist/event_tagging.c	Sat Apr 10 19:18:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: event_tagging.c,v 1.5 2021/04/07 03:36:48 christos Exp $	*/
+/*	$NetBSD: event_tagging.c,v 1.6 2021/04/10 19:18:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 2003-2009 Niels Provos 
@@ -29,7 +29,7 @@
 
 #include "event2/event-config.h"
 #include 
-__RCSID("$NetBSD: event_tagging.c,v 1.5 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: event_tagging.c,v 1.6 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef EVENT__HAVE_SYS_TYPES_H
@@ -143,7 +143,7 @@ evtag_init(void)
 	data[0] = (data[0] & 0x0f) | ((nibbles & 0x0f) << 4);		\
 	\
 	return ((off + 1) / 2);		\
-} while (/*CONSTCOND*/0)
+} while (0)
 
 static inline int
 encode_int_internal(ev_uint8_t *data, ev_uint32_t number)
@@ -355,7 +355,7 @@ do {	\
 	*pnumber = number;		\
 	\
 	return (int)(len);		\
-} while (/*CONSTCOND*/0)
+} while (0)
 
 /* Internal: decode an integer from an evbuffer, without draining it.
  *  Only integers up to 32-bits are supported.
Index: src/external/bsd/libevent/dist/evmap.c
diff -u src/external/bsd/libevent/dist/evmap.c:1.5 src/external/bsd/libevent/dist/evmap.c:1.6
--- src/external/bsd/libevent/dist/evmap.c:1.5	Sat Apr 10 19:02:37 2021
+++ src/external/bsd/libevent/dist/evmap.c	Sat Apr 10 19:18:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $	*/
+/*	$NetBSD: evmap.c,v 1.6 2021/04/10 19:18:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -27,7 +27,7 @@
  */
 #include "event2/event-config.h"
 #include 
-__RCSID("$NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $");
+__RCSID("$NetBSD: evmap.c,v 1.6 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef _WIN32
@@ -121,7 +121,7 @@ HT_GENERATE(event_io_map, event_map_entr
 		key_.fd = slot;

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

2021-04-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 10 19:02:37 UTC 2021

Modified Files:
src/external/bsd/libevent/dist: bufferevent-internal.h bufferevent.c
bufferevent_ratelim.c evbuffer-internal.h evdns.c evmap.c
evthread-internal.h ratelim-internal.h util-internal.h
src/external/bsd/libevent/dist/test: regress.c regress.h
regress_buffer.c regress_http.c regress_util.c

Log Message:
libevent: remove unnecessary CONSTCOND comments

Since lint1/tree.c 1.202 from 2021-01-31, lint no longer needs the
/*CONSTCOND*/ for do-while-0 "loops".

This reduces the local modifications.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/libevent/dist/bufferevent-internal.h \
src/external/bsd/libevent/dist/bufferevent_ratelim.c \
src/external/bsd/libevent/dist/evmap.c \
src/external/bsd/libevent/dist/evthread-internal.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/bufferevent.c \
src/external/bsd/libevent/dist/evbuffer-internal.h \
src/external/bsd/libevent/dist/evdns.c \
src/external/bsd/libevent/dist/util-internal.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/ratelim-internal.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/libevent/dist/test/regress.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libevent/dist/test/regress.h \
src/external/bsd/libevent/dist/test/regress_buffer.c \
src/external/bsd/libevent/dist/test/regress_http.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/test/regress_util.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/libevent/dist/bufferevent-internal.h
diff -u src/external/bsd/libevent/dist/bufferevent-internal.h:1.4 src/external/bsd/libevent/dist/bufferevent-internal.h:1.5
--- src/external/bsd/libevent/dist/bufferevent-internal.h:1.4	Wed Apr  7 03:36:48 2021
+++ src/external/bsd/libevent/dist/bufferevent-internal.h	Sat Apr 10 19:02:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufferevent-internal.h,v 1.4 2021/04/07 03:36:48 christos Exp $	*/
+/*	$NetBSD: bufferevent-internal.h,v 1.5 2021/04/10 19:02:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
@@ -461,14 +461,14 @@ bufferevent_socket_set_conn_address_(str
 	do {\
 		if (evutil_timerisset(&(bev)->timeout_read))		\
 			event_add(&(bev)->ev_read, &(bev)->timeout_read); \
-	} while (/*CONSTCOND*/0)
+	} while (0)
 /** Internal use: We have just successfully written data from an inbuf, so
  * reset the read timeout (if any). */
 #define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev)\
 	do {\
 		if (evutil_timerisset(&(bev)->timeout_write))		\
 			event_add(&(bev)->ev_write, &(bev)->timeout_write); \
-	} while (/*CONSTCOND*/0)
+	} while (0)
 #define BEV_DEL_GENERIC_READ_TIMEOUT(bev)	\
 		event_del(&(bev)->ev_read)
 #define BEV_DEL_GENERIC_WRITE_TIMEOUT(bev)	\
@@ -487,13 +487,13 @@ bufferevent_socket_set_conn_address_(str
 #define BEV_LOCK(b) do {		\
 		struct bufferevent_private *locking =  BEV_UPCAST(b);	\
 		EVLOCK_LOCK(locking->lock, 0);\
-	} while (/*CONSTCOND*/0)
+	} while (0)
 
 /** Internal: Release the lock (if any) on a bufferevent */
 #define BEV_UNLOCK(b) do {		\
 		struct bufferevent_private *locking =  BEV_UPCAST(b);	\
 		EVLOCK_UNLOCK(locking->lock, 0);			\
-	} while (/*CONSTCOND*/0)
+	} while (0)
 #endif
 
 
Index: src/external/bsd/libevent/dist/bufferevent_ratelim.c
diff -u src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.4 src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.5
--- src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.4	Wed Apr  7 03:36:48 2021
+++ src/external/bsd/libevent/dist/bufferevent_ratelim.c	Sat Apr 10 19:02:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufferevent_ratelim.c,v 1.4 2021/04/07 03:36:48 christos Exp $	*/
+/*	$NetBSD: bufferevent_ratelim.c,v 1.5 2021/04/10 19:02:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -484,7 +484,7 @@ bev_group_random_element_(struct buffere
 		bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
 			block ;		\
 		}			\
-	} while (/*CONSTCOND*/0)
+	} while (0)
 
 static void
 bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g)
Index: src/external/bsd/libevent/dist/evmap.c
diff -u src/external/bsd/libevent/dist/evmap.c:1.4 src/external/bsd/libevent/dist/evmap.c:1.5
--- src/external/bsd/libevent/dist/evmap.c:1.4	Wed Apr  7 03:36:48 2021
+++ src/external/bsd/libevent/dist/evmap.c	Sat Apr 10 19:02:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: evmap.c,v 1.4 2021/04/07 03:36:48 christos Exp $	*/
+/*	$NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -27,7 +27,7 @@
  */
 #include "event2/event-config.h"
 #include 
-__RCSID("$NetBSD: evmap.c,v 1.4 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBS

CVS commit: src/external/bsd/atf/dist/tools

2021-04-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Apr 10 10:32:57 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.1 atf-run.cpp

Log Message:
Add support for running individual test cases under isolation.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/atf-run.1
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/tools/atf-run.cpp

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/atf/dist/tools/atf-run.1
diff -u src/external/bsd/atf/dist/tools/atf-run.1:1.4 src/external/bsd/atf/dist/tools/atf-run.1:1.5
--- src/external/bsd/atf/dist/tools/atf-run.1:1.4	Sat Feb  8 19:13:44 2014
+++ src/external/bsd/atf/dist/tools/atf-run.1	Sat Apr 10 10:32:57 2021
@@ -26,23 +26,22 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 1, 2010
+.Dd April 10, 2021
 .Dt ATF-RUN 1
 .Os
 .Sh NAME
 .Nm atf-run
-.Nd executes a collection of test programs
+.Nd executes a collection of tests
 .Sh SYNOPSIS
 .Nm
 .Op Fl v Ar var1=value1 Op .. Fl v Ar varN=valueN
-.Op Ar test_program1 Op Ar .. test_programN
+.Op Ar test1 Op Ar .. testN
 .Nm
 .Fl h
 .Sh DESCRIPTION
 .Nm
-executes a collection of test programs or, in other words, a complete
-test suite.
-The results of each test program are collected by the tool, and are then
+executes a collection of test cases, test programs, or a complete test suite.
+The results of each test are collected by the tool, and are then
 multiplexed into a single machine-parseable report; see
 .Xr atf-formats 5
 for more details.
@@ -70,8 +69,14 @@ In the first synopsis form,
 parses the
 .Pa Atffile
 in the current directory and runs all the test programs specified in it.
-If any test program names are given as part of the command line, those are
-the ones executed instead of the complete list.
+If any
+.Ar test
+arguments are given as part of the command line, those tests are
+executed instead of the complete list.  Each
+.Ar test
+argument can be either the name of a test program, or a string of the form
+.Ar test_program:test_case
+to execute a single test case.
 .Pp
 In the second synopsis form,
 .Nm

Index: src/external/bsd/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.5 src/external/bsd/atf/dist/tools/atf-run.cpp:1.6
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.5	Tue Feb 11 18:13:45 2014
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Sat Apr 10 10:32:57 2021
@@ -81,11 +81,13 @@ class atf_run : public tools::applicatio
 
 size_t count_tps(std::vector< std::string >) const;
 
-int run_test(const tools::fs::path&, tools::test_program::atf_tps_writer&,
+int run_test(const tools::fs::path&, const std::string &,
+ tools::test_program::atf_tps_writer&,
  const vars_map&);
 int run_test_directory(const tools::fs::path&,
tools::test_program::atf_tps_writer&);
 int run_test_program(const tools::fs::path&,
+ const std::string tc,
  tools::test_program::atf_tps_writer&,
  const vars_map&);
 
@@ -179,7 +181,7 @@ std::string
 atf_run::specific_args(void)
 const
 {
-return "[test-program1 .. test-programN]";
+return "[test1 .. testN]";
 }
 
 atf_run::options_set
@@ -214,6 +216,7 @@ atf_run::parse_vflag(const std::string& 
 
 int
 atf_run::run_test(const tools::fs::path& tp,
+  const std::string &tc,
   tools::test_program::atf_tps_writer& w,
   const vars_map& config)
 {
@@ -226,7 +229,7 @@ atf_run::run_test(const tools::fs::path&
 const vars_map effective_config =
 tools::config_file::merge_configs(config, m_cmdline_vars);
 
-errcode = run_test_program(tp, w, effective_config);
+errcode = run_test_program(tp, tc, w, effective_config);
 }
 return errcode;
 }
@@ -247,7 +250,7 @@ atf_run::run_test_directory(const tools:
 bool ok = true;
 for (std::vector< std::string >::const_iterator iter = af.tps().begin();
  iter != af.tps().end(); iter++) {
-const bool result = run_test(tp / *iter, w,
+const bool result = run_test(tp / *iter, "", w,
 tools::config_file::merge_configs(af.conf(), test_suite_vars));
 ok &= (result == EXIT_SUCCESS);
 }
@@ -362,6 +365,7 @@ atf_run::get_test_case_result(const std:
 
 int
 atf_run::run_test_program(const tools::fs::path& tp,
+  const std::string tc,
   tools::test_program::atf_tps_writer& w,
   const vars_map& config)
 {
@@ -394,6 +398,9 @@ atf_run::run_test_program(const tools::f
 const std::string& tcname = (*iter).first;
 const vars_map& tcmd = (*iter).second;
 
+   

CVS commit: src/external/bsd/file

2021-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  9 19:11:42 UTC 2021

Modified Files:
src/external/bsd/file/dist: ChangeLog config.guess config.h.in
configure configure.ac
src/external/bsd/file/dist/doc: file.1 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive cad coff commands diff
elf filesystems games jpeg linux mail.news msdos pgp xenix
src/external/bsd/file/dist/python: Makefile.in
src/external/bsd/file/dist/src: apprentice.c compress.c der.c
encoding.c file.c file.h funcs.c is_csv.c magic.c readelf.c
softmagic.c
src/external/bsd/file/dist/tests: Makefile.in
src/external/bsd/file/include: config.h

Log Message:
merge local changes between 5.39 and 5.40 and add magic entries from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/config.guess
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/config.h.in
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/magic/magdir/archive
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/bsd/file/dist/magic/magdir/cad
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/file/dist/magic/magdir/coff
cvs rdiff -u -r1.1.1.14 -r1.2 \
src/external/bsd/file/dist/magic/magdir/commands
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/magic/magdir/diff \
src/external/bsd/file/dist/magic/magdir/jpeg
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/magic/magdir/elf
cvs rdiff -u -r1.17 -r1.18 \
src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.1.1.10 -r1.2 src/external/bsd/file/dist/magic/magdir/games
cvs rdiff -u -r1.1.1.16 -r1.2 src/external/bsd/file/dist/magic/magdir/linux \
src/external/bsd/file/dist/magic/magdir/msdos
cvs rdiff -u -r1.1.1.9 -r1.2 \
src/external/bsd/file/dist/magic/magdir/mail.news
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/magic/magdir/xenix
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/python/Makefile.in
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/der.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/encoding.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/file.c \
src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/funcs.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/is_csv.c
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/tests/Makefile.in
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/include/config.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/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.11 src/external/bsd/file/dist/ChangeLog:1.12
--- src/external/bsd/file/dist/ChangeLog:1.11	Sun Jun 14 20:37:24 2020
+++ src/external/bsd/file/dist/ChangeLog	Fri Apr  9 15:11:41 2021
@@ -1,3 +1,33 @@
+2021-03-30  20:21  Christos Zoulas 
+
+	* release 5.40
+
+2021-02-05  16:31  Christos Zoulas 
+
+	* PR/234: Add limit to the number of bytes to scan for encoding
+	* PR/230: Fix /T (trim flag) for regex
+
+2021-02-01  12:31  Christos Zoulas 
+	* PR/77: Trim trailing separator.
+
+2020-12-17  15:44  Christos Zoulas 
+
+	* PR/211: Convert system read errors from corrupt ELF
+	  files into human readable error messages
+
+2020-12-08  16:24  Christos Zoulas 
+	
+	* fix multithreaded decompression file descriptor issue
+	  by using close-on-exec (Denys Vlasenko)
+
+2020-06-27  11:58  Christos Zoulas 
+
+	* Exclude surrogate pairs from utf-8 detection (Michael Liu)
+
+2020-06-25  12:53  Christos Zoulas 
+	
+	* Include # to the list of ignored format chars (Werner Fink)
+
 2020-06-14  20:02  Christos Zoulas 
 
 	* release 5.39

Index: src/external/bsd/file/dist/config.guess
diff -u src/external/bsd/file/dist/config.guess:1.14 src/external/bsd/file/dist/config.guess:1.15
--- src/external/bsd/file/dist/config.guess:1.14	Tue Nov 17 05:35:11 2020
+++ src/external/bsd/file/dist/config.guess	Fri Apr  9 15:11:41 202

CVS commit: src/external/bsd/elftoolchain/dist/common

2021-04-08 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Apr  8 19:37:43 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: elfdefinitions.h

Log Message:
Update Elftoolchain 'common/elfdefinitions.h' to upstream r3943.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/elftoolchain/dist/common/elfdefinitions.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/bsd/elftoolchain/dist/common/elfdefinitions.h
diff -u src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.5 src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.6
--- src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.5	Sun Mar  7 14:53:59 2021
+++ src/external/bsd/elftoolchain/dist/common/elfdefinitions.h	Thu Apr  8 19:37:43 2021
@@ -1,7 +1,5 @@
-/*	$NetBSD: elfdefinitions.h,v 1.5 2021/03/07 14:53:59 jkoshy Exp $	*/
-
 /*-
- * Copyright (c) 2010 Joseph Koshy
+ * Copyright (c) 2010,2021 Joseph Koshy
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,2969 +23,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Id: elfdefinitions.h 3916 2020-12-12 11:26:53Z jkoshy
- */
-
-/*
- * These definitions are based on:
- * - The public specification of the ELF format as defined in the
- *   October 2009 draft of System V ABI.
- *   See: http://www.sco.com/developers/gabi/latest/ch4.intro.html
- * - The May 1998 (version 1.5) draft of "The ELF-64 object format".
- * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips,
- *   ia64, powerpc, and RISC-V processors.
- * - The "Linkers and Libraries Guide", from Sun Microsystems.
+ * Id: elfdefinitions.h 3942 2021-04-05 12:16:03Z jkoshy
  */
 
 #ifndef _ELFDEFINITIONS_H_
 #define _ELFDEFINITIONS_H_
 
-#include 
-
-/*
- * Types of capabilities.
- */
-
-#define	_ELF_DEFINE_CAPABILITIES()\
-_ELF_DEFINE_CA(CA_SUNW_NULL,	0,	"ignored")		\
-_ELF_DEFINE_CA(CA_SUNW_HW_1,	1,	"hardware capability")	\
-_ELF_DEFINE_CA(CA_SUNW_SW_1,	2,	"software capability")
-
-#undef	_ELF_DEFINE_CA
-#define	_ELF_DEFINE_CA(N, V, DESCR)	N = V ,
-enum {
-	_ELF_DEFINE_CAPABILITIES()
-	CA__LAST__
-};
-
-/*
- * Flags used with dynamic linking entries.
- */
-
-#define	_ELF_DEFINE_DYN_FLAGS()	\
-_ELF_DEFINE_DF(DF_ORIGIN,   0x1,			\
-	"object being loaded may refer to $ORIGIN")		\
-_ELF_DEFINE_DF(DF_SYMBOLIC, 0x2,			\
-	"search library for references before executable")	\
-_ELF_DEFINE_DF(DF_TEXTREL,  0x4,			\
-	"relocation entries may modify text segment")		\
-_ELF_DEFINE_DF(DF_BIND_NOW, 0x8,			\
-	"process relocation entries at load time")		\
-_ELF_DEFINE_DF(DF_STATIC_TLS,   0x10,			\
-	"uses static thread-local storage")			\
-_ELF_DEFINE_DF(DF_1_BIND_NOW,   0x1,			\
-	"process relocation entries at load time")		\
-_ELF_DEFINE_DF(DF_1_GLOBAL, 0x2,			\
-	"unused")		\
-_ELF_DEFINE_DF(DF_1_GROUP,  0x4,			\
-	"object is a member of a group")			\
-_ELF_DEFINE_DF(DF_1_NODELETE,   0x8,			\
-	"object cannot be deleted from a process")		\
-_ELF_DEFINE_DF(DF_1_LOADFLTR,   0x10,			\
-	"immediate load filtees")\
-_ELF_DEFINE_DF(DF_1_INITFIRST,  0x20,			\
-	"initialize object first")\
-_ELF_DEFINE_DF(DF_1_NOOPEN, 0x40,			\
-	"disallow dlopen()")	\
-_ELF_DEFINE_DF(DF_1_ORIGIN, 0x80,			\
-	"object being loaded may refer to $ORIGIN")		\
-_ELF_DEFINE_DF(DF_1_DIRECT, 0x100,			\
-	"direct bindings enabled")\
-_ELF_DEFINE_DF(DF_1_INTERPOSE,  0x400,			\
-	"object is interposer")	\
-_ELF_DEFINE_DF(DF_1_NODEFLIB,   0x800,			\
-	"ignore default library search path")			\
-_ELF_DEFINE_DF(DF_1_NODUMP, 0x1000,			\
-	"disallow dldump()")	\
-_ELF_DEFINE_DF(DF_1_CONFALT,0x2000,			\
-	"object is a configuration alternative")		\
-_ELF_DEFINE_DF(DF_1_ENDFILTEE,  0x4000,			\
-	"filtee terminates filter search")			\
-_ELF_DEFINE_DF(DF_1_DISPRELDNE, 0x8000,			\
-	"displacement relocation done")\
-_ELF_DEFINE_DF(DF_1_DISPRELPND, 0x1,			\
-	"displacement relocation pending")
-#undef	_ELF_DEFINE_DF
-#define	_ELF_DEFINE_DF(N, V, DESCR)	N = V ,
-enum {
-	_ELF_DEFINE_DYN_FLAGS()
-	DF__LAST__
-};
-
-
-/*
- * Dynamic linking entry types.
- */
-
-#define	_ELF_DEFINE_DYN_TYPES()		\
-_ELF_DEFINE_DT(DT_NULL, 0, "end of array")			\
-_ELF_DEFINE_DT(DT_NEEDED,   1, "names a needed library")	\
-_ELF_DEFINE_DT(DT_PLTRELSZ, 2,	\
-	"size in bytes of associated relocation entries")		\
-_ELF_DEFINE_DT(DT_PLTGOT,   3,	\
-	"address associated with the procedure linkage table")		\
-_ELF_DEFINE_DT(DT_HASH, 4,	\
-	"address of the symbol hash table")\
-_ELF_DEFINE_DT(DT_STRTAB,   5,	\
-	"address of the string table")	\
-_ELF_DEFINE_DT(DT_SYMTAB,   

CVS commit: src/external/bsd/elftoolchain

2021-04-07 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Wed Apr  7 20:32:55 UTC 2021

Modified Files:
src/external/bsd/elftoolchain: Makefile

Log Message:
Traverse the Elftoolchain 'common' module before
the rest of the imported hierarchy.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/elftoolchain/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/elftoolchain/Makefile
diff -u src/external/bsd/elftoolchain/Makefile:1.2 src/external/bsd/elftoolchain/Makefile:1.3
--- src/external/bsd/elftoolchain/Makefile:1.2	Tue Apr  6 19:44:24 2021
+++ src/external/bsd/elftoolchain/Makefile	Wed Apr  7 20:32:54 2021
@@ -1,5 +1,6 @@
-# $NetBSD: Makefile,v 1.2 2021/04/06 19:44:24 jkoshy Exp $
+# $NetBSD: Makefile,v 1.3 2021/04/07 20:32:54 jkoshy Exp $
 SUBDIR=		common
+SUBDIR+=	.WAIT		# 'common' should be processed first.
 SUBDIR+=	lib
 
 .include 



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

2021-04-07 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Wed Apr  7 20:31:16 UTC 2021

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

Log Message:
Ensure that the 'libelf' directory is traversed before 'libdwarf'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/elftoolchain/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/elftoolchain/lib/Makefile
diff -u src/external/bsd/elftoolchain/lib/Makefile:1.1 src/external/bsd/elftoolchain/lib/Makefile:1.2
--- src/external/bsd/elftoolchain/lib/Makefile:1.1	Sun Mar  9 16:58:04 2014
+++ src/external/bsd/elftoolchain/lib/Makefile	Wed Apr  7 20:31:16 2021
@@ -1,3 +1,6 @@
-#	$NetBSD: Makefile,v 1.1 2014/03/09 16:58:04 christos Exp $
-SUBDIR=	libelf libdwarf
+#	$NetBSD: Makefile,v 1.2 2021/04/07 20:31:16 jkoshy Exp $
+SUBDIR=		libelf
+SUBDIR+=	.WAIT		# Process 'libelf' before 'libdwarf'.
+SUBDIR+=	libdwarf
+
 .include 



CVS commit: src/external/bsd/elftoolchain

2021-04-06 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Tue Apr  6 19:44:24 UTC 2021

Modified Files:
src/external/bsd/elftoolchain: Makefile

Log Message:
Mirror upstream build steps: traverse 'common' before traversing 'lib'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/elftoolchain/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/elftoolchain/Makefile
diff -u src/external/bsd/elftoolchain/Makefile:1.1 src/external/bsd/elftoolchain/Makefile:1.2
--- src/external/bsd/elftoolchain/Makefile:1.1	Sun Mar  9 16:58:03 2014
+++ src/external/bsd/elftoolchain/Makefile	Tue Apr  6 19:44:24 2021
@@ -1,3 +1,5 @@
-# $NetBSD: Makefile,v 1.1 2014/03/09 16:58:03 christos Exp $
-SUBDIR=lib
+# $NetBSD: Makefile,v 1.2 2021/04/06 19:44:24 jkoshy Exp $
+SUBDIR=		common
+SUBDIR+=	lib
+
 .include 



CVS commit: src/external/bsd/elftoolchain/common

2021-04-06 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Tue Apr  6 19:40:20 UTC 2021

Added Files:
src/external/bsd/elftoolchain/common: Makefile
src/external/bsd/elftoolchain/common/sys: Makefile

Log Message:
Prepare for  and  to be installed
into ${DESTDIR}/usr/include.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/elftoolchain/common/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/elftoolchain/common/sys/Makefile

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/elftoolchain/common/Makefile
diff -u /dev/null src/external/bsd/elftoolchain/common/Makefile:1.1
--- /dev/null	Tue Apr  6 19:40:20 2021
+++ src/external/bsd/elftoolchain/common/Makefile	Tue Apr  6 19:40:19 2021
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.1 2021/04/06 19:40:19 jkoshy Exp $
+
+.include 
+
+TOP=	${.CURDIR}/../dist
+SRCDIR=	${TOP}/common
+
+.PATH:	${SRCDIR}
+
+SUBDIR=		sys
+
+INCS=		elfdefinitions.h
+INCSDIR=	/usr/include
+
+.PHONY:	all clean clobber depend obj
+
+all depend:
+
+clean clobber:
+	rm -f ${CLEANFILES}
+
+cleandepend:
+	rm -f ${.OBJDIR}/.depend
+
+.include 
+.include 

Index: src/external/bsd/elftoolchain/common/sys/Makefile
diff -u /dev/null src/external/bsd/elftoolchain/common/sys/Makefile:1.1
--- /dev/null	Tue Apr  6 19:40:20 2021
+++ src/external/bsd/elftoolchain/common/sys/Makefile	Tue Apr  6 19:40:19 2021
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2021/04/06 19:40:19 jkoshy Exp $
+
+.include 
+
+TOP=	${.CURDIR}/../../dist
+SRCDIR=	${TOP}/common/sys
+
+.PATH:	${SRCDIR}
+
+INCS=		elfdefinitions.h
+INCSDIR=	/usr/include/sys
+
+elfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
+	${TOOL_M4} -I${SRCDIR} -D SRCDIR=${SRCDIR} ${M4FLAGS} \
+		elfdefinitions.m4 > ${.TARGET}
+
+.PHONY:	all clean clobber depend
+
+all depend:	elfdefinitions.h
+
+clean clobber:
+	rm -f ${INCS}
+
+cleandepend:
+	rm -f ${.OBJDIR}/.depend
+
+.include 
+.include 



CVS commit: src/external/bsd/elftoolchain/dist/common

2021-04-06 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Tue Apr  6 19:28:26 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: Makefile

Log Message:
Sync with upstream r3943.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/elftoolchain/dist/common/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/elftoolchain/dist/common/Makefile
diff -u src/external/bsd/elftoolchain/dist/common/Makefile:1.2 src/external/bsd/elftoolchain/dist/common/Makefile:1.3
--- src/external/bsd/elftoolchain/dist/common/Makefile:1.2	Thu Nov 26 21:52:00 2020
+++ src/external/bsd/elftoolchain/dist/common/Makefile	Tue Apr  6 19:28:25 2021
@@ -1,7 +1,9 @@
-# Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy
+# Id: Makefile 3938 2021-04-04 18:16:18Z jkoshy
 
 TOP=	..
 
+SUBDIR=		sys
+
 INCS=		elfdefinitions.h
 INCSDIR=	/usr/include
 
@@ -16,3 +18,4 @@ cleandepend:
 	rm -f ${.OBJDIR}/.depend
 
 .include "${TOP}/mk/elftoolchain.inc.mk"
+.include "${TOP}/mk/elftoolchain.subdir.mk"



CVS commit: src/external/bsd/elftoolchain/dist/common/sys

2021-04-06 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Tue Apr  6 18:38:04 UTC 2021

Added Files:
src/external/bsd/elftoolchain/dist/common/sys: Makefile elfconstants.m4
elfdefinitions.m4

Log Message:
Add files present in upstream revision r3943.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/elftoolchain/dist/common/sys/Makefile \
src/external/bsd/elftoolchain/dist/common/sys/elfconstants.m4 \
src/external/bsd/elftoolchain/dist/common/sys/elfdefinitions.m4

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/elftoolchain/dist/common/sys/Makefile
diff -u /dev/null src/external/bsd/elftoolchain/dist/common/sys/Makefile:1.1
--- /dev/null	Tue Apr  6 18:38:04 2021
+++ src/external/bsd/elftoolchain/dist/common/sys/Makefile	Tue Apr  6 18:38:04 2021
@@ -0,0 +1,25 @@
+# Id: Makefile 3943 2021-04-05 17:03:34Z jkoshy
+
+TOP=	../..
+
+SRCS=		elfdefinitions.m4 elfconstants.m4
+INCS=		elfdefinitions.h
+INCSDIR=	/usr/include/sys
+
+CLEANFILES=	${INCS}
+
+.PHONY:	all clean clobber depend obj
+
+all:	${INCS}
+
+elfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
+	m4 -I${.CURDIR} -D SRCDIR=${.CURDIR} ${M4FLAGS} \
+		elfdefinitions.m4 > ${.TARGET}
+
+depend cleandepend:
+
+clean clobber:
+	rm -f ${CLEANFILES}
+
+.include "${TOP}/mk/elftoolchain.inc.mk"
+.include "${TOP}/mk/elftoolchain.m4.mk"
Index: src/external/bsd/elftoolchain/dist/common/sys/elfconstants.m4
diff -u /dev/null src/external/bsd/elftoolchain/dist/common/sys/elfconstants.m4:1.1
--- /dev/null	Tue Apr  6 18:38:04 2021
+++ src/external/bsd/elftoolchain/dist/common/sys/elfconstants.m4	Tue Apr  6 18:38:04 2021
@@ -0,0 +1,2592 @@
+# Copyright (c) 2010,2021 Joseph Koshy
+# 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 AUTHOR 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 AUTHOR 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.
+
+# These definitions are based on:
+# - The public specification of the ELF format as defined in the
+#   October 2009 draft of System V ABI.
+#   See: http://www.sco.com/developers/gabi/latest/ch4.intro.html
+# - The May 1998 (version 1.5) draft of "The ELF-64 object format".
+# - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips,
+#   ia64, powerpc, and RISC-V processors.
+# - The "Linkers and Libraries Guide", from Sun Microsystems.
+
+define(`VCSID_ELFCONSTANTS_M4',
+	`Id: elfconstants.m4 3939 2021-04-04 20:15:13Z jkoshy')
+
+#
+# Types of capabilities.
+# 
+define(`DEFINE_CAPABILITIES',`
+DEFINE_CAPABILITY(`CA_SUNW_NULL',	0,	`ignored')
+DEFINE_CAPABILITY(`CA_SUNW_HW_1',	1,	`hardware capability')
+DEFINE_CAPABILITY(`CA_SUNW_SW_1',	2,	`software capability')')
+
+#
+# Flags used with dynamic linking entries.
+#
+define(`DEFINE_DYN_FLAGS',`
+DEFINE_DYN_FLAG(`DF_ORIGIN',   0x1,
+	`object being loaded may refer to `$ORIGIN'')
+DEFINE_DYN_FLAG(`DF_SYMBOLIC', 0x2,
+	`search library for references before executable')
+DEFINE_DYN_FLAG(`DF_TEXTREL',  0x4,
+	`relocation entries may modify text segment')
+DEFINE_DYN_FLAG(`DF_BIND_NOW', 0x8,
+	`process relocation entries at load time')
+DEFINE_DYN_FLAG(`DF_STATIC_TLS',   0x10,
+	`uses static thread-local storage')
+DEFINE_DYN_FLAG(`DF_1_BIND_NOW',   0x1,
+	`process relocation entries at load time')
+DEFINE_DYN_FLAG(`DF_1_GLOBAL', 0x2,
+	`unused')
+DEFINE_DYN_FLAG(`DF_1_GROUP',  0x4,
+	`object is a member of a group')
+DEFINE_DYN_FLAG(`DF_1_NODELETE',   0x8,
+	`object cannot be deleted from a process')
+DEFINE_DYN_FLAG(`DF_1_LOADFLTR',   0x10,
+	`immediate load filtees')
+DEFINE_DYN_FLAG(`DF_1_INITFIRST',  0x20,
+	`initialize object first')
+DEFINE_DYN_FLAG(`DF_1_NOOPEN', 0x40,
+	`disallow dlopen()')
+DEFINE_DYN_FLAG(`DF_1_

CVS commit: src/external/bsd/top/dist/machine

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 19:25:38 UTC 2021

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
- Bump field width for state to accommodate > 9 CPUs
- When star formatting to adjust the width, count the trailing number of
  digits starting backwards instead of using strcspn because the lwp name
  might contain other digits like wm0TxRx/10.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/top/dist/machine/m_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/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.23 src/external/bsd/top/dist/machine/m_netbsd.c:1.24
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.23	Sat Apr 27 10:10:01 2019
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Sat Apr  3 15:25:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $
+ * $Id: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $");
 #endif
 
 #include 
@@ -57,6 +57,7 @@ __RCSID("$NetBSD: m_netbsd.c,v 1.23 2019
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -102,18 +103,18 @@ struct handle {
  */
 
 static char Proc_header[] =
-  "  PID XPRI NICE   SIZE   RES STATE  TIME   WCPUCPU COMMAND";
+  "  PID XPRI NICE   SIZE   RES STATE   TIME  WCPU   CPU   COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define PROC_UNAME_START 6
 #define Proc_format \
-	"%5d %-8.8s %3d %4d%7s %5s %-8.8s%7s %5.*f%% %5.*f%% %s"
+	"%5d %-8.8s %3d %4d%7s %5s %-9.9s%7s %5.*f%% %5.*f%% %s"
 
 static char Thread_header[] =
-  "  PID   LID XPRI STATE  TIME   WCPUCPU NAME  COMMAND";
+  "  PID   LID XPRI STATE   TIME  WCPU   CPU   NAME  COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define THREAD_UNAME_START 12
 #define Thread_format \
-"%5d %5d %-8.8s %3d %-8.8s%7s %5.2f%% %5.2f%% %-9.9s %s"
+"%5d %5d %-8.8s %3d %-9.9s%7s %5.2f%% %5.2f%% %-9.9s %s"
 
 /* 
  * Process state names for the "STATE" column of the display.
@@ -879,19 +880,25 @@ format_next_proc(caddr_t handle, char *(
 }
 
 static char *
-countable(char *p, size_t l)
+countable(char *p, size_t width)
 {
-	static const char digits[] = "0123456789";
-	size_t first = strcspn(p, digits);		// non digits
-	size_t last = strspn(p + first, digits);	// trailing digits
-	size_t len = first + last;			
-	if (p[len] || last == 0)	// should be total and must have digits
+	size_t len = strlen(p);
+	if (len < width) {		// shorter than width, ok
 		return p;
-	if (len < l)			// if shorter, done
+	}
+	size_t first, last = len - 1;
+	for (first = len - 1; isdigit((unsigned char)p[first]); first--) {
+		continue;
+	}
+	if (first == len - 1) {		// no digits, ok
 		return p;
-	if (l < last + 1)		// if not enough for digits, done
+	}
+	first++;
+	last = len - first;
+	if (width < last + 1) {		// if not enough for digits, done
 		return p;
-	size_t start = l - last - 1;	// compute starting point
+	}
+	size_t start = width - last - 1;	// compute starting point
 	p[start] = '*';			// put a star
 	memmove(p + start + 1, p + first, last + 1);	// move digits and NUL
 	return p;



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

2021-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 29 15:31:46 UTC 2021

Modified Files:
src/external/bsd/libarchive/dist/libarchive: archive_read_disk_posix.c

Log Message:
PR/56083: RVP: tar -c hangs when reading from FUSE-ext2 filesystems since
it returns 0 for statvfs members and libarchive handles only -1. Centralize
the transfer setting code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.1.1.2 src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.2
--- src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.1.1.2	Wed Jul 24 09:50:23 2019
+++ src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c	Mon Mar 29 11:31:46 2021
@@ -1527,6 +1527,15 @@ get_xfer_size(struct tree *t, int fd, co
 #if defined(HAVE_STATFS) && defined(HAVE_FSTATFS) && defined(MNT_LOCAL) \
 	&& !defined(ST_LOCAL)
 
+static void
+set_transfer_size(struct filesystem *fs, const struct statfs *sfs)
+{
+	fs->xfer_align = sfs->f_bsize > 0 ? (long)sfs->fs_bsize : -1;
+	fs->max_xfer_size = -1;
+	fs->min_xfer_size = sfs->f_iosize > 0 ? (long)sfs->f_iosize : -1;
+	fs->incr_xfer_size = sfs->f_iosize > 0 ? (long)sfs->f_iosize : -1;
+}
+
 /*
  * Gather current filesystem properties on FreeBSD, OpenBSD and Mac OS X.
  */
@@ -1595,10 +1604,7 @@ setup_current_filesystem(struct archive_
 		return (ARCHIVE_FAILED);
 	} else if (xr == 1) {
 		/* pathconf(_PC_REX_*) operations are not supported. */
-		t->current_filesystem->xfer_align = sfs.f_bsize;
-		t->current_filesystem->max_xfer_size = -1;
-		t->current_filesystem->min_xfer_size = sfs.f_iosize;
-		t->current_filesystem->incr_xfer_size = sfs.f_iosize;
+		set_transfer_size(t->current_filesystem, &sfs);
 	}
 	if (sfs.f_flags & MNT_LOCAL)
 		t->current_filesystem->remote = 0;
@@ -1653,6 +1659,20 @@ setup_current_filesystem(struct archive_
 
 #elif (defined(HAVE_STATVFS) || defined(HAVE_FSTATVFS)) && defined(ST_LOCAL)
 
+static void
+set_transfer_size(struct filesystem *fs, const struct statvfs *sfs)
+{
+	fs->xfer_align = sfs->f_frsize > 0 ? (long)sfs->f_frsize : -1;
+	fs->max_xfer_size = -1;
+#if defined(HAVE_STRUCT_STATVFS_F_IOSIZE)
+	fs->min_xfer_size = sfs->f_iosize > 0 ? (long)sfs->f_iosize : -1;
+	fs->incr_xfer_size = sfs->f_iosize > 0 ? (long)sfs->f_iosize : -1;
+#else
+	fs->min_xfer_size = sfs->f_bsize > 0 : (long)sfs->f_bsize : -1;
+	fs->incr_xfer_size = sfs->f_bsize > 0 : (long)sfs->f_bsize : -1;
+#endif
+}
+
 /*
  * Gather current filesystem properties on NetBSD
  */
@@ -1690,15 +1710,7 @@ setup_current_filesystem(struct archive_
 	} else if (xr == 1) {
 		/* Usually come here unless NetBSD supports _PC_REC_XFER_ALIGN
 		 * for pathconf() function. */
-		t->current_filesystem->xfer_align = sfs.f_frsize;
-		t->current_filesystem->max_xfer_size = -1;
-#if defined(HAVE_STRUCT_STATVFS_F_IOSIZE)
-		t->current_filesystem->min_xfer_size = sfs.f_iosize;
-		t->current_filesystem->incr_xfer_size = sfs.f_iosize;
-#else
-		t->current_filesystem->min_xfer_size = sfs.f_bsize;
-		t->current_filesystem->incr_xfer_size = sfs.f_bsize;
-#endif
+		set_transfer_size(t->current_filesystem, &sfs);
 	}
 	if (sfs.f_flag & ST_LOCAL)
 		t->current_filesystem->remote = 0;
@@ -1805,15 +1817,9 @@ setup_current_filesystem(struct archive_
 	} else if (xr == 1) {
 		/* pathconf(_PC_REX_*) operations are not supported. */
 #if defined(HAVE_STATVFS)
-		t->current_filesystem->xfer_align = svfs.f_frsize;
-		t->current_filesystem->max_xfer_size = -1;
-		t->current_filesystem->min_xfer_size = svfs.f_bsize;
-		t->current_filesystem->incr_xfer_size = svfs.f_bsize;
+		set_transfer_size(t->current_filesystem, &svfs);
 #else
-		t->current_filesystem->xfer_align = sfs.f_frsize;
-		t->current_filesystem->max_xfer_size = -1;
-		t->current_filesystem->min_xfer_size = sfs.f_bsize;
-		t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+		set_transfer_size(t->current_filesystem, &sfs);
 #endif
 	}
 	switch (sfs.f_type) {
@@ -1920,10 +1926,7 @@ setup_current_filesystem(struct archive_
 		return (ARCHIVE_FAILED);
 	} else if (xr == 1) {
 		/* pathconf(_PC_REX_*) operations are not supported. */
-		t->current_filesystem->xfer_align = sfs.f_frsize;
-		t->current_filesystem->max_xfer_size = -1;
-		t->current_filesystem->min_xfer_size = sfs.f_bsize;
-		t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+		set_transfer_size(t->current_filesystem, &sfs);
 	}
 
 #if defined(ST_NOATIME)



CVS commit: src/external/bsd/atf/dist/tools

2021-03-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 28 16:35:37 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: fs.cpp fs.hpp test-program.cpp

Log Message:
If we are running the test as an unprivileged user, hand ownership of the
test directory to that user.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/fs.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/fs.hpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/test-program.cpp

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/atf/dist/tools/fs.cpp
diff -u src/external/bsd/atf/dist/tools/fs.cpp:1.4 src/external/bsd/atf/dist/tools/fs.cpp:1.5
--- src/external/bsd/atf/dist/tools/fs.cpp:1.4	Sat Nov 11 09:16:06 2017
+++ src/external/bsd/atf/dist/tools/fs.cpp	Sun Mar 28 12:35:37 2021
@@ -683,6 +683,17 @@ impl::rmdir(const path& p)
 }
 }
 
+void
+impl::change_ownership(const path& p, const std::pair < int, int >& user)
+{
+if (::chown(p.c_str(), user.first, user.second) == -1) {
+std::stringstream ss;
+ss << IMPL_NAME "::chown(" << p.str() << ", " << user.first << ", "
+   << user.second << ")";
+throw tools::system_error(ss.str(), "chown(2) failed", errno);
+}
+}
+
 impl::path
 impl::change_directory(const path& dir)
 {

Index: src/external/bsd/atf/dist/tools/fs.hpp
diff -u src/external/bsd/atf/dist/tools/fs.hpp:1.2 src/external/bsd/atf/dist/tools/fs.hpp:1.3
--- src/external/bsd/atf/dist/tools/fs.hpp:1.2	Mon Mar  9 16:34:52 2020
+++ src/external/bsd/atf/dist/tools/fs.hpp	Sun Mar 28 12:35:37 2021
@@ -368,6 +368,7 @@ void remove(const path&);
 void rmdir(const path&);
 
 tools::fs::path change_directory(const tools::fs::path&);
+void change_ownership(const tools::fs::path&, const std::pair< int, int >&);
 void cleanup(const tools::fs::path&);
 tools::fs::path get_current_dir(void);
 

Index: src/external/bsd/atf/dist/tools/test-program.cpp
diff -u src/external/bsd/atf/dist/tools/test-program.cpp:1.3 src/external/bsd/atf/dist/tools/test-program.cpp:1.4
--- src/external/bsd/atf/dist/tools/test-program.cpp:1.3	Wed Dec 30 17:23:38 2015
+++ src/external/bsd/atf/dist/tools/test-program.cpp	Sun Mar 28 12:35:37 2021
@@ -304,8 +304,10 @@ run_test_case_child(void* raw_params)
 
 const std::pair< int, int > user = tools::get_required_user(
 params->metadata, params->config);
-if (user.first != -1 && user.second != -1)
+if (user.first != -1 && user.second != -1) {
+tools::fs::change_ownership(params->workdir, user);
 tools::user::drop_privileges(user);
+}
 
 // The input 'tp' parameter may be relative and become invalid once
 // we change the current working directory.



CVS commit: src/external/bsd/elftoolchain/dist/common

2021-03-10 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Wed Mar 10 21:36:29 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: _elftc.h

Log Message:
Update to upstream elftoolchain revision r3933.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/elftoolchain/dist/common/_elftc.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/bsd/elftoolchain/dist/common/_elftc.h
diff -u src/external/bsd/elftoolchain/dist/common/_elftc.h:1.7 src/external/bsd/elftoolchain/dist/common/_elftc.h:1.8
--- src/external/bsd/elftoolchain/dist/common/_elftc.h:1.7	Thu Nov 26 21:01:47 2020
+++ src/external/bsd/elftoolchain/dist/common/_elftc.h	Wed Mar 10 21:36:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: _elftc.h,v 1.7 2020/11/26 21:01:47 jkoshy Exp $	*/
+/*	$NetBSD: _elftc.h,v 1.8 2021/03/10 21:36:29 jkoshy Exp $	*/
 
 /*-
  * Copyright (c) 2009 Joseph Koshy
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Id: _elftc.h 3894 2020-11-20 18:02:53Z jkoshy
+ * Id: _elftc.h 3933 2021-03-10 21:09:49Z jkoshy
  */
 
 /**
@@ -384,6 +384,10 @@ extern const char *__progname;
 #include 
 #include 
 
+#ifndef	roundup2
+#define	roundup2	roundup
+#endif
+
 #define	ELFTC_BYTE_ORDER			_BYTE_ORDER
 #define	ELFTC_BYTE_ORDER_LITTLE_ENDIAN		_LITTLE_ENDIAN
 #define	ELFTC_BYTE_ORDER_BIG_ENDIAN		_BIG_ENDIAN



CVS commit: src/external/bsd/blocklist/libexec

2021-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  8 21:48:22 UTC 2021

Modified Files:
src/external/bsd/blocklist/libexec: blocklistd-helper

Log Message:
remove extra line


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/libexec/blocklistd-helper

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/blocklist/libexec/blocklistd-helper
diff -u src/external/bsd/blocklist/libexec/blocklistd-helper:1.2 src/external/bsd/blocklist/libexec/blocklistd-helper:1.3
--- src/external/bsd/blocklist/libexec/blocklistd-helper:1.2	Sat Mar  6 19:46:39 2021
+++ src/external/bsd/blocklist/libexec/blocklistd-helper	Mon Mar  8 16:48:22 2021
@@ -206,7 +206,6 @@ flush)
 		# XXX this MUST be done last and separately as "-s" is executed
 		# _while_ the command arguments are being processed!
 		/sbin/ipf -s && echo OK
-		/sbin/ipf -Z -I -Fi -s > /dev/null && echo OK
 		;;
 
 	ipfw)



CVS commit: src/external/bsd/elftoolchain/dist/libelf

2021-03-08 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Mon Mar  8 20:55:06 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/libelf: elf.3 elf_begin.3 elf_cntl.3
elf_end.3 elf_errmsg.3 elf_fill.3 elf_flagdata.3 elf_getarhdr.3
elf_getarsym.3 elf_getbase.3 elf_getdata.3 elf_getident.3
elf_getphdrnum.3 elf_getphnum.3 elf_getscn.3 elf_getshdrnum.3
elf_getshdrstrndx.3 elf_getshnum.3 elf_getshstrndx.3 elf_hash.3
elf_kind.3 elf_memory.3 elf_next.3 elf_open.3 elf_rand.3
elf_rawfile.3 elf_strptr.3 elf_update.3 elf_version.3 gelf.3
gelf_checksum.3 gelf_fsize.3 gelf_getcap.3 gelf_getclass.3
gelf_getdyn.3 gelf_getehdr.3 gelf_getmove.3 gelf_getphdr.3
gelf_getrel.3 gelf_getrela.3 gelf_getshdr.3 gelf_getsym.3
gelf_getsyminfo.3 gelf_getsymshndx.3 gelf_newehdr.3 gelf_newphdr.3
gelf_update_ehdr.3 gelf_xlatetof.3

Log Message:
Update libelf's manual pages to upstream revision [r3928].


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/elftoolchain/dist/libelf/elf.3
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/elftoolchain/dist/libelf/elf_begin.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_end.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_fill.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getident.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_hash.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_kind.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_memory.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_next.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_open.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_rand.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_update.3 \
src/external/bsd/elftoolchain/dist/libelf/elf_version.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3 \
src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3

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/elftoolchain/dist/libelf/elf.3
diff -u src/external/bsd/elftoolchain/dist/libelf/elf.3:1.4 src/external/bsd/elftoolchain/dist/libelf/elf.3:1.5
--- src/external/bsd/elftoolchain/dist/libelf/elf.3:1.4	Thu Apr 28 07:06:11 2016
+++ src/external/bsd/elftoolchain/dist/libelf/elf.3	Mon Mar  8 20:55:06 2021
@@ -1,6 +1,6 @@
-.\"	$NetBSD: elf.3,v 1.4 2016/04/28 07:06:11 wiz Exp $
+.\"	$NetBSD: elf.3,v 1.5 2021/03/08 20:55:06 jkoshy Exp $
 .\"
-.\" Copyright (c) 2006-2008,2011 Joseph Koshy.  All rights reserved.
+.\" Copyright (c) 2006-2008,2011,2019 Joseph Koshy.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,11 +23,11 @@
 .

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

2021-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  8 19:38:10 UTC 2021

Modified Files:
src/external/bsd/openpam/dist/include/security: openpam.h
pam_constants.h
src/external/bsd/openpam/dist/lib/libpam: openpam_dispatch.c
openpam_log.c openpam_ttyconv.c pam_get_authtok.c pam_get_item.c
pam_set_item.c

Log Message:
Appease new lint enum errors


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/bsd/openpam/dist/include/security/openpam.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/openpam/dist/include/security/pam_constants.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c \
src/external/bsd/openpam/dist/lib/libpam/openpam_log.c \
src/external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c \
src/external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c \
src/external/bsd/openpam/dist/lib/libpam/pam_get_item.c \
src/external/bsd/openpam/dist/lib/libpam/pam_set_item.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/include/security/openpam.h
diff -u src/external/bsd/openpam/dist/include/security/openpam.h:1.10 src/external/bsd/openpam/dist/include/security/openpam.h:1.11
--- src/external/bsd/openpam/dist/include/security/openpam.h:1.10	Tue Apr 28 22:16:56 2020
+++ src/external/bsd/openpam/dist/include/security/openpam.h	Mon Mar  8 14:38:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: openpam.h,v 1.10 2020/04/29 02:16:56 riastradh Exp $	*/
+/*	$NetBSD: openpam.h,v 1.11 2021/03/08 19:38:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -201,7 +201,7 @@ openpam_get_feature(int _feature, int *_
 /*
  * Log levels
  */
-enum {
+enum openpam_log_primitives {
 	PAM_LOG_LIBDEBUG = -1,
 	PAM_LOG_DEBUG,
 	PAM_LOG_VERBOSE,
@@ -264,7 +264,7 @@ int openpam_nullconv(int _n,
 /*
  * PAM primitives
  */
-enum {
+enum openpam_sm_primitives {
 	PAM_SM_AUTHENTICATE,
 	PAM_SM_SETCRED,
 	PAM_SM_ACCT_MGMT,

Index: src/external/bsd/openpam/dist/include/security/pam_constants.h
diff -u src/external/bsd/openpam/dist/include/security/pam_constants.h:1.6 src/external/bsd/openpam/dist/include/security/pam_constants.h:1.7
--- src/external/bsd/openpam/dist/include/security/pam_constants.h:1.6	Sat May  6 15:50:09 2017
+++ src/external/bsd/openpam/dist/include/security/pam_constants.h	Mon Mar  8 14:38:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_constants.h,v 1.6 2017/05/06 19:50:09 christos Exp $	*/
+/*	$NetBSD: pam_constants.h,v 1.7 2021/03/08 19:38:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -90,7 +90,7 @@ enum {
 /*
  * XSSO 5.3
  */
-enum {
+enum openpam_message_items {
 	PAM_PROMPT_ECHO_OFF		=   1,
 	PAM_PROMPT_ECHO_ON		=   2,
 	PAM_ERROR_MSG			=   3,
@@ -119,7 +119,7 @@ enum {
 /*
  * XSSO 5.5
  */
-enum {
+enum openpam_item_primitives {
 	PAM_SERVICE			=   1,
 	PAM_USER			=   2,
 	PAM_TTY=   3,

Index: src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c
diff -u src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c:1.3 src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c:1.4
--- src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c:1.3	Sat May  6 15:50:09 2017
+++ src/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c	Mon Mar  8 14:38:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: openpam_dispatch.c,v 1.3 2017/05/06 19:50:09 christos Exp $	*/
+/*	$NetBSD: openpam_dispatch.c,v 1.4 2021/03/08 19:38:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: openpam_dispatch.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: openpam_dispatch.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include 
 
@@ -86,7 +86,7 @@ openpam_dispatch(pam_handle_t *pamh,
 	}
 
 	/* pick a chain */
-	switch (primitive) {
+	switch ((enum openpam_sm_primitives)primitive) {
 	case PAM_SM_AUTHENTICATE:
 	case PAM_SM_SETCRED:
 		chain = pamh->chains[PAM_AUTH];
@@ -101,6 +101,7 @@ openpam_dispatch(pam_handle_t *pamh,
 	case PAM_SM_CHAUTHTOK:
 		chain = pamh->chains[PAM_PASSWORD];
 		break;
+	case PAM_NUM_PRIMITIVES:
 	default:
 		RETURNC(PAM_SYSTEM_ERR);
 	}
@@ -208,7 +209,7 @@ openpam_check_error_code(int primitive, 
 		return;
 
 	/* specific error codes */
-	switch (primitive) {
+	switch ((enum openpam_sm_primitives)primitive) {
 	case PAM_SM_AUTHENTICATE:
 		if (r == PAM_AUTH_ERR ||
 		r == PAM_CRED_INSUFFICIENT ||
@@ -245,6 +246,8 @@ openpam_check_error_code(int primitive, 
 		r == PAM_TRY_AGAIN)
 			return;
 		break;
+	case PAM_NUM_PRIMITIVES:
+		break;
 	}
 
 	openpam_log(PAM_LOG_ERROR, "%s(): unexpected return value %d",
Index: src/external/bsd/openpam/dist/lib/libpam/openpam_log.c
diff -u src/external/bsd/openpam/dist/lib/libpam/openpam_log.c:1.3 src/ex

CVS commit: src/external/bsd/elftoolchain/dist/common

2021-03-07 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Sun Mar  7 14:53:59 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: elfdefinitions.h

Log Message:
Sync with Elftoolchain [r3916]: update the list of known EM_* values.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/elftoolchain/dist/common/elfdefinitions.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/bsd/elftoolchain/dist/common/elfdefinitions.h
diff -u src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.4 src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.5
--- src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.4	Thu Nov 19 20:58:30 2020
+++ src/external/bsd/elftoolchain/dist/common/elfdefinitions.h	Sun Mar  7 14:53:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: elfdefinitions.h,v 1.4 2020/11/19 20:58:30 jkoshy Exp $	*/
+/*	$NetBSD: elfdefinitions.h,v 1.5 2021/03/07 14:53:59 jkoshy Exp $	*/
 
 /*-
  * Copyright (c) 2010 Joseph Koshy
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Id: elfdefinitions.h 3858 2020-05-11 22:53:38Z emaste
+ * Id: elfdefinitions.h 3916 2020-12-12 11:26:53Z jkoshy
  */
 
 /*
@@ -873,7 +873,34 @@ _ELF_DEFINE_EM(EM_KMX32,211,
 _ELF_DEFINE_EM(EM_KMX16,212, "KM211 KMX16 16-bit processor") \
 _ELF_DEFINE_EM(EM_KMX8, 213, "KM211 KMX8 8-bit processor")  \
 _ELF_DEFINE_EM(EM_KVARC,214, "KM211 KMX32 KVARC processor") \
-_ELF_DEFINE_EM(EM_RISCV,243, "RISC-V")
+_ELF_DEFINE_EM(EM_CDP,  215, "Paneve CDP architecture family") \
+_ELF_DEFINE_EM(EM_COGE, 216, "Cognitive Smart Memory Processor") \
+_ELF_DEFINE_EM(EM_COOL, 217, "Bluechip Systems CoolEngine") \
+_ELF_DEFINE_EM(EM_NORC, 218, "Nanoradio Optimized RISC")\
+_ELF_DEFINE_EM(EM_CSR_KALIMBA,  219,\
+	"CSR Kalimba architecture family")  \
+_ELF_DEFINE_EM(EM_Z80,  220, "Zilog Z80")   \
+_ELF_DEFINE_EM(EM_VISIUM,   221,\
+	"Controls and Data Services VISIUMcore processor")  \
+_ELF_DEFINE_EM(EM_FT32, 222,\
+	"FTDI Chip FT32 high performance 32-bit RISC architecture") \
+_ELF_DEFINE_EM(EM_MOXIE,223, "Moxie processor family")  \
+_ELF_DEFINE_EM(EM_AMDGPU,   224, "AMD GPU architecture")\
+_ELF_DEFINE_EM(EM_RISCV,243, "RISC-V")  \
+_ELF_DEFINE_EM(EM_LANAI,244, "Lanai processor") \
+_ELF_DEFINE_EM(EM_CEVA, 245,\
+	"CEVA Processor Architecture Family") 		\
+_ELF_DEFINE_EM(EM_CEVA_X2,  246, "CEVA X2 Processor Family") 	\
+_ELF_DEFINE_EM(EM_BPF,  247,\
+	"Linux BPF – in-kernel virtual machine") 	\
+_ELF_DEFINE_EM(EM_GRAPHCORE_IPU,248,\
+	"Graphcore Intelligent Processing Unit") 	\
+_ELF_DEFINE_EM(EM_IMG1, 249, "Imagination Technologies") 	\
+_ELF_DEFINE_EM(EM_NFP,  250,\
+	"Netronome Flow Processor (NFP)") 	\
+_ELF_DEFINE_EM(EM_CSKY, 252, "C-SKY processor family")  \
+_ELF_DEFINE_EM(EM_65816,257, "WDC 65816/65C816")\
+_ELF_DEFINE_EM(EM_KF32, 259, "ChipON KungFu 32")
 
 #undef	_ELF_DEFINE_EM
 #define	_ELF_DEFINE_EM(N, V, DESCR)	N = V ,



CVS commit: src/external/bsd/blocklist

2021-03-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  7 00:46:39 UTC 2021

Modified Files:
src/external/bsd/blocklist: TODO
src/external/bsd/blocklist/etc/rc.d: blocklistd
src/external/bsd/blocklist/libexec: blocklistd-helper

Log Message:
TODO and ipfilter improvements from Greg A. Woods


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/blocklist/TODO
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/blocklist/etc/rc.d/blocklistd
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/blocklist/libexec/blocklistd-helper

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/blocklist/TODO
diff -u src/external/bsd/blocklist/TODO:1.1.1.1 src/external/bsd/blocklist/TODO:1.2
--- src/external/bsd/blocklist/TODO:1.1.1.1	Sun Jun 14 21:52:52 2020
+++ src/external/bsd/blocklist/TODO	Sat Mar  6 19:46:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: TODO,v 1.1.1.1 2020/06/15 01:52:52 christos Exp $
+# $NetBSD: TODO,v 1.2 2021/03/07 00:46:39 christos Exp $
 
 - don't poll periodically, find the next timeout
 - use the socket also for commands? Or separate socket?
@@ -19,3 +19,89 @@
 	unblock
 - do we need an api in blocklistctl to perform maintenance
 - fix the blocklistctl output to be more user friendly
+
+- figure out some way to do distributed operation securely (perhaps with
+  a helper daemon that authenticates local sockets and then communicates
+  local DB changes to the central server over a secure channel --
+  perhaps blocklistd-helper can have a back-end that can send updates to
+  a central server)
+
+- add "blocklistd -l" to enable filter logging on all rules by default
+
+- add some new options in the config file
+
+	"/all"	- block both TCP and UDP (on the proto field?)
+
+	"/log"	- enable filter logging (if not the default) (on the name field?)
+	"/nolog"- disable filter logging (if not the default) (on the name field?)
+
+  The latter two probably require a new parameter for blocklistd-helper.
+
+- "blocklistd -f" should (also?) be a blocklistctl function!?!?!
+
+- if blocklistd was started with '-r' then a SIGHUP should also do a
+  "control flush $rulename" and then re-add all the filter rules?
+
+- should/could /etc/rc.conf.d/ipfilter be created with the following?
+
+	reload_postcmd=blocklistd_reload
+	start_postcmd=blocklistd_start
+	stop_precmd=blocklistd_stop
+	blocklistd_reload ()
+	{
+		/etc/rc.d/blocklistd reload	# IFF SIGHUP does flush/re-add
+		# /etc/rc.d/blocklistd restart
+	}
+	blocklistd_stop ()
+	{
+		/etc/rc.d/blocklistd stop
+	}
+	blocklistd_start ()
+	{
+		/etc/rc.d/blocklistd start
+	}
+
+  or is there a better way?
+
+- figure out some way to do distributed operation securely (perhaps with
+  a helper daemon that authenticates local sockets and then communicates
+  local DB changes to the central server over a secure channel --
+  perhaps blocklistd-helper can have a back-end that can send updates to
+  a central server)
+
+- add "blocklistd -l" to enable filter logging on all rules by default
+
+- add some new options in the config file
+
+	"/all"	- block both TCP and UDP (on the proto field?)
+
+	"/log"	- enable filter logging (if not the default) (on the name field?)
+	"/nolog"- disable filter logging (if not the default) (on the name field?)
+
+  The latter two probably require a new parameter for blocklistd-helper.
+
+- "blocklistd -f" should (also?) be a blocklistctl function!?!?!
+
+- if blocklistd was started with '-r' then a SIGHUP should also do a
+  "control flush $rulename" and then re-add all the filter rules?
+
+- should/could /etc/rc.conf.d/ipfilter be created with the following?
+
+	reload_postcmd=blocklistd_reload
+	start_postcmd=blocklistd_start
+	stop_precmd=blocklistd_stop
+	blocklistd_reload ()
+	{
+		/etc/rc.d/blocklistd reload	# IFF SIGHUP does flush/re-add
+		# /etc/rc.d/blocklistd restart
+	}
+	blocklistd_stop ()
+	{
+		/etc/rc.d/blocklistd stop
+	}
+	blocklistd_start ()
+	{
+		/etc/rc.d/blocklistd start
+	}
+
+  or is there a better way?

Index: src/external/bsd/blocklist/etc/rc.d/blocklistd
diff -u src/external/bsd/blocklist/etc/rc.d/blocklistd:1.1.1.1 src/external/bsd/blocklist/etc/rc.d/blocklistd:1.2
--- src/external/bsd/blocklist/etc/rc.d/blocklistd:1.1.1.1	Sun Jun 14 21:52:53 2020
+++ src/external/bsd/blocklist/etc/rc.d/blocklistd	Sat Mar  6 19:46:39 2021
@@ -1,10 +1,10 @@
 #!/bin/sh
 #
-# $NetBSD: blocklistd,v 1.1.1.1 2020/06/15 01:52:53 christos Exp $
+# $NetBSD: blocklistd,v 1.2 2021/03/07 00:46:39 christos Exp $
 #
 
 # PROVIDE: blocklistd
-# REQUIRE: npf
+# REQUIRE: npf pf ipfilter
 # BEFORE:  SERVERS
 
 $_rc_subr_loaded . /etc/rc.subr

Index: src/external/bsd/blocklist/libexec/blocklistd-helper
diff -u src/external/bsd/blocklist/libexec/blocklistd-helper:1.1.1.1 src/external/bsd/blocklist/libexec/blocklistd-helper:1.2
--- src/external/bsd/blocklist/libexec/blocklistd-helper:1.1.1.1	Sun Jun 14 2

CVS commit: src/external/bsd/wpa/bin/hostapd

2021-02-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  1 03:42:57 UTC 2021

Modified Files:
src/external/bsd/wpa/bin/hostapd: Makefile

Log Message:
Enable more options.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/wpa/bin/hostapd/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/wpa/bin/hostapd/Makefile
diff -u src/external/bsd/wpa/bin/hostapd/Makefile:1.14 src/external/bsd/wpa/bin/hostapd/Makefile:1.15
--- src/external/bsd/wpa/bin/hostapd/Makefile:1.14	Sun Sep  6 03:20:26 2020
+++ src/external/bsd/wpa/bin/hostapd/Makefile	Sun Feb 28 22:42:57 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2020/09/06 07:20:26 mrg Exp $
+# $NetBSD: Makefile,v 1.15 2021/03/01 03:42:57 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -16,12 +16,18 @@ authsrv.c \
 beacon.c \
 bss_load.c \
 ctrl_iface_ap.c \
+dpp.c \
+dpp_hostapd.c \
 drv_callbacks.c \
 eap_user_db.c \
+gas.c \
+gas_query_ap.c \
+gas_serv.c \
 hostapd.c \
 ieee802_11_auth.c \
 ieee802_11_shared.c \
 ieee802_1x.c \
+mbo_ap.c \
 neighbor_db.c \
 pmksa_cache_auth.c \
 preauth_auth.c \
@@ -65,6 +71,7 @@ SRCS+= \
 base64.c \
 common.c \
 eloop.c \
+json.c \
 ip_addr.c \
 os_unix.c \
 wpa_debug.c \
@@ -94,8 +101,15 @@ eap_server_methods.c
 
 # crypto
 SRCS+= \
+aes-siv.c \
 random.c \
-sha1-prf.c
+sha1-prf.c \
+sha256-kdf.c \
+sha256-prf.c \
+sha384-kdf.c \
+sha384-prf.c \
+sha512-kdf.c \
+sha512-prf.c \
 
 # crypto for non-openssl
 NO_SRCS+= \
@@ -131,6 +145,21 @@ CPPFLAGS+= -DCONFIG_IPV6
 .endif
 CPPFLAGS+= -DCONFIG_PEERKEY
 CPPFLAGS+= -DCONFIG_RSN_PREAUTH
+CPPFLAGS+= -DCONFIG_DPP
+CPPFLAGS+= -DCONFIG_DPP2
+CPPFLAGS+= -DCONFIG_ECC
+#CPPFLAGS+= -DCONFIG_OWE
+#CPPFLAGS+= -DCONFIG_SAE
+#CPPFLAGS+= -DCONFIG_AIRTIME_POLICY
+#CPPFLAGS+= -DCONFIG_FILS
+#CPPFLAGS+= -DCONFIG_OCV
+#CPPFLAGS+= -DCONFIG_IEEE80211AX
+CPPFLAGS+= -DCONFIG_IEEE80211W
+#CPPFLAGS+= -DCONFIG_IEEE80211R_AP
+CPPFLAGS+= -DCONFIG_MBO
+#CPPFLAGS+= -DCONFIG_NO_VLAN
+#CPPFLAGS+= -DCONFIG_SQLITE
+#CPPFLAGS+= -DCONFIG_SHA256 -DCONFIG_SHA484 -DCONFIG_SHA512
 
 DPADD+= ${LIBPCAP}
 LDADD+= -lpcap
@@ -169,6 +198,8 @@ fips_prf_openssl.c \
 ms_funcs.c \
 sha1-tlsprf.c \
 sha256.c \
+sha384.c \
+sha512.c \
 tls_openssl.c
 
 # eap_common



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

2021-02-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Feb 26 02:54:21 UTC 2021

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

Log Message:
Misc cleanups:

- built-in regex is required only when ${USE_WIDECHAR} == "yes"

- -DUSE_WIDECHAR cpp flag should be determined by ${USE_WIDECHAR},
  not ${USE_BUILTIN_REGEX}

- reduce .if -- .endif block for clarity


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

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

Modified files:

Index: src/external/bsd/nvi/usr.bin/nvi/Makefile
diff -u src/external/bsd/nvi/usr.bin/nvi/Makefile:1.24 src/external/bsd/nvi/usr.bin/nvi/Makefile:1.25
--- src/external/bsd/nvi/usr.bin/nvi/Makefile:1.24	Fri Feb 26 00:41:56 2021
+++ src/external/bsd/nvi/usr.bin/nvi/Makefile	Fri Feb 26 02:54:21 2021
@@ -1,10 +1,15 @@
-#	$NetBSD: Makefile,v 1.24 2021/02/26 00:41:56 christos Exp $
+#	$NetBSD: Makefile,v 1.25 2021/02/26 02:54:21 rin Exp $
 
 .include 
 
 USE_WIDECHAR?=yes
+
+.if ${USE_WIDECHAR} == "yes"
 USE_BUILTIN_REGEX?=yes	# Although our regex supports widechar nvi requires
 			# a non-standard API
+.else
+USE_BUILTIN_REGEX?=no
+.endif
 
 WARNS=	5
 
@@ -55,12 +60,13 @@ NOTUSED=ip_funcs.c ip_read.c ip_screen.c
 	ip_run.c ip_send.c ip_trans.c ipc_cmd.c ipc_method.c
 
 # For wide char support
-.if ${USE_BUILTIN_REGEX} == "yes"
-.if ${ACTIVE_CC} == "gcc"
-COPTS.regexec.c+=	-Wno-old-style-definition
+.if ${USE_WIDECHAR} == "yes"
+CPPFLAGS+=-DUSE_WIDECHAR
 .endif
+.if ${USE_BUILTIN_REGEX} == "yes"
 SRCS+=	regcomp.c regerror.c regexec.c regfree.c
-CPPFLAGS+=-I${DIST}/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR
+CPPFLAGS+=-I${DIST}/regex -D__REGEX_PRIVATE
+COPTS.regexec.c+= ${${ACTIVE_CC} == "gcc":? -Wno-old-style-definition :}
 .endif
 
 # For db3 db1 emulation



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

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

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

Log Message:
Put back local regex (thanks Rin)


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

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

Modified files:

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



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

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

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

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


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

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

Modified files:

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



CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2021-02-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 25 07:55:53 UTC 2021

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
For SMALLPROG, do not compile in IPv6 support unless SMALLPROG_INET6 is
defined, as in the same manner as other utilities.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/external/bsd/dhcpcd/sbin/dhcpcd/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/dhcpcd/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.54 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.55
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.54	Mon Jun 15 17:02:58 2020
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Thu Feb 25 07:55:53 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.54 2020/06/15 17:02:58 roy Exp $
+# $NetBSD: Makefile,v 1.55 2021/02/25 07:55:53 rin Exp $
 #
 
 WARNS?=		6
@@ -54,7 +54,7 @@ SRCS+=		ipv4ll.c
 .endif
 .endif
 
-.if (${USE_INET6} != "no")
+.if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
 CPPFLAGS+=	-DINET6
 SRCS+=		ipv6.c ipv6nd.c
 # -DSMALL already strips out prefix delegation



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

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

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

Log Message:
set explicit_file_name when we use getopt.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/byacc/dist/main.c

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

Modified files:

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



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-02-18 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Feb 18 15:13:38 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_timer.c

Log Message:
PR bin/55973:

fix routing message triggered one shot interface update.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_timer.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/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9	Sun Jan  3 15:33:05 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Thu Feb 18 15:13:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.10 2021/02/18 15:13:37 kardel Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -428,6 +428,8 @@ timer(void)
 		if (interface_interval)
 			timer_interfacetimeout(current_time +
 			interface_interval);
+		else
+			timer_interfacetimeout(0);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan 31 08:27:49 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: ignore errno EINTR on reads from the routing socket


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/ntp/dist/ntpd/ntp_io.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/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.31
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30	Sun Jan 31 08:26:47 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan 31 08:27:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.30 2021/01/31 08:26:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.31 2021/01/31 08:27:49 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4741,7 +4741,7 @@ process_routing_msgs(struct asyncio_read
 cnt = read(reader->fd, buffer, sizeof(buffer));
 			} while (cnt != -1 || errno == ENOBUFS);
 			timer_interfacetimeout(current_time + UPDATE_GRACE);
-		} else {
+		} else if (errno != EINTR) {
 			msyslog(LOG_ERR,
 "routing socket reports: %m - disabling");
 			remove_asyncio_reader(reader);



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan 31 08:26:47 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: move route socket overflow message from LOG_ERR to LOG_DEBUG

While here stop caring about RTM_LOSING as that's purely informational.
If routing does change then we get RTM_ADD/DEL/CHANGE.
Also stop caring about RTM_IFANNOUNCE as we really only want addresses
and interface flag updates which we get by RTM_NEWADDR/DELADDR/CHGADDR and
RTM_IFINFO.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/ntp/dist/ntpd/ntp_io.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/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29	Sun Jan  3 15:33:05 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan 31 08:26:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.29 2021/01/03 15:33:05 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.30 2021/01/31 08:26:47 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4730,8 +4730,9 @@ process_routing_msgs(struct asyncio_read
 
 	if (cnt < 0) {
 		if (errno == ENOBUFS) {
-			msyslog(LOG_ERR,
-"routing socket reports: %m");
+			msyslog(LOG_DEBUG,
+"routing socket overflowed"
+" - will update interfaces");
 			/*
 			 * drain the routing socket as we need to update
 			 * the interfaces anyway
@@ -4792,15 +4793,9 @@ process_routing_msgs(struct asyncio_read
 #ifdef RTM_CHANGE
 		case RTM_CHANGE:
 #endif
-#ifdef RTM_LOSING
-		case RTM_LOSING:
-#endif
 #ifdef RTM_IFINFO
 		case RTM_IFINFO:
 #endif
-#ifdef RTM_IFANNOUNCE
-		case RTM_IFANNOUNCE:
-#endif
 #ifdef RTM_NEWLINK
 		case RTM_NEWLINK:
 #endif
@@ -4874,15 +4869,9 @@ init_async_notifications()
 #ifdef RTM_CHANGE
 		RTM_CHANGE,
 #endif
-#ifdef RTM_LOSING
-		RTM_LOSING,
-#endif
 #ifdef RTM_IFINFO
 		RTM_IFINFO,
 #endif
-#ifdef RTM_IFANNOUNCE
-		RTM_IFANNOUNCE,
-#endif
 #ifdef RTM_NEWLINK
 		RTM_NEWLINK,
 #endif



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libarchive/dist/tar/write.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/tar/write.c
diff -u src/external/bsd/libarchive/dist/tar/write.c:1.2 src/external/bsd/libarchive/dist/tar/write.c:1.3
--- src/external/bsd/libarchive/dist/tar/write.c:1.2	Thu Jan 28 14:42:27 2021
+++ src/external/bsd/libarchive/dist/tar/write.c	Thu Jan 28 14:46:54 2021
@@ -798,7 +798,9 @@ copy_file_data_block(struct bsdtar *bsdt
 		progress += bytes_written;
 	}
 	if (r < ARCHIVE_WARN) {
-		lafe_warnc(archive_errno(a), "%s", archive_error_string(a));
+		const char *s = archive_error_string(a);
+		if (s)
+			lafe_warnc(archive_errno(a), "%s", s);
 		return (-1);
 	}
 	return (0);



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/libarchive/dist/tar/write.c

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

Modified files:

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



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

2021-01-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 17 00:13:49 UTC 2021

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
remove unset (and always printed as "(null)") gfilename variable.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/iscsi/dist/src/lib/initiator.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/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.12
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11	Sun Sep  6 17:06:20 2020
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Sun Jan 17 00:13:49 2021
@@ -92,7 +92,6 @@ static iscsi_worker_t g_enqueue_worker;
 static iscsi_queue_t g_enqueue_q;
 static iscsi_queue_t g_session_q;
 static int  g_initiator_state;
-static char   *gfilename;
 
 /* Testing of initiator_abort */
 
@@ -905,9 +904,6 @@ iscsi_initiator_start(iscsi_initiator_t 
 		set_debug(dbg);
 	}
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
-	iscsi_trace(TRACE_ISCSI_DEBUG,
-		"target config filename to read from: %s\n", gfilename
-		? gfilename : "(null)");
 	port = atoi(iscsi_initiator_getvar(ini, "target port"));
 	if (get_target_config(iscsi_initiator_getvar(ini,
 "target hostname"), port) != 0) {
@@ -3715,9 +3711,6 @@ ii_initiator_init(const char *hostname, 
 
 	USE_ARG(address_family);
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
-	iscsi_trace(TRACE_ISCSI_DEBUG,
-	"target config filename to read from: %s\n", gfilename ?
-	gfilename : "(null)");
 	if (get_target_config(hostname, port) != 0) {
 		iscsi_err(__FILE__, __LINE__, "Error getting target configuration from config file\n");
 		return -1;



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c

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

Modified files:

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



CVS commit: src/external/bsd/ppp

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

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

Log Message:
remove more


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

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

Modified files:

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



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

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

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

Log Message:
remove useless files


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

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



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Jan  8 01:17:55 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Consistently use "parentheses" in plural.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.9 src/external/bsd/bc/dist/bc.1:1.10
--- src/external/bsd/bc/dist/bc.1:1.9	Fri Jan  8 01:17:03 2021
+++ src/external/bsd/bc/dist/bc.1	Fri Jan  8 01:17:55 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.9 2021/01/08 01:17:03 uwe Exp $
+.\" $NetBSD: bc.1,v 1.10 2021/01/08 01:17:55 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -440,7 +440,7 @@ What this does in
 is assign the value 3 to the variable
 .Va a
 and then compare 3 to 5.
-It is best to use parenthesis when using relational and logical operators
+It is best to use parentheses when using relational and logical operators
 with the assignment operators.
 .Pp
 There are a few more special expressions that are provided in
@@ -735,7 +735,7 @@ Return the value 0 from a function.
 .It Ic return Ic \&( Ns Ar expression Ns Ic \&)
 Return the value of the expression from a function.
 (See the section on  functions.)
-As an extension, the parenthesis are not required.
+As an extension, the parentheses are not required.
 .El
 .Ss PSEUDO STATEMENTS
 These statements are not statements in the traditional sense.



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Jan  8 01:17:03 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Prettify PostScript output some more.

Don't set BNF in all bold .Ic, instead use .Ar for "expr" and "var" so
that only the literal stuff that is being defined is bold.  Arrange
for subscripts to actually be subscripted in PostScript.  Make sure
meta-syntactic [] are set differently than literal (). Etc...


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.8 src/external/bsd/bc/dist/bc.1:1.9
--- src/external/bsd/bc/dist/bc.1:1.8	Thu Jan  7 23:57:25 2021
+++ src/external/bsd/bc/dist/bc.1	Fri Jan  8 01:17:03 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.8 2021/01/07 23:57:25 uwe Exp $
+.\" $NetBSD: bc.1,v 1.9 2021/01/08 01:17:03 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -231,42 +231,42 @@ Legal values of the variable
 are 0 to the maximum number representable by a C integer.
 .Pp
 In the following descriptions of legal expressions,
-.Dq expr
+.Ar expr
 refers to a complete expression and
-.Dq var
+.Ar var
 refers to a simple or an array variable.
 A simple variable is just a
-.Ic name
+.Dq Ar name
 and an array variable is specified as
-.Ic name[expr] .
+.Do Ar name Ns Ic \&[ Ns Ar expr Ns Ic \&] Dc .
 Unless specifically mentioned the scale of the result is the maximum scale of the
 expressions involved.
 .Bl -tag -width 15n
-.It Ic "- expr"
+.It Ic \&- Ns Ar expr
 The result is the negation of the expression.
-.It Ic "++ var"
+.It Ic \&++ Ns Ar var
 The variable is incremented by one and the new value is the result of
 the expression.
-.It Ic "-- var"
+.It Ic \&-- Ns Ar var
 The variable is decremented by one and the new value is the result of the
 expression.
-.It Ic "var ++"
+.It Ar var Ns Ic \&++
 The result of the expression is the value of
 the variable and then the variable is incremented by one.
-.It Ic "var --"
+.It Ar var Ns Ic \&--
 The result of the expression is the value of the variable and then
 the variable is decremented by one.
-.It Ic "expr + expr"
+.It Ar expr Ic \&+ Ar expr
 The result of the expression is the sum of the two expressions.
-.It Ic "expr - expr"
+.It Ar expr Ic \&- Ar expr
 The result of the expression is the difference of the two expressions.
-.It Ic "expr * expr"
+.It Ar expr Ic \&* Ar expr
 The result of the expression is the product of the two expressions.
-.It Ic "expr / expr"
+.It Ar expr Ic \&/ Ar expr
 The result of the expression is the quotient of the two expressions.
 The scale of the result is the value of the variable
 .Ic scale .
-.It Ic "expr % expr"
+.It Ar expr Ic \&% Ar expr
 The result of the expression is the remainder and it is computed in the
 following way:
 To compute a%b, first a/b is computed to
@@ -280,7 +280,7 @@ If
 .Ic scale
 is set to zero and both expressions are integers this expression is the
 integer remainder function.
-.It Ic "expr ^ expr"
+.It Ar expr Ic \&^ Ar expr
 The result of the expression is the value of the first raised to the
 second.
 The second expression must be an integer.
@@ -299,19 +299,19 @@ and the scale of the first expression.
 scale(a))).)
 It should be noted
 that expr^0 will always return the value of 1.
-.It Ic "( expr )"
+.It Ic \&( Ns Ar expr Ns Ic \&)
 This alters the standard precedence to force the evaluation of the
 expression.
-.It Ic "var = expr"
+.It Ar var Ic \&= Ar expr
 The variable is assigned the value of the expression.
-.It Ic "var = expr"
+.It Ar var Ao Ns Ar op Ns Ac Ns Ic \&= Ar expr
 This is equivalent to
-.Ic "var = var  expr"
+.Ar var Ic \&= Ar var Ao Ns Ar op Ns Ac Ar expr
 with the exception that the
-.Dq Ic var
+.Ar var
 part is evaluated only once.
 This can make a difference if
-.Dq Ic var
+.Ar var
 is an array.
 .El
 .Pp
@@ -330,18 +330,36 @@ statements and that only one relational 
 done in them.)
 The relational operators are:
 .Bl -tag -width 15n
-.It Ic "expr1 < expr2"
-The result is 1 if expr1 is strictly less than expr2.
-.It Ic "expr1 <= expr2"
-The result is 1 if expr1 is less than or equal to expr2.
-.It Ic "expr1 > expr2"
-The result is 1 if expr1 is strictly greater than expr2.
-.It Ic "expr1 >= expr2"
-The result is 1 if expr1 is greater than or equal to expr2.
-.It Ic "expr1 == expr2"
-The result is 1 if expr1 is equal to expr2.
-.It Ic "expr1 != expr2"
-The result is 1 if expr1 is not equal to expr2.
+.It Ar expr\s-2\d\fR1\fP\u\s+2 Ic \&< Ar expr\s-2\d\fR2\fP\u\s+2
+The result is 1 if
+.Ar expr\s-2\d\fR1\fP\u\s+2
+is strictly less than
+.Ar expr\s-2\d\fR2\fP\u\s+2 .
+.It Ar expr\s-2\d\fR1\fP\u\s+2 Ic \&<= Ar expr\s-2\d\fR2\fP\u\s+2
+The result is 1 if
+.Ar expr\s-2\d\fR1\fP\u\s+2
+is less than or equal to
+.Ar expr\s-2\d\&2\u\s+2 .
+.It Ar expr\s-2\d\fR1\fP\u\s+2 I

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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 23:57:25 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Replace one last missed \f with semantic markup.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.7 src/external/bsd/bc/dist/bc.1:1.8
--- src/external/bsd/bc/dist/bc.1:1.7	Thu Jan  7 21:21:35 2021
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 23:57:25 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.7 2021/01/07 21:21:35 uwe Exp $
+.\" $NetBSD: bc.1,v 1.8 2021/01/07 23:57:25 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -264,7 +264,8 @@ The result of the expression is the diff
 The result of the expression is the product of the two expressions.
 .It Ic "expr / expr"
 The result of the expression is the quotient of the two expressions.
-The scale of the result is the value of the variable \fBscale\fR.
+The scale of the result is the value of the variable
+.Ic scale .
 .It Ic "expr % expr"
 The result of the expression is the remainder and it is computed in the
 following way:



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 21:21:35 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Use more .Ql, misc related fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.6 src/external/bsd/bc/dist/bc.1:1.7
--- src/external/bsd/bc/dist/bc.1:1.6	Thu Jan  7 20:37:33 2021
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 21:21:35 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.6 2021/01/07 20:37:33 uwe Exp $
+.\" $NetBSD: bc.1,v 1.7 2021/01/07 21:21:35 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -128,7 +128,8 @@ In POSIX
 .Nm
 all names are a single lower case letter.)
 The type of variable is clear by the context
-because all array variable names will be followed by brackets ([]).
+because all array variable names will be followed by brackets
+.Pq Ql [] .
 .Pp
 There are four special variables,
 .Ic scale ,
@@ -156,9 +157,9 @@ as well as used in expressions.
 Comments in
 .Nm
 start with the characters
-.Dq Ic /*
+.Ql /*
 and end with the characters
-.Dq Ic */ .
+.Ql */ .
 Comments may start anywhere and appear as a single space in the input.
 (This causes comments to delimit other input items.
 For example, a comment can not be found in the middle of
@@ -170,7 +171,7 @@ To support the use of scripts for
 .Nm ,
 a single line comment has been added as an extension.
 A single line comment starts at a
-.Dq Ic #
+.Ql #
 character and continues to the next end of the line.
 The end of line
 character is not part of the comment and is processed normally.
@@ -205,13 +206,15 @@ Lower case letters are variable names.)
 Single digit numbers always
 have the value of the digit regardless of the value of
 .Ic ibase .
-(i.e. A = 10.)
+(i.e.\&
+.Ql A
+=\~10.)
 For multi-digit numbers,
 .Nm
 changes all input digits greater or equal to ibase to the value of
 .Ic ibase - 1 .
 This makes the number
-.Dq ZZZ
+.Ql ZZZ
 always be the largest 3 digit number of the input base.
 .Pp
 Full expressions are similar to many other high level languages.
@@ -362,25 +365,41 @@ The result is 1 if either expression is 
 The expression precedence is as follows: (lowest to highest)
 .Bl -enum -offset indent
 .It
-|| operator, left associative
+.Ql ||
+operator, left associative
 .It
-&& operator, left associative
+.Ql &&
+operator, left associative
 .It
-! operator, nonassociative
+.Ql \&!
+operator, nonassociative
 .It
 Relational operators, left associative
 .It
 Assignment operator, right associative
 .It
-+ and - operators, left associative
+.Ql +
+and
+.Ql -
+operators, left associative
 .It
-*, / and % operators, left associative
+.Ql * ,
+.Ql /
+and
+.Ql %
+operators, left associative
 .It
-^ operator, right associative
+.Ql ^
+operator, right associative
 .It
-unary - operator, nonassociative
+unary
+.Ql -
+operator, nonassociative
 .It
-++ and -- operators, nonassociative
+.Ql ++
+and
+.Ql --
+operators, nonassociative
 .El
 .Pp
 This precedence was chosen so that POSIX compliant
@@ -389,16 +408,16 @@ programs will run correctly.
 This will cause the use of the relational and logical operators to
 have some unusual behavior when used with assignment expressions.
 Consider the expression:
-.Dl Ic a = 3 < 5
+.Dl a = 3 < 5
 .Pp
 Most C programmers would assume this would assign the result of
-.Dq Ic 3 < 5
+.Dq Li 3 < 5
 (the value 1) to the variable
-.Dq Ic a .
+.Va a .
 What this does in
 .Nm
 is assign the value 3 to the variable
-.Dq Ic a
+.Va a
 and then compare 3 to 5.
 It is best to use parenthesis when using relational and logical operators
 with the assignment operators.
@@ -407,7 +426,7 @@ There are a few more special expressions
 .Nm .
 These have to do with user defined functions and standard functions.
 They all appear as
-.Do Ar name ( Ar parameters ) Dc .
+.Do Ar name Ns Li \&( Ns Ar parameters Ns Li \&) Dc .
 See the section on functions for user defined functions.
 The standard functions are:
 .Bl -tag -width 20n
@@ -462,7 +481,9 @@ newlines.
 The following is a list of
 .Nm
 statements and what they do:
-(Things enclosed in brackets ([]) are optional parts of the
+(Things enclosed in brackets
+.Pq Oo Oc
+are optional parts of the
 statement.)
 .Bl -tag -width 15n
 .It Ar expression
@@ -518,8 +539,9 @@ The newly assigned value will remain unt
 or another value is assigned to
 .Ic last .
 (Some installations may allow the
-use of a single period (.) which is not part of a number as a short
-hand notation for
+use of a single period
+.Pq Ql \&.
+which is not part of a number as a short hand notation for
 .Ic last . )
 .It Ar "string"
 The
@@ -544,25 +566,26 @@ value is printed and assigned to the var
 Strings in the
 .Ic print
 statement are printed to the output and may contain special characters.
-Special 

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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 20:37:33 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Use .Fn and .Fa for functions and their arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.5 src/external/bsd/bc/dist/bc.1:1.6
--- src/external/bsd/bc/dist/bc.1:1.5	Thu Jan  7 20:22:34 2021
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 20:37:33 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.5 2021/01/07 20:22:34 uwe Exp $
+.\" $NetBSD: bc.1,v 1.6 2021/01/07 20:37:33 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -411,10 +411,10 @@ They all appear as
 See the section on functions for user defined functions.
 The standard functions are:
 .Bl -tag -width 20n
-.It Ic length ( Ar expression )
+.It Fn length expression
 The value of the length function is the number of significant digits in the
 expression.
-.It Ic read ( )
+.It Fn read
 The read function (an extension) will read a number from the standard
 input, regardless of where the function occurs.
 Beware, this can cause problems with the mixing of data and program in
@@ -426,10 +426,10 @@ The value of the read function is the nu
 the standard input using the current value of the variable
 .Ic ibase
 for the conversion base.
-.It Ic scale ( Ar expression )
+.It Fn scale expression
 The value of the scale function is the number of digits after the decimal
 point in the expression.
-.It Ic sqrt ( Ar expression )
+.It Fn sqrt expression
 The value of the sqrt function is the square root of the expression.
 If
 the expression is negative, a run time error is generated.
@@ -813,7 +813,7 @@ Changes of
 .Ic ibase
 will be ignored during the execution of the function except for the
 standard function
-.Ic read ,
+.Fn read ,
 which will always use the current value
 of
 .Ic ibase
@@ -863,22 +863,22 @@ px(1)
 .Ed
 .Pp
 Since
-.Ar py
+.Fn py
 is not a void function, the call of
-.Ar py ( 1 )
+.Ql py(1)
 prints the desired output and then prints a second line that is the value of
 the function.
 Since the value of a function that is not given an
 explicit return statement is zero, the zero is printed.
 For
-.Ar px ( 1 ) ,
+.Ql px(1) ,
 no zero is printed because the function is a void function.
 .Pp
 Also, call by variable for arrays was added.
 To declare
 a call by variable array, the declaration of the array parameter in the
 function definition looks like
-.Do Ar name [ ] Dc .
+.Do Fa name Ns Li [] Dc .
 The call to the
 function remains the same as call by value arrays.
 .Ss MATH LIBRARY
@@ -891,18 +891,33 @@ The math functions will calculate their
 results to the scale set at the time of their call.
 The math library defines the following functions:
 .Bl -tag -width 15n
-.It Ic s ( Ar x )
-The sine of x, x is in radians.
-.It Ic c ( Ar x )
-The cosine of x, x is in radians.
-.It Ic a ( Ar x )
-The arctangent of x, arctangent returns radians.
-.It Ic l ( Ar x )
-The natural logarithm of x.
-.It Ic e ( Ar x )
-The exponential function of raising e to the value x.
-.It Ic j ( n , x )
-The Bessel function of integer order n of x.
+.It Fn s x
+The sine of
+.Fa x ,
+.Fa x
+is in radians.
+.It Fn c x
+The cosine of
+.Fa x ,
+.Fa x
+is in radians.
+.It Fn a x
+The arctangent of
+.FA x ,
+arctangent returns radians.
+.It Fn l x
+The natural logarithm of
+.Fa x .
+.It Fn e x
+The exponential function of raising
+.Va e
+to the value
+.Fa x .
+.It Fn j n x
+The Bessel function of integer order
+.Fa n
+of
+.Fa x .
 .El
 .Sh ENVIRONMENT
 The following environment variables are processed by



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 20:22:34 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Indent displays with code examples.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.4 src/external/bsd/bc/dist/bc.1:1.5
--- src/external/bsd/bc/dist/bc.1:1.4	Thu Jan  7 20:12:59 2021
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 20:22:34 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.4 2021/01/07 20:12:59 uwe Exp $
+.\" $NetBSD: bc.1,v 1.5 2021/01/07 20:22:34 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -726,10 +726,11 @@ That definition is then used until anoth
 definition function for the same name is encountered.
 The new definition then replaces the older definition.
 A function is defined as follows:
-.Bd -literal
+.Bd -literal -offset indent
 define name ( parameters ) { newline
 auto_list   statement_list }
 .Ed
+.Pp
 A function call is just an expression of the form
 .Do Ar name ( Ar parameters ) Dc .
 .Pp
@@ -829,7 +830,7 @@ This version of
 will allow any number of newlines before and after the opening brace of the
 function.
 For example, the following definitions are legal.
-.Bd -literal
+.Bd -literal -offset indent
 define d (n) { return (2*n); }
 define d (n)
   { return (2*n); }
@@ -851,7 +852,7 @@ is placed between the key word
 .Ic define
 and the function name.
 For example, consider the following session.
-.Bd -literal
+.Bd -literal -offset indent
 define py (y) { print "--->", y, "<---", "\n"; }
 define void px (x) { print "--->", x, "<---", "\n"; }
 py(1)
@@ -860,6 +861,7 @@ py(1)
 px(1)
 --->1<---
 .Ed
+.Pp
 Since
 .Ar py
 is not a void function, the call of
@@ -938,7 +940,7 @@ the following will assign the value of
 .Ar pi
 to the shell variable
 .Ar pi .
-.Bd -literal
+.Bd -literal -offset indent
 pi=$(echo "scale=10; 4*a(1)" | bc -l)
 .Ed
 .Pp
@@ -946,7 +948,7 @@ The following is the definition of the e
 math library.
 This function is written in POSIX
 .Nm .
-.Bd -literal
+.Bd -literal -offset indent
 scale = 20
 
 /* Uses the fact that e^x = (e^(x/2))^2
@@ -994,7 +996,7 @@ The following is code that uses the exte
 to implement a simple program for calculating checkbook balances.
 This program is best kept in a file so that it can be used many times
 without having to retype it at every use.
-.Bd -literal
+.Bd -literal -offset indent
 scale=2
 print "\enCheck book program!\en"
 print "  Remember, deposits are negative transactions.\en"
@@ -1014,7 +1016,7 @@ quit
 .Ed
 .Pp
 The following is the definition of the recursive factorial function.
-.Bd -literal
+.Bd -literal -offset indent
 define f (x) {
   if (x <= 1) return (1);
   return (f(x-1) * x);



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 20:12:59 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): Misc fixes in the DIFFERENCES section.

Make "last" an item, as intended.
Make operators literal.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.3 src/external/bsd/bc/dist/bc.1:1.4
--- src/external/bsd/bc/dist/bc.1:1.3	Thu Jan  7 19:49:13 2021
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 20:12:59 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.3 2021/01/07 19:49:13 uwe Exp $
+.\" $NetBSD: bc.1,v 1.4 2021/01/07 20:12:59 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -1085,7 +1085,7 @@ may contain letters, numbers and the und
 .It strings
 Strings are not allowed to contain NUL characters.
 POSIX says all characters must be included in strings.
-.Ic last
+.It Ic last
 POSIX
 .Nm
 does not have a
@@ -1094,7 +1094,9 @@ variable.
 Some implementations
 of
 .Nm
-use the period (.) in a similar way.
+use the period
+.Pq Ql \&.
+in a similar way.
 .It comparisons
 POSIX
 .Nm
@@ -1118,7 +1120,7 @@ POSIX
 requires all expressions to be present in the
 .Ic for
 statement.
-.It && , || , \&!
+.It Li && , || , \&!
 POSIX
 .Nm
 does not have the logical operators.
@@ -1162,7 +1164,7 @@ requires the opening brace on the same l
 key word and the
 .Ic auto
 statement on the next line.
-.It  =+ , =- , =* , =/ , =% , =^
+.It Li =+ , =- , =* , =/ , =% , =^
 POSIX
 .Nm
 does not require these



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

2021-01-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan  7 19:49:13 UTC 2021

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
bc(1): small mdoc fixes to improve PostScript output.

The length/scale example at the beginning is not all literal.
Fix remaining "quoted" words to use .Dq
Fix a few small inline code snippets to be literal.


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

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.2 src/external/bsd/bc/dist/bc.1:1.3
--- src/external/bsd/bc/dist/bc.1:1.2	Mon Apr 17 14:01:19 2017
+++ src/external/bsd/bc/dist/bc.1	Thu Jan  7 19:49:13 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: bc.1,v 1.2 2017/04/17 14:01:19 wiz Exp $
+.\" $NetBSD: bc.1,v 1.3 2021/01/07 19:49:13 uwe Exp $
 .\"
 .\" bc.1 - the bc manual
 .\"
@@ -109,10 +109,13 @@ The length is the
 total number of significant decimal digits in a number and the scale
 is the total number of decimal digits after the decimal point.
 For example:
-.Bd -literal
- .01 has a length of 6 and scale of 6.
- 1935.000 has a length of 7 and a scale of 3.
-.Ed
+.Pp
+.Bl -inset -offset indent -compact
+.It Li .01
+has a length of 6 and scale of 6.
+.It Li 1935.000
+has a length of 7 and a scale of 3.
+.El
 .Ss VARIABLES
 Numbers are stored in two types of variables, simple variables and
 arrays.
@@ -685,7 +688,9 @@ As an extension, the parenthesis are not
 .Ss PSEUDO STATEMENTS
 These statements are not statements in the traditional sense.
 They are not executed statements.
-Their function is performed at "compile" time.
+Their function is performed at
+.Dq compile
+time.
 .Bl -tag -width 15n
 .It Ic limits
 Print the local limits enforced by the local version of
@@ -713,7 +718,9 @@ later.
 Functions in
 .Nm
 always compute a value and return it to the caller.
-Function definitions are "dynamic" in the sense that a function is
+Function definitions are
+.Dq dynamic
+in the sense that a function is
 undefined until a definition is encountered in the input.
 That definition is then used until another
 definition function for the same name is encountered.
@@ -745,7 +752,9 @@ A runtime error will also occur for the 
 .Pp
 The
 .Ar auto_list
-is an optional list of variables that are for "local" use.
+is an optional list of variables that are for
+.Dq local
+use.
 The syntax of the auto list (if present) is
 .Do Ic auto Ar name , ... ; Dc .
 (The semicolon is optional.)
@@ -908,7 +917,9 @@ The format is the same as the command li
 These arguments are processed first, so any files listed in the
 environment arguments are processed before any command line argument
 files.
-This allows the user to set up "standard" options and files to be
+This allows the user to set up
+.Dq standard
+options and files to be
 processed at every invocation of
 .Nm .
 The files in the environment variables would typically contain
@@ -1044,7 +1055,9 @@ It is not implemented in the traditional
 .Xr dc 1 .
 This version is a single process which parses and runs a byte code
 translation of the program.
-There is an "undocumented" option
+There is an
+.Dq undocumented
+option
 .Fl ( c )
 that causes the program to output the byte code to
 the standard output instead of running it.
@@ -1152,27 +1165,32 @@ statement on the next line.
 .It  =+ , =- , =* , =/ , =% , =^
 POSIX
 .Nm
-does not require these "old style" assignment operators to
-be defined.
-This version may allow these "old style" assignments.
+does not require these
+.Dq old style
+assignment operators to be defined.
+This version may allow these
+.Dq old style
+assignments.
 Use the
 .Ic limits
 statement to see if the installed version supports them.
-If it does support the "old style" assignment operators, the statement
-.Dq a =- 1
+If it does support the
+.Dq old style
+assignment operators, the statement
+.Dq Li a =- 1
 will decrement
-.Ar a
+.Va a
 by 1 instead of setting
-.Ar a
+.Va a
 to the value \-1.
 .It spaces in numbers
 Other implementations of
 .Nm
 allow spaces in numbers.
 For example,
-.Dq x=1 3
+.Dq Li x=1 3
 would assign the value 13 to the variable
-.Ar x .
+.Va x .
 The same statement
 would cause a syntax error in this version of
 .Nm .
@@ -1209,7 +1227,8 @@ During an interactive session, the
 signal (usually generated by the control-C character from the
 terminal) will cause execution of the current execution block to be
 interrupted.
-It will display a "runtime"
+It will display a
+.Dq runtime
 error indicating which function was interrupted.
 After all runtime structures have been cleaned up, a message will be
 printed to notify the user that
@@ -1251,7 +1270,9 @@ The limit on the number of characters in
 .Dv INT_MAX
 characters.
 .It exponent
-The value of the exponent in the raise operation (^) is limited to
+The value of the exponent in the raise

CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan  3 15:33:05 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: cmd_args.c ntp_io.c ntp_timer.c

Log Message:
ntp: respect user's wishes to disable interface scanning

While here, disable periodic scanning by default on NetBSD as it's
no longer needed.
The user can still enable it though with a positive number to the -U
option.

kardel@ So far I see no other issues from the pitfalls I know of


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/cmd_args.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/ntp/dist/ntpd/ntp_io.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.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/ntp/dist/ntpd/cmd_args.c
diff -u src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6 src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.7
--- src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/cmd_args.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmd_args.c,v 1.6 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: cmd_args.c,v 1.7 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * cmd_args.c = command-line argument processing
@@ -181,9 +181,11 @@ getCmdOpts(
 	if (HAVE_OPT( UPDATEINTERVAL )) {
 		long val = OPT_VALUE_UPDATEINTERVAL;
 
-		if (val >= 0)
+		if (val >= 0) {
 			interface_interval = val;
-		else {
+			if (interface_interval == 0)
+disable_dynamic_updates = 1;
+		} else {
 			fprintf(stderr,
 "command line interface update interval %ld must not be negative\n",
 val);

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28	Fri Jan  1 17:21:47 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.28 2021/01/01 17:21:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.29 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -455,8 +455,13 @@ init_io(void)
 {
 	/* Init buffer free list and stat counters */
 	init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+	/* route(4) overflow can be observed */
+	interface_interval = 0;
+#else
 	/* update interface every 5 minutes as default */
 	interface_interval = 300;
+#endif
 
 #ifdef WORK_PIPE
 	addremove_io_fd = &ntpd_addremove_io_fd;

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.8 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -423,9 +423,11 @@ timer(void)
 	/*
 	 * Interface update timer
 	 */
-	if (interface_interval && interface_timer <= current_time) {
-		timer_interfacetimeout(current_time +
-		interface_interval);
+	if (!disable_dynamic_updates &&
+	interface_timer && interface_timer <= current_time) {
+		if (interface_interval)
+			timer_interfacetimeout(current_time +
+			interface_interval);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: src/external/bsd/unbound/dist/util

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 23:24:31 UTC 2021

Modified Files:
src/external/bsd/unbound/dist/util: mini_event.c

Log Message:
libunbound: Enforce that mini_event isn't used by include/config.h

As I tire of fixing it to use libevent.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/unbound/dist/util/mini_event.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/unbound/dist/util/mini_event.c
diff -u src/external/bsd/unbound/dist/util/mini_event.c:1.3 src/external/bsd/unbound/dist/util/mini_event.c:1.4
--- src/external/bsd/unbound/dist/util/mini_event.c:1.3	Sun Dec 15 16:16:34 2019
+++ src/external/bsd/unbound/dist/util/mini_event.c	Fri Jan  1 23:24:31 2021
@@ -51,6 +51,9 @@
 #include 
 #include "util/fptr_wlist.h"
 
+/* Enforce a correct include/config.h as I tire of fixin it. */
+#error This code should not be active on NetBSD, please use libevent.
+
 /** compare events in tree, based on timevalue, ptr for uniqueness */
 int mini_ev_cmp(const void* a, const void* b)
 {



CVS commit: src/external/bsd/unbound/lib/libunbound

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 23:17:15 UTC 2021

Modified Files:
src/external/bsd/unbound/lib/libunbound: Makefile

Log Message:
Revert prior

With the correct #defines mini_event.c and winsock_event.c are
compiled but practically unused.

What is exposed is not part of the public API, but appease the
peanut gallery.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/unbound/lib/libunbound/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/unbound/lib/libunbound/Makefile
diff -u src/external/bsd/unbound/lib/libunbound/Makefile:1.5 src/external/bsd/unbound/lib/libunbound/Makefile:1.6
--- src/external/bsd/unbound/lib/libunbound/Makefile:1.5	Fri Jan  1 20:38:36 2021
+++ src/external/bsd/unbound/lib/libunbound/Makefile	Fri Jan  1 23:17:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/01/01 20:38:36 roy Exp $
+# $NetBSD: Makefile,v 1.6 2021/01/01 23:17:15 roy Exp $
 
 .include 
 
@@ -55,6 +55,7 @@ log.c \
 lookup3.c \
 lruhash.c \
 mesh.c \
+mini_event.c \
 modstack.c \
 module.c \
 msgencode.c \
@@ -92,6 +93,7 @@ val_sigcrypt.c \
 val_utils.c \
 validator.c \
 view.c \
+winsock_event.c \
 wire2str.c
 
 LIBDPLIBS+= ${DPLIBS}



CVS commit: src/external/bsd/unbound/lib/libunbound

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 20:38:36 UTC 2021

Modified Files:
src/external/bsd/unbound/lib/libunbound: Makefile

Log Message:
libunbound: Now we use libevent, don't build mini_event or winsock_event.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/unbound/lib/libunbound/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/unbound/lib/libunbound/Makefile
diff -u src/external/bsd/unbound/lib/libunbound/Makefile:1.4 src/external/bsd/unbound/lib/libunbound/Makefile:1.5
--- src/external/bsd/unbound/lib/libunbound/Makefile:1.4	Sun May 26 02:49:12 2019
+++ src/external/bsd/unbound/lib/libunbound/Makefile	Fri Jan  1 20:38:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2019/05/26 02:49:12 christos Exp $
+# $NetBSD: Makefile,v 1.5 2021/01/01 20:38:36 roy Exp $
 
 .include 
 
@@ -55,7 +55,6 @@ log.c \
 lookup3.c \
 lruhash.c \
 mesh.c \
-mini_event.c \
 modstack.c \
 module.c \
 msgencode.c \
@@ -93,7 +92,6 @@ val_sigcrypt.c \
 val_utils.c \
 validator.c \
 view.c \
-winsock_event.c \
 wire2str.c
 
 LIBDPLIBS+= ${DPLIBS}



CVS commit: src/external/bsd/unbound/include

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 20:16:16 UTC 2021

Modified Files:
src/external/bsd/unbound/include: config.h

Log Message:
libunbound: actually use libevent as we link to it

Would appreciate if people modify this file to actually test what
polling mechanism unbound uses as select(2) is pretty poor.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/unbound/include/config.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/bsd/unbound/include/config.h
diff -u src/external/bsd/unbound/include/config.h:1.7 src/external/bsd/unbound/include/config.h:1.8
--- src/external/bsd/unbound/include/config.h:1.7	Sun Dec 15 16:16:34 2019
+++ src/external/bsd/unbound/include/config.h	Fri Jan  1 20:16:16 2021
@@ -175,22 +175,22 @@
 /* #undef HAVE_ERR_LOAD_CRYPTO_STRINGS */
 
 /* Define to 1 if you have the `event_assign' function. */
-/* #undef HAVE_EVENT_ASSIGN */
+#define HAVE_EVENT_ASSIGN 1
 
 /* Define to 1 if you have the `event_base_free' function. */
-/* #undef HAVE_EVENT_BASE_FREE */
+#define HAVE_EVENT_BASE_FREE 1
 
 /* Define to 1 if you have the `event_base_get_method' function. */
-/* #undef HAVE_EVENT_BASE_GET_METHOD */
+#define HAVE_EVENT_BASE_GET_METHOD 1
 
 /* Define to 1 if you have the `event_base_new' function. */
-/* #undef HAVE_EVENT_BASE_NEW */
+#define HAVE_EVENT_BASE_NEW 1
 
 /* Define to 1 if you have the `event_base_once' function. */
-/* #undef HAVE_EVENT_BASE_ONCE */
+#define HAVE_EVENT_BASE_ONCE 1
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_EVENT_H */
+#define HAVE_EVENT_H 1
 
 /* Define to 1 if you have the `EVP_aes_256_cbc' function. */
 #define HAVE_EVP_AES_256_CBC 1
@@ -792,7 +792,7 @@
 /* #undef USE_IPSET */
 
 /* Define if you want to use internal select based events */
-#define USE_MINI_EVENT 1
+/* #undef USE_MINI_EVENT */
 
 /* Define this to enable client TCP Fast Open. */
 /* #undef USE_MSG_FASTOPEN */



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 17:21:47 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: In the event of route(4) overflow, update the interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/ntp/dist/ntpd/ntp_io.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/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.27 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.27	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Fri Jan  1 17:21:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.27 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.28 2021/01/01 17:21:47 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4727,6 +4727,14 @@ process_routing_msgs(struct asyncio_read
 		if (errno == ENOBUFS) {
 			msyslog(LOG_ERR,
 "routing socket reports: %m");
+			/*
+			 * drain the routing socket as we need to update
+			 * the interfaces anyway
+			 */
+			do {
+cnt = read(reader->fd, buffer, sizeof(buffer));
+			} while (cnt != -1 || errno == ENOBUFS);
+			timer_interfacetimeout(current_time + UPDATE_GRACE);
 		} else {
 			msyslog(LOG_ERR,
 "routing socket reports: %m - disabling");
@@ -4837,6 +4845,9 @@ init_async_notifications()
 	struct sockaddr_nl sa;
 #else
 	int fd = socket(PF_ROUTE, SOCK_RAW, 0);
+#ifdef SO_RERROR
+	int on = 1;
+#endif
 #endif
 #ifdef RO_MSGFILTER
 	unsigned char msgfilter[] = {
@@ -4907,6 +4918,10 @@ init_async_notifications()
 	&msgfilter, sizeof(msgfilter)) == -1)
 		msyslog(LOG_ERR, "RO_MSGFILTER: %m");
 #endif
+#ifdef SO_RERROR
+	if (setsockopt(fd, SOL_SOCKET, SO_RERROR, &on, sizeof(on)) == -1)
+		msyslog(LOG_ERR, "SO_RERROR: %m");
+#endif
 	make_socket_nonblocking(fd);
 #if defined(HAVE_SIGNALED_IO)
 	init_socket_sig(fd);



CVS commit: src/external/bsd/wpa/dist/src/drivers

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 14:57:14 UTC 2021

Modified Files:
src/external/bsd/wpa/dist/src/drivers: driver_bsd.c

Log Message:
wpa: If route socket overflows, sync drivers to system interfaces

Messages such as RTM_IFNFO or RTM_IFANNOUNCE could have been lost.
As such, sync the state of our internal driver to the state of the
system interfaces as reported by getifaddrs(2).

This change requires the routing socket be placed in non-blocking
mode. While here, set the routing and inet sockets to close on exec.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/external/bsd/wpa/dist/src/drivers/driver_bsd.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/drivers/driver_bsd.c
diff -u src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.37 src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.38
--- src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.37	Tue Jul 21 10:34:16 2020
+++ src/external/bsd/wpa/dist/src/drivers/driver_bsd.c	Fri Jan  1 14:57:14 2021
@@ -16,7 +16,9 @@
 #include "common/ieee802_11_defs.h"
 #include "common/wpa_common.h"
 
+#include 
 #include 
+#include 
 #include 
 
 #ifdef __NetBSD__
@@ -615,6 +617,108 @@ bsd_set_opt_ie(void *priv, const u8 *ie,
 	return 0;
 }
 
+#ifdef SO_RERROR
+static void
+bsd_route_overflow(int sock, void *ctx, struct bsd_driver_global *global)
+{
+	char event_buf[2048]; /* max size of a single route(4) msg */
+	int n;
+	struct ifaddrs *ifaddrs, *ifa;
+	struct bsd_driver_data *drv;
+	struct sockaddr_dl *sdl;
+	union wpa_event_data event;
+
+	/* We need to match the system state, so drain the route
+	 * socket to avoid stale messages. */
+	do {
+		n = read(sock, event_buf, sizeof(event_buf));
+	} while (n != -1 || errno == ENOBUFS);
+
+	if (getifaddrs(&ifaddrs) == -1) {
+		wpa_printf(MSG_ERROR, "%s getifaddrs() failed: %s",
+			   __func__, strerror(errno));
+			   return;
+	}
+
+	/* add or update existing interfaces */
+	for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
+		if (ifa->ifa_addr == NULL ||
+		ifa->ifa_addr->sa_family != AF_LINK)
+			continue;
+		sdl = (struct sockaddr_dl *)(void *)ifa->ifa_addr;
+		drv = bsd_get_drvname(global, ifa->ifa_name);
+		if (drv != NULL &&
+		(drv->ifindex != sdl->sdl_index || drv->if_removed)) {
+			wpa_printf(MSG_DEBUG,
+			"RTM_IFANNOUNCE: Interface '%s' added",
+			drv->ifname);
+			drv->ifindex = sdl->sdl_index;
+			drv->if_removed = 0;
+			event.interface_status.ievent = EVENT_INTERFACE_ADDED;
+			os_strlcpy(event.interface_status.ifname, ifa->ifa_name,
+			sizeof(event.interface_status.ifname));
+			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_STATUS,
+	 &event);
+		}
+		if (drv == NULL &&
+		(drv = bsd_get_drvindex(global, sdl->sdl_index)) != NULL) {
+			/* Driver name is invalid */
+			wpa_printf(MSG_DEBUG,
+			"RTM_IFANNOUNCE: Interface '%s' removed",
+			drv->ifname);
+			drv->if_removed = 1;
+			event.interface_status.ievent = EVENT_INTERFACE_REMOVED;
+			os_strlcpy(event.interface_status.ifname, drv->ifname,
+			sizeof(event.interface_status.ifname));
+			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_STATUS,
+	 &event);
+		}
+	}
+
+	/* punt missing interfaces and update flags */
+	dl_list_for_each(drv, &global->ifaces, struct bsd_driver_data, list) {
+		for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
+			if (ifa->ifa_addr == NULL ||
+			ifa->ifa_addr->sa_family != AF_LINK)
+continue;
+			sdl = (struct sockaddr_dl *)(void *)ifa->ifa_addr;
+			if (os_strcmp(drv->ifname, ifa->ifa_name) == 0)
+break;
+		}
+		if (ifa == NULL && !drv->if_removed) {
+			wpa_printf(MSG_DEBUG,
+			"RTM_IFANNOUNCE: Interface '%s' removed",
+			drv->ifname);
+			drv->if_removed = 1;
+			event.interface_status.ievent = EVENT_INTERFACE_REMOVED;
+			os_strlcpy(event.interface_status.ifname, drv->ifname,
+			sizeof(event.interface_status.ifname));
+			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_STATUS,
+	 &event);
+		}
+		if (ifa == NULL)
+			continue;
+
+		if ((ifa->ifa_flags & IFF_UP) == 0 &&
+		(drv->flags & IFF_UP) != 0) {
+			wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN",
+   drv->ifname);
+			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED,
+	 NULL);
+		} else if ((ifa->ifa_flags & IFF_UP) != 0 &&
+		(drv->flags & IFF_UP) == 0) {
+			wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
+   drv->ifname);
+			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
+	 NULL);
+		}
+		drv->flags = ifa->ifa_flags;
+	}
+
+	freeifaddrs(ifaddrs);
+}
+#endif
+
 static void
 bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
 {
@@ -635,6 +739,10 @@ bsd_wireless_event_receive(int sock, voi
 		if (errno != EINTR && errno != EAGAIN)
 			wpa_printf(MSG_ERROR, "%s read() failed: %s",
    __func__, strerror(e

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

2020-12-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 28 13:57:40 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/hooks: 20-resolv.conf
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
if-options.c ipv6nd.c privsep.c script.c

Log Message:
Sync with dhcpcd-9.4.0


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
cvs rdiff -u -r1.44 -r1.45 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcp6.c \
src/external/bsd/dhcpcd/dist/src/ipv6nd.c
cvs rdiff -u -r1.47 -r1.48 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/dhcpcd/dist/src/privsep.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/script.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/dhcpcd/dist/hooks/20-resolv.conf
diff -u src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.5 src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.6
--- src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.5	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf	Mon Dec 28 13:57:40 2020
@@ -7,9 +7,15 @@
 # or dnsmasq. This is important as the libc resolver isn't that powerful.
 
 resolv_conf_dir="$state_dir/resolv.conf"
+nocarrier_roaming_dir="$state_dir/roaming"
 NL="
 "
 : ${resolvconf:=resolvconf}
+if type "$resolvconf" >/dev/null 2>&1; then
+	have_resolvconf=true
+else
+	have_resolvconf=false
+fi
 
 build_resolv_conf()
 {
@@ -164,7 +170,7 @@ add_resolv_conf()
 	for x in ${new_domain_name_servers}; do
 		conf="${conf}nameserver $x$NL"
 	done
-	if type "$resolvconf" >/dev/null 2>&1; then
+	if $have_resolvconf; then
 		[ -n "$ifmetric" ] && export IF_METRIC="$ifmetric"
 		printf %s "$conf" | "$resolvconf" -a "$ifname"
 		return $?
@@ -180,7 +186,7 @@ add_resolv_conf()
 
 remove_resolv_conf()
 {
-	if type "$resolvconf" >/dev/null 2>&1; then
+	if $have_resolvconf; then
 		"$resolvconf" -d "$ifname" -f
 	else
 		if [ -e "$resolv_conf_dir/$ifname" ]; then
@@ -199,7 +205,18 @@ BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
 esac
 
 if $if_configured; then
-	if $if_up || [ "$reason" = ROUTERADVERT ]; then
+	if $have_resolvconf && [ "$reason" = NOCARRIER_ROAMING ]; then
+		# avoid calling resolvconf -c on CARRIER unless we roam
+		mkdir -p "$nocarrier_roaming_dir"
+		echo " " >"$nocarrier_roaming_dir/$interface"
+		"$resolvconf" -C "$interface.*"
+	elif $have_resolvconf && [ "$reason" = CARRIER ]; then
+		# Not all resolvconf implementations support -c
+		if [ -e "$nocarrier_roaming_dir/$interface" ]; then
+			rm -f "$nocarrier_roaming_dir/$interface"
+			"$resolvconf" -c "$interface.*"
+		fi
+	elif $if_up || [ "$reason" = ROUTERADVERT ]; then
 		add_resolv_conf
 	elif $if_down; then
 		remove_resolv_conf

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.44 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.45
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.44	Sat Nov 28 14:27:20 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Mon Dec 28 13:57:40 2020
@@ -3886,20 +3886,9 @@ dhcp_init(struct interface *ifp)
 	state->clientid = NULL;
 
 	if (ifo->options & DHCPCD_ANONYMOUS) {
-		uint8_t duid[DUID_LEN];
-		uint8_t duid_len;
-
-		duid_len = (uint8_t)duid_make(duid, ifp, DUID_LL);
-		if (duid_len != 0) {
-			state->clientid = malloc((size_t)duid_len + 6);
-			if (state->clientid == NULL)
-goto eexit;
-			state->clientid[0] =(uint8_t)(duid_len + 5);
-			state->clientid[1] = 255; /* RFC 4361 */
-			memcpy(state->clientid + 2, ifo->iaid, 4);
-			memset(state->clientid + 2, 0, 4); /* IAID */
-			memcpy(state->clientid + 6, duid, duid_len);
-		}
+		/* Removing the option could show that we want anonymous.
+		 * As such keep it as it's already in the hwaddr field. */
+		goto make_clientid;
 	} else if (*ifo->clientid) {
 		state->clientid = malloc((size_t)(ifo->clientid[0] + 1));
 		if (state->clientid == NULL)
@@ -3917,6 +3906,7 @@ dhcp_init(struct interface *ifp)
 			memcpy(state->clientid + 6, ifp->ctx->duid,
 			ifp->ctx->duid_len);
 		} else {
+make_clientid:
 			len = (uint8_t)(ifp->hwlen + 1);
 			state->clientid = malloc((size_t)len + 1);
 			if (state->clientid == NULL)

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.26 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.27
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.26	Sat Nov 28 14:27:20 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Mon Dec 28 13:57:40 2020
@@ -2065,7 +2065,8 @@ dhcp6_checkstatusok(const struct interfa
 	state->lerror = code;
 	errno = 0;
 
-	if (code != 0 && ifp->ctx->options & DHCPCD_TEST)
+	/* code cannot be D6_STATUS_OK, so there

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

2020-12-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Dec 27 18:26:50 UTC 2020

Modified Files:
src/external/bsd/openresolv/dist: resolvconf.8.in resolvconf.conf.5.in
resolvconf.in

Log Message:
Sync with openresolv-3.12.0


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/openresolv/dist/resolvconf.8.in
cvs rdiff -u -r1.20 -r1.21 \
src/external/bsd/openresolv/dist/resolvconf.conf.5.in
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/openresolv/dist/resolvconf.in

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/openresolv/dist/resolvconf.8.in
diff -u src/external/bsd/openresolv/dist/resolvconf.8.in:1.10 src/external/bsd/openresolv/dist/resolvconf.8.in:1.11
--- src/external/bsd/openresolv/dist/resolvconf.8.in:1.10	Mon Jan 27 21:13:05 2020
+++ src/external/bsd/openresolv/dist/resolvconf.8.in	Sun Dec 27 18:26:50 2020
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 29, 2016
+.Dd December 23, 2016
 .Dt RESOLVCONF 8
 .Os
 .Sh NAME
@@ -38,6 +38,10 @@
 .Fl a Ar interface Ns Op Ar .protocol
 .No < Ns Pa file
 .Nm
+.Fl C Ar pattern
+.Nm
+.Fl c Ar pattern
+.Nm
 .Op Fl f
 .Fl d Ar interface Ns Op Ar .protocol
 .Nm
@@ -126,6 +130,15 @@ file(s) for all the
 .Ar protocols
 on the
 .Ar interface .
+For systems that support the concept of persisting configuration when
+the carrier goes down, then it should instead call
+.Nm
+with
+.Fl C Ar interface.*
+arguments to deprecate the matching interfaces and
+.Fl c Ar interface.*
+to activate the matching interfaces when the carrier comes up.
+This only affects the order in which interfaces are processed.
 .Pp
 Here are some options for the above commands:-
 .Bl -tag -width pattern_opt

Index: src/external/bsd/openresolv/dist/resolvconf.conf.5.in
diff -u src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.20 src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.21
--- src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.20	Mon Jan 27 21:13:05 2020
+++ src/external/bsd/openresolv/dist/resolvconf.conf.5.in	Sun Dec 27 18:26:50 2020
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 8, 2019
+.Dd October 1, 2020
 .Dt RESOLVCONF.CONF 5
 .Os
 .Sh NAME
@@ -220,7 +220,7 @@ openresolv ships with subscribers for th
 and
 .Xr unbound 8 .
 Each subscriber can create configuration files which should be included in
-in the subscribers main configuration file.
+the subscribers main configuration file.
 .Pp
 To disable a subscriber, simply set it's name to NO.
 For example, to disable the libc subscriber you would set:

Index: src/external/bsd/openresolv/dist/resolvconf.in
diff -u src/external/bsd/openresolv/dist/resolvconf.in:1.8 src/external/bsd/openresolv/dist/resolvconf.in:1.9
--- src/external/bsd/openresolv/dist/resolvconf.in:1.8	Wed Jul 22 13:19:17 2020
+++ src/external/bsd/openresolv/dist/resolvconf.in	Sun Dec 27 18:26:50 2020
@@ -25,7 +25,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 RESOLVCONF="$0"
-OPENRESOLV_VERSION="3.11.0"
+OPENRESOLV_VERSION="3.12.0"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 VARDIR=@VARDIR@
@@ -64,6 +64,7 @@ IFACEDIR="$VARDIR/interfaces"
 METRICDIR="$VARDIR/metrics"
 PRIVATEDIR="$VARDIR/private"
 EXCLUSIVEDIR="$VARDIR/exclusive"
+DEPRECATEDDIR="$VARDIR/deprecated"
 LOCKDIR="$VARDIR/lock"
 _PWD="$PWD"
 
@@ -88,6 +89,8 @@ usage()
 	Commands:
 	  -a \$INTERFACEAdd DNS information to the specified interface
 	   (DNS supplied via stdin in resolv.conf format)
+	  -C \$PATTERN  Deprecate DNS information for matched interfaces
+	  -c \$PATTERN  Configure DNS information for matched interfaces
 	  -d \$INTERFACEDelete DNS information from the specified interface
 	  -h   Show this help cruft
 	  -i [\$PATTERN]Show interfaces that have supplied DNS information
@@ -275,19 +278,14 @@ dirname()
 
 config_mkdirs()
 {
-	e=0
 	for f; do
 		[ -n "$f" ] || continue
 		d="$(dirname "$f")"
 		if [ ! -d "$d" ]; then
-			if type install >/dev/null 2>&1; then
-install -d "$d" || e=$?
-			else
-mkdir "$d" || e=$?
-			fi
+			mkdir -p "$d" || return $?
 		fi
 	done
-	return $e
+	return 0
 }
 
 # With the advent of alternative init systems, it's possible to have
@@ -412,6 +410,22 @@ echo_resolv()
 	IFS="$OIFS"
 }
 
+deprecated_interface()
+{
+	[ -d "$DEPRECATEDDIR" ] || return 1
+
+	cd "$DEPRECATEDDIR"
+	for da; do
+		for daf in *; do
+			[ -f "$daf" ] || continue
+			case "$da" in
+			$daf) return 0;;
+			esac
+		done
+	done
+	return 1
+}
+
 list_resolv()
 {
 	[ -d "$IFACEDIR" ] || return 0
@@ -453,12 +467,14 @@ list_resolv()
 		$force || report=true
 	elif ! $excl; then
 		cd "$IFACEDIR"
+
 		for i in $interface_order; do
 			[ -f "$i" ] && list="$list $i"
 			for ii

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

2020-12-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 18 20:07:40 UTC 2020

Removed Files:
src/external/bsd/pkg_install/dist: Makefile.in README config.guess
config.sub configure configure.ac diff install-sh tkpkg
src/external/bsd/pkg_install/dist/add: Makefile.in pkg_add.cat
src/external/bsd/pkg_install/dist/admin: Makefile.in audit-packages.cat
download-vulnerability-list.cat pkg_admin.cat
src/external/bsd/pkg_install/dist/create: Makefile.in pkg_create.cat
src/external/bsd/pkg_install/dist/delete: Makefile.in pkg_delete.cat
src/external/bsd/pkg_install/dist/info: Makefile.in pkg_info.cat
src/external/bsd/pkg_install/dist/lib: Makefile.in
pkg_install.conf.cat.in pkg_summary.cat pkgsrc.cat

Log Message:
Merge pkg_install-20201218


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/Makefile.in \
src/external/bsd/pkg_install/dist/README \
src/external/bsd/pkg_install/dist/config.guess \
src/external/bsd/pkg_install/dist/config.sub \
src/external/bsd/pkg_install/dist/configure \
src/external/bsd/pkg_install/dist/configure.ac \
src/external/bsd/pkg_install/dist/install-sh \
src/external/bsd/pkg_install/dist/tkpkg
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/pkg_install/dist/diff
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/add/Makefile.in
cvs rdiff -u -r1.4 -r0 src/external/bsd/pkg_install/dist/add/pkg_add.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/admin/Makefile.in \
src/external/bsd/pkg_install/dist/admin/audit-packages.cat \
src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.cat
cvs rdiff -u -r1.5 -r0 src/external/bsd/pkg_install/dist/admin/pkg_admin.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/create/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/create/pkg_create.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/delete/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/delete/pkg_delete.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/info/Makefile.in
cvs rdiff -u -r1.4 -r0 src/external/bsd/pkg_install/dist/info/pkg_info.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/lib/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/lib/pkg_install.conf.cat.in \
src/external/bsd/pkg_install/dist/lib/pkg_summary.cat \
src/external/bsd/pkg_install/dist/lib/pkgsrc.cat

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



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

2020-12-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 16 01:21:32 UTC 2020

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

Log Message:
For alpha, apply -O0 hack again to rtree.c for GCC9.
Otherwise, GDB11 crashes in strange ways.


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

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.12 src/external/bsd/jemalloc/lib/Makefile.inc:1.13
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.12	Wed Oct  7 07:35:28 2020
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Wed Dec 16 01:21:32 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2020/10/07 07:35:28 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2020/12/16 01:21:32 rin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -55,7 +55,7 @@ COPTS.tcache.c+=-Wno-error=stack-protect
 # These files need to be compiled with -O0, or build everything with
 # -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
 # reported in port-alpha/54307.
-COPTS.rtree.c+=	${${HAVE_GCC:U0} < 9:? -O0 :}
+COPTS.rtree.c+=	-O0
 COPTS.tcache.c+=-O0
 .endif
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2020-12-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 16 01:20:19 UTC 2020

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Correct and extend comments on VA for alpha. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.13 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.14
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.13	Thu Jun  4 00:45:32 2020
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Wed Dec 16 01:20:19 2020
@@ -48,7 +48,14 @@
 #ifdef _LP64
 /* XXX: I will take care of this later */
 # ifdef __alpha__
-#  define LG_VADDR 43	/* bit 42 indicates direct map, 42--63 are same */
+/*
+ * Bit 42 indicates kernel space. Bits 42--63 must be same. For user space,
+ * VA can be regarded to have 43 significant bits with sign-extension to
+ * 64 bits. ``Negative'' addresses are not used in this case. Alternatively,
+ * VA can also be regarded to have 42 significant bits with zero-extension.
+ * See rtree_leaf_elm_bits_extent_get() in rtree.h for more details.
+ */
+#  define LG_VADDR 43
 # else
 #  define LG_VADDR 48
 # endif



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

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

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

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


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

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

Modified files:

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



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

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

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

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


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

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

Added files:

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

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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pkg_install/dist/lib/plist.c

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

Modified files:

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



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

2020-12-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Dec 12 11:00:57 UTC 2020

Modified Files:
src/external/bsd/pkg_install/dist/add: perform.c
src/external/bsd/pkg_install/dist/lib: lib.h parse-config.c
pkg_install.conf.5.in version.h

Log Message:
merge pkg_install-20201212


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/pkg_install/dist/add/perform.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/pkg_install/dist/lib/lib.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/lib/parse-config.c \
src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/pkg_install/dist/lib/version.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/bsd/pkg_install/dist/add/perform.c
diff -u src/external/bsd/pkg_install/dist/add/perform.c:1.7 src/external/bsd/pkg_install/dist/add/perform.c:1.8
--- src/external/bsd/pkg_install/dist/add/perform.c:1.7	Wed Dec  2 13:53:50 2020
+++ src/external/bsd/pkg_install/dist/add/perform.c	Sat Dec 12 11:00:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $	*/
+/*	$NetBSD: perform.c,v 1.8 2020/12/12 11:00:57 wiz Exp $	*/
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.8 2020/12/12 11:00:57 wiz Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie 
@@ -151,6 +151,15 @@ compatible_platform(const char *opsys, c
 {
 int i = 0;
 
+/*
+ * If the user has set the CHECK_OS_VERSION variable to "no" then skip any
+ * uname version checks and assume they know what they are doing.  This can
+ * be useful on OS where the kernel version is not a good indicator of
+ * userland compatibility, or differs but retains ABI compatibility.
+ */
+if (strcasecmp(check_os_version, "no") == 0)
+	return 1;
+
 /* returns 1 if host and package operating system match */
 if (strcmp(host, package) == 0)
 	return 1;
@@ -1179,6 +1188,10 @@ check_dependencies(struct pkg_task *pkg)
 			continue;
 
 		best_installed = find_best_matching_installed_pkg(p->name, 0);
+		if (best_installed == NULL) {
+			warnx("Expected dependency %s still missing", p->name);
+			return -1;
+		}
 
 		for (i = 0; i < pkg->dep_length; ++i) {
 			if (strcmp(best_installed, pkg->dependencies[i]) == 0)
@@ -1225,6 +1238,8 @@ preserve_meta_data_file(struct pkg_task 
 static int
 start_replacing(struct pkg_task *pkg)
 {
+	int result = -1;
+
 	if (preserve_meta_data_file(pkg, REQUIRED_BY_FNAME))
 		return -1;
 
@@ -1241,14 +1256,19 @@ start_replacing(struct pkg_task *pkg)
 			Destdir ? " -P ": "", Destdir ? Destdir : "",
 			pkg->other_version);
 	}
-	if (!Fake)
-		fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
+	if (!Fake) {
+		result = fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
 		"-p", pkg->prefix,
 		Destdir ? "-P": "", Destdir ? Destdir : "",
 		pkg->other_version, NULL);
+		if (result != 0) {
+			warnx("command failed: %s/pkg_delete -K %s -p %s %s%s%s",
+			  BINDIR, pkgdb_get_dir(), pkg->prefix, Destdir ? "-P" : " ",
+			  Destdir ? Destdir : "", pkg->other_version);
+		}
+	}
 
-	/* XXX Check return value and do what? */
-	return 0;
+	return result;
 }
 
 static int check_input(const char *line, size_t len)

Index: src/external/bsd/pkg_install/dist/lib/lib.h
diff -u src/external/bsd/pkg_install/dist/lib/lib.h:1.10 src/external/bsd/pkg_install/dist/lib/lib.h:1.11
--- src/external/bsd/pkg_install/dist/lib/lib.h:1.10	Wed Dec  2 13:53:50 2020
+++ src/external/bsd/pkg_install/dist/lib/lib.h	Sat Dec 12 11:00:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.10 2020/12/02 13:53:50 wiz Exp $ */
+/* $NetBSD: lib.h,v 1.11 2020/12/12 11:00:57 wiz Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -447,6 +447,7 @@ extern const char *cert_chain_file;
 extern const char *certs_packages;
 extern const char *certs_pkg_vulnerabilities;
 extern const char *check_eol;
+extern const char *check_os_version;
 extern const char *check_vulnerabilities;
 extern const char *config_file;
 extern const char *config_pkg_dbdir;

Index: src/external/bsd/pkg_install/dist/lib/parse-config.c
diff -u src/external/bsd/pkg_install/dist/lib/parse-config.c:1.3 src/external/bsd/pkg_install/dist/lib/parse-config.c:1.4
--- src/external/bsd/pkg_install/dist/lib/parse-config.c:1.3	Sat Apr  6 00:05:47 2019
+++ src/external/bsd/pkg_install/dist/lib/parse-config.c	Sat Dec 12 11:00:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse-config.c,v 1.3 2019/04/06 00:05:47 sevan Exp $	*/
+/*	$NetBSD: parse-config.c,v 1.4 2020/12/12 11:00:57 wiz Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: parse-config.c,v 

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

2020-12-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Dec  5 16:21:26 UTC 2020

Modified Files:
src/external/bsd/pkg_install/dist/lib: pkgdb.c version.h

Log Message:
Merge pkg_install-20201205


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/lib/pkgdb.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/pkg_install/dist/lib/version.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/bsd/pkg_install/dist/lib/pkgdb.c
diff -u src/external/bsd/pkg_install/dist/lib/pkgdb.c:1.3 src/external/bsd/pkg_install/dist/lib/pkgdb.c:1.4
--- src/external/bsd/pkg_install/dist/lib/pkgdb.c:1.3	Wed Dec  2 13:53:50 2020
+++ src/external/bsd/pkg_install/dist/lib/pkgdb.c	Sat Dec  5 16:21:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pkgdb.c,v 1.3 2020/12/02 13:53:50 wiz Exp $	*/
+/*	$NetBSD: pkgdb.c,v 1.4 2020/12/05 16:21:26 wiz Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: pkgdb.c,v 1.3 2020/12/02 13:53:50 wiz Exp $");
+__RCSID("$NetBSD: pkgdb.c,v 1.4 2020/12/05 16:21:26 wiz Exp $");
 
 /*-
  * Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
@@ -310,8 +310,9 @@ pkgdb_get_dir(void)
 	stat("/var/db/pkg", &sb) == 0) {
 		errx(EXIT_FAILURE,
 		 "The default PKG_DBDIR has changed, but this installation still uses the old one.\n"
-		 "Please move the database and re-run this command:\n"
-		 "\tmv /var/db/pkg " DEF_LOG_DIR);
+		 "Please move the databases and re-run this command:\n"
+		 "\tmv /var/db/pkg " DEF_LOG_DIR "\n"
+		 "\tmv /var/db/pkg.refcount " DEF_LOG_DIR ".refcount");
 	}
 
 return pkgdb_dir;

Index: src/external/bsd/pkg_install/dist/lib/version.h
diff -u src/external/bsd/pkg_install/dist/lib/version.h:1.16 src/external/bsd/pkg_install/dist/lib/version.h:1.17
--- src/external/bsd/pkg_install/dist/lib/version.h:1.16	Wed Dec  2 13:53:50 2020
+++ src/external/bsd/pkg_install/dist/lib/version.h	Sat Dec  5 16:21:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: version.h,v 1.16 2020/12/02 13:53:50 wiz Exp $	*/
+/*	$NetBSD: version.h,v 1.17 2020/12/05 16:21:26 wiz Exp $	*/
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20200828
+#define PKGTOOLS_VERSION 20201205
 
 #endif /* _INST_LIB_VERSION_H_ */



CVS commit: src/external/bsd/libfido2

2020-12-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  4 18:27:44 UTC 2020

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

Log Message:
merge changes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/lib/Makefile \
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/Makefile.inc
diff -u src/external/bsd/libfido2/Makefile.inc:1.1 src/external/bsd/libfido2/Makefile.inc:1.2
--- src/external/bsd/libfido2/Makefile.inc:1.1	Mon Mar  2 19:14:17 2020
+++ src/external/bsd/libfido2/Makefile.inc	Fri Dec  4 13:27:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2020/03/03 00:14:17 christos Exp $
+# $NetBSD: Makefile.inc,v 1.2 2020/12/04 18:27:44 christos Exp $
 
 DIST:=${.PARSEDIR}/dist
 
@@ -12,4 +12,4 @@ 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
+CPPFLAGS+=-DHAVE_UNISTD_H -DHAVE_ARC4RANDOM_BUF -DHAVE_TIMESPECSUB

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.1 src/external/bsd/libfido2/lib/Makefile:1.2
--- src/external/bsd/libfido2/lib/Makefile:1.1	Mon Mar  2 19:14:17 2020
+++ src/external/bsd/libfido2/lib/Makefile	Fri Dec  4 13:27:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2020/03/03 00:14:17 christos Exp $
+# $NetBSD: Makefile,v 1.2 2020/12/04 18:27:44 christos Exp $
 
 NOLINT=
 .include 
@@ -6,7 +6,7 @@ NOLINT=
 
 .PATH: ${DIST}/src ${DIST}/man ${DIST}/openbsd-compat
 
-CPPFLAGS+= -DHAVE_ARC4RANDOM_BUF -D_FIDO_INTERNAL -I${DIST}/src
+CPPFLAGS+= -D_FIDO_INTERNAL -I${DIST}/src
 
 LDADD+=-lusbhid -lcbor
 DPADD+=${LIBUSBHID} ${LIBCBOR}
@@ -77,6 +77,7 @@ fido_cred_set_authdata.3 \
 fido_cred_verify.3 \
 fido_credman_metadata_new.3 \
 fido_dev_get_assert.3 \
+fido_dev_get_touch_begin.3 \
 fido_dev_info_manifest.3 \
 fido_dev_make_cred.3 \
 fido_dev_open.3 \
@@ -87,7 +88,7 @@ fido_strerr.3 \
 rs256_pk_new.3
 
 SHLIB_MAJOR=2
-SHLIB_MINOR=0
+SHLIB_MINOR=1
 
 .SUFFIXES: .in
 .in:
Index: src/external/bsd/libfido2/lib/fido2.map
diff -u src/external/bsd/libfido2/lib/fido2.map:1.1 src/external/bsd/libfido2/lib/fido2.map:1.2
--- src/external/bsd/libfido2/lib/fido2.map:1.1	Mon Mar  2 19:14:17 2020
+++ src/external/bsd/libfido2/lib/fido2.map	Fri Dec  4 13:27:44 2020
@@ -35,9 +35,9 @@ FIDO_2_0 {
 	fido_assert_set_sig;
 	fido_assert_set_up;
 	fido_assert_set_uv;
-	fido_assert_sigcount;
 	fido_assert_sig_len;
 	fido_assert_sig_ptr;
+	fido_assert_sigcount;
 	fido_assert_user_display_name;
 	fido_assert_user_icon;
 	fido_assert_user_id_len;
@@ -75,6 +75,9 @@ FIDO_2_0 {
 	fido_cbor_info_extensions_len;
 	fido_cbor_info_extensions_ptr;
 	fido_cbor_info_free;
+	fido_cbor_info_fwversion;
+	fido_cbor_info_maxcredcntlst;
+	fido_cbor_info_maxcredidlen;
 	fido_cbor_info_maxmsgsiz;
 	fido_cbor_info_new;
 	fido_cbor_info_options_len;
@@ -84,6 +87,8 @@ FIDO_2_0 {
 	fido_cbor_info_protocols_ptr;
 	fido_cbor_info_versions_len;
 	fido_cbor_info_versions_ptr;
+	fido_cred_aaguid_len;
+	fido_cred_aaguid_ptr;
 	fido_cred_authdata_len;
 	fido_cred_authdata_ptr;
 	fido_cred_clientdata_hash_len;
@@ -95,25 +100,6 @@ FIDO_2_0 {
 	fido_cred_free;
 	fido_cred_id_len;
 	fido_cred_id_ptr;
-	fido_credman_del_dev_rk;
-	fido_credman_get_dev_metadata;
-	fido_credman_get_dev_rk;
-	fido_credman_get_dev_rp;
-	fido_credman_metadata_free;
-	fido_credman_metadata_new;
-	fido_credman_rk;
-	fido_credman_rk_count;
-	fido_credman_rk_existing;
-	fido_credman_rk_free;
-	fido_credman_rk_new;
-	fido_credman_rk_remaining;
-	fido_credman_rp_count;
-	fido_credman_rp_free;
-	fido_credman_rp_id;
-	fido_credman_rp_id_hash_len;
-	fido_credman_rp_id_hash_ptr;
-	fido_credman_rp_name;
-	fido_credman_rp_new;
 	fido_cred_new;
 	fido_cred_prot;
 	fido_cred_pubkey_len;
@@ -144,6 +130,25 @@ FIDO_2_0 {
 	fido_cred_verify_self;
 	fido_cred_x5c_len;
 	fido_cred_x5c_ptr;
+	fido_credman_del_dev_rk;
+	fido_credman_get_dev_metadata;
+	fido_credman_get_dev_rk;
+	fido_credman_get_dev_rp;
+	fido_credman_metadata_free;
+	fido_credman_metadata_new;
+	fido_credman_rk;
+	fido_credman_rk_count;
+	fido_credman_rk_existing;
+	fido_credman_rk_free;
+	fido_credman_rk_new;
+	fido_credman_rk_remaining;
+	fido_credman_rp_count;
+	fido_credman_rp_free;
+	fido_credman_rp_id;
+	fido_credman_rp_id_hash_len;
+	fido_credman_rp_id_hash_ptr;
+	fido_credman_rp_name;
+	fido_credman_rp_new;
 	fido_dev_build;
 	fido_dev_cancel;
 	fido_dev_close;
@@ -154,6 +159,8 @@ FIDO_2_0 {
 	fido_dev_get_assert;
 	fido_dev_get_cbor_info;
 	fido_dev_get_retry_count;
+	fido_dev_get_touch_begin;
+	fido_dev_get_touch_status;
 	fido_dev_info_free;
 	fido_dev_info_manifest;
 	fido_dev_info_manufacturer_string;
@@

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

2020-12-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec  2 13:54:25 UTC 2020

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

Log Message:
Define PREFIX for pkg_install build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/pkg_install/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/pkg_install/lib/Makefile
diff -u src/external/bsd/pkg_install/lib/Makefile:1.10 src/external/bsd/pkg_install/lib/Makefile:1.11
--- src/external/bsd/pkg_install/lib/Makefile:1.10	Fri Oct  4 09:47:28 2019
+++ src/external/bsd/pkg_install/lib/Makefile	Wed Dec  2 13:54:25 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2019/10/04 09:47:28 mrg Exp $
+# $NetBSD: Makefile,v 1.11 2020/12/02 13:54:25 wiz Exp $
 # Original from FreeBSD, no rcs id.
 
 LIBISPRIVATE=	yes
@@ -24,6 +24,7 @@ pkg_install.conf.5: ${DIST}/lib/pkg_inst
 CLEANFILES+=	pkg_install.conf.5
 
 CPPFLAGS+=	-DNETBSD
+CPPFLAGS+=	-DPREFIX=\"/usr/pkg\"
 
 COPTS.plist.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=restrict :}
 



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

2020-12-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec  2 13:53:50 UTC 2020

Modified Files:
src/external/bsd/pkg_install/dist/add: perform.c
src/external/bsd/pkg_install/dist/admin: check.c main.c pkg_admin.1
src/external/bsd/pkg_install/dist/create: perform.c pl.c
src/external/bsd/pkg_install/dist/info: perform.c
src/external/bsd/pkg_install/dist/lib: iterate.c lib.h license.c
pkgdb.c plist.c version.h vulnerabilities-file.c

Log Message:
merge pkg_install after import of 20201202 version


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/pkg_install/dist/add/perform.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/admin/check.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/pkg_install/dist/admin/main.c \
src/external/bsd/pkg_install/dist/admin/pkg_admin.1
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/create/perform.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/create/pl.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/info/perform.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/lib/iterate.c \
src/external/bsd/pkg_install/dist/lib/pkgdb.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/pkg_install/dist/lib/lib.h \
src/external/bsd/pkg_install/dist/lib/license.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pkg_install/dist/lib/plist.c \
src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/pkg_install/dist/lib/version.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/bsd/pkg_install/dist/add/perform.c
diff -u src/external/bsd/pkg_install/dist/add/perform.c:1.6 src/external/bsd/pkg_install/dist/add/perform.c:1.7
--- src/external/bsd/pkg_install/dist/add/perform.c:1.6	Sun Mar 25 04:04:36 2018
+++ src/external/bsd/pkg_install/dist/add/perform.c	Wed Dec  2 13:53:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: perform.c,v 1.6 2018/03/25 04:04:36 sevan Exp $	*/
+/*	$NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $	*/
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include 
 #endif
-__RCSID("$NetBSD: perform.c,v 1.6 2018/03/25 04:04:36 sevan Exp $");
+__RCSID("$NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie 
@@ -450,7 +450,7 @@ check_other_installed(struct pkg_task *p
 		return -1;
 	}
 	*iter = '\0';
-	pkg->other_version = find_best_matching_installed_pkg(pkgbase);
+	pkg->other_version = find_best_matching_installed_pkg(pkgbase, 0);
 	free(pkgbase);
 	if (pkg->other_version == NULL)
 		return 0;
@@ -505,10 +505,12 @@ check_other_installed(struct pkg_task *p
 continue;
 			if (pkg_match(p->name, pkg->pkgname) == 1)
 continue; /* Both match, ok. */
-			warnx("Dependency of %s fulfilled by %s, but not by %s",
-			iter, pkg->other_version, pkg->pkgname);
-			if (!ForceDepending)
+			if (!ForceDepending) {
+warnx("Dependency of %s fulfilled by %s, "
+"but not by %s", iter, pkg->other_version,
+pkg->pkgname);
 status = -1;
+			}
 			break;
 		}
 		free_plist(&plist);		
@@ -979,7 +981,8 @@ run_install_script(struct pkg_task *pkg,
 	setenv(PKG_REFCOUNT_DBDIR_VNAME, config_pkg_refcount_dbdir, 1);
 
 	if (Verbose)
-		printf("Running install with PRE-INSTALL for %s.\n", pkg->pkgname);
+		printf("Running install with %s for %s.\n", argument,
+		pkg->pkgname);
 	if (Fake)
 		return 0;
 
@@ -1102,6 +1105,40 @@ check_implicit_conflict(struct pkg_task 
 	return status;
 }
 
+/*
+ * Install a required dependency and verify its installation.
+ */
+static int
+install_depend_pkg(const char *dep)
+{
+	/* XXX check cyclic dependencies? */
+	if (Fake || NoRecord) {
+		if (!Force) {
+			warnx("Missing dependency %s\n", dep);
+			return 1;
+		}
+		warnx("Missing dependency %s, continuing", dep);
+	}
+
+	if (pkg_do(dep, 1, 0)) {
+		if (!ForceDepends) {
+			warnx("Can't install dependency %s", dep);
+			return 1;
+		}
+		warnx("Can't install dependency %s, continuing", dep);
+	}
+
+	if (find_best_matching_installed_pkg(dep, 0) == NULL) {
+		if (!ForceDepends) {
+			warnx("Just installed dependency %s disappeared", dep);
+			return 1;
+		}
+		warnx("Missing dependency %s ignored", dep);
+	}
+
+	return 0;
+}
+
 static int
 check_dependencies(struct pkg_task *pkg)
 {
@@ -1112,6 +1149,9 @@ check_dependencies(struct pkg_task *pkg)
 
 	status = 0;
 
+	/*
+	 * Recursively handle dependencies, installing as required.
+	 */
 	for (p = pkg->plist.head; p != NULL; p = p->next) {
 		if (p->type == PLIST_IGNORE) {
 			p = p->next;
@@ -1119,43 +1159,27 @@ check_dependencies(struct pkg_task *pkg)
 		} else if (p->type != PLIST_PKGDEP)
 			continue;
 
-		best_installed = find_best_matching_installed_pkg(p->name);
-
-		if (best_installed == NULL) {
-			/* XXX check cyclic dependencies? */
-			if (Fake || NoRecord) {
-

CVS commit: src/external/bsd/elftoolchain/dist/common

2020-11-30 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Mon Nov 30 22:26:30 UTC 2020

Modified Files:
src/external/bsd/elftoolchain/dist/common: uthash.h

Log Message:
Unbreak the lint build (sync to elftoolchain [r3912]).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/elftoolchain/dist/common/uthash.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/bsd/elftoolchain/dist/common/uthash.h
diff -u src/external/bsd/elftoolchain/dist/common/uthash.h:1.3 src/external/bsd/elftoolchain/dist/common/uthash.h:1.4
--- src/external/bsd/elftoolchain/dist/common/uthash.h:1.3	Wed Nov 18 22:23:05 2020
+++ src/external/bsd/elftoolchain/dist/common/uthash.h	Mon Nov 30 22:26:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uthash.h,v 1.3 2020/11/18 22:23:05 jkoshy Exp $	*/
+/*	$NetBSD: uthash.h,v 1.4 2020/11/30 22:26:30 jkoshy Exp $	*/
 
 /*
 Copyright (c) 2003-2018, Troy D. Hanson http://troydhanson.github.com/uthash/
@@ -76,6 +76,8 @@ typedef unsigned char uint8_t;
 #endif
 #elif defined(__GNUC__) && !defined(__VXWORKS__)
 #include 
+#elif defined(__lint__)
+#include 
 #else
 typedef unsigned int uint32_t;
 typedef unsigned char uint8_t;



  1   2   3   4   5   6   7   8   9   10   >