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

2020-07-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jul  6 01:08:15 UTC 2020

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

Log Message:
Fix race in fpu save with fpu_kern_enter in softint.

Likely source of:

https://mail-index.netbsd.org/current-users/2020/07/02/msg039051.html


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x86/x86/fpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.65 src/sys/arch/x86/x86/fpu.c:1.66
--- src/sys/arch/x86/x86/fpu.c:1.65	Sun Jun 14 16:12:05 2020
+++ src/sys/arch/x86/x86/fpu.c	Mon Jul  6 01:08:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.65 2020/06/14 16:12:05 riastradh Exp $	*/
+/*	$NetBSD: fpu.c,v 1.66 2020/07/06 01:08:15 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.65 2020/06/14 16:12:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.66 2020/07/06 01:08:15 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -126,6 +126,8 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.65
 #define stts() HYPERVISOR_fpu_taskswitch(1)
 #endif
 
+static void fpu_area_do_save(void *, uint64_t);
+
 void fpu_handle_deferred(void);
 void fpu_switch(struct lwp *, struct lwp *);
 
@@ -155,8 +157,24 @@ fpu_save_lwp(struct lwp *l)
 	kpreempt_disable();
 	if (l->l_md.md_flags & MDL_FPU_IN_CPU) {
 		KASSERT((l->l_flag & LW_SYSTEM) == 0);
-		fpu_area_save(area, x86_xsave_features);
+
+		/*
+		 * Order is important, in case we are interrupted and
+		 * the interrupt calls fpu_kern_enter, triggering
+		 * reentry of fpu_save_lwp:
+		 *
+		 * 1. Save FPU state.
+		 * 2. Note FPU state has been saved.
+		 * 3. Disable FPU access so the kernel doesn't
+		 *accidentally use it.
+		 *
+		 * Steps (1) and (2) are both idempotent until step
+		 * (3), after which point attempting to save the FPU
+		 * state will trigger #NM/fpudna fault.
+		 */
+		fpu_area_do_save(area, x86_xsave_features);
 		l->l_md.md_flags &= ~MDL_FPU_IN_CPU;
+		stts();
 	}
 	kpreempt_enable();
 }
@@ -245,8 +263,8 @@ fpu_errata_amd(void)
 	fldummy();
 }
 
-void
-fpu_area_save(void *area, uint64_t xsave_features)
+static void
+fpu_area_do_save(void *area, uint64_t xsave_features)
 {
 	switch (x86_fpu_save) {
 	case FPU_SAVE_FSAVE:
@@ -262,7 +280,13 @@ fpu_area_save(void *area, uint64_t xsave
 		xsaveopt(area, xsave_features);
 		break;
 	}
+}
+
+void
+fpu_area_save(void *area, uint64_t xsave_features)
+{
 
+	fpu_area_do_save(area, xsave_features);
 	stts();
 }
 



CVS commit: src/sys/sys

2020-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  5 20:41:50 UTC 2020

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

Log Message:
mention shared bit.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/sys/fstypes.h

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

Modified files:

Index: src/sys/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.39 src/sys/sys/fstypes.h:1.40
--- src/sys/sys/fstypes.h:1.39	Sat May 16 14:31:53 2020
+++ src/sys/sys/fstypes.h	Sun Jul  5 16:41:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.h,v 1.39 2020/05/16 18:31:53 christos Exp $	*/
+/*	$NetBSD: fstypes.h,v 1.40 2020/07/05 20:41:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -148,7 +148,7 @@ typedef struct fhandle	fhandle_t;
 	{ MNT_EXPORTED,		0,	"NFS exported" }, \
 	{ MNT_DEFEXPORTED,	1,	"exported to the world" }, \
 	{ MNT_EXPORTANON,	1,	"anon uid mapping" }, \
-	{ MNT_EXKERB,		1,	"kerberos uid mapping" }, \
+	{ MNT_EXKERB,		1,	"kerberos uid mapping/posix1e ACLS" }, \
 	{ MNT_EXNORESPORT,	0,	"non-reserved ports" }, \
 	{ MNT_EXPUBLIC,		0,	"WebNFS exports" },
 



CVS commit: src/sys/ufs/ffs

2020-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  5 20:37:40 UTC 2020

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

Log Message:
simplify the acl setup, and fix reversed mask in the fs_flags code.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.370 src/sys/ufs/ffs/ffs_vfsops.c:1.371
--- src/sys/ufs/ffs/ffs_vfsops.c:1.370	Mon May 18 04:28:44 2020
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sun Jul  5 16:37:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.370 2020/05/18 08:28:44 hannken Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.371 2020/07/05 20:37:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.370 2020/05/18 08:28:44 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.371 2020/07/05 20:37:40 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -404,8 +404,8 @@ ffs_acls(struct mount *mp, int fs_flags)
 			printf("WARNING: %s: ACLs flag on fs conflicts with "
 			"\"posix1eacls\" mount option; option ignored\n",
 			mp->mnt_stat.f_mntonname);
-		mp->mnt_flag &= ~MNT_ACLS;
-		mp->mnt_flag |= MNT_POSIX1EACLS;
+		mp->mnt_flag &= ~MNT_POSIX1EACLS;
+		mp->mnt_flag |= MNT_ACLS;
 
 #else
 		printf("WARNING: %s: ACLs flag on fs but no ACLs support\n",
@@ -418,8 +418,8 @@ ffs_acls(struct mount *mp, int fs_flags)
 			printf("WARNING: %s: NFSv4 ACLs flag on fs conflicts "
 			"with \"acls\" mount option; option ignored\n",
 			mp->mnt_stat.f_mntonname);
-		mp->mnt_flag &= ~MNT_POSIX1EACLS;
-		mp->mnt_flag |= MNT_ACLS;
+		mp->mnt_flag &= ~MNT_ACLS;
+		mp->mnt_flag |= MNT_POSIX1EACLS;
 #else
 		printf("WARNING: %s: POSIX.1e ACLs flag on fs but no "
 		"ACLs support\n", mp->mnt_stat.f_mntonname);
@@ -658,14 +658,13 @@ ffs_mount(struct mount *mp, const char *
 			fs->fs_fmod = 0;
 		}
 
+		ffs_acls(mp, fs->fs_flags);
 		if (mp->mnt_flag & MNT_RELOAD) {
 			error = ffs_reload(mp, l->l_cred, l);
 			if (error) {
 DPRINTF("ffs_reload returned %d", error);
 return error;
 			}
-		} else {
-			ffs_acls(mp, 0);
 		}
 
 		if (fs->fs_ronly && (mp->mnt_iflag & IMNT_WANTRDWR)) {
@@ -908,8 +907,6 @@ ffs_reload(struct mount *mp, kauth_cred_
 	}
 	ffs_oldfscompat_read(fs, ump, sblockloc);
 
-	ffs_acls(mp, 0);
-
 	mutex_enter(>um_lock);
 	ump->um_maxfilesize = fs->fs_maxfilesize;
 	if (fs->fs_flags & ~(FS_KNOWN_FLAGS | FS_INTERNAL)) {



CVS commit: src/usr.sbin/cpuctl/arch

2020-07-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul  5 19:40:27 UTC 2020

Modified Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
(cpuctl/aarch64) Add some more aa64isar0_eli1 flags.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/cpuctl/arch/aarch64.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/aarch64.c
diff -u src/usr.sbin/cpuctl/arch/aarch64.c:1.10 src/usr.sbin/cpuctl/arch/aarch64.c:1.11
--- src/usr.sbin/cpuctl/arch/aarch64.c:1.10	Wed Jul  1 08:03:10 2020
+++ src/usr.sbin/cpuctl/arch/aarch64.c	Sun Jul  5 19:40:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarch64.c,v 1.10 2020/07/01 08:03:10 ryo Exp $	*/
+/*	$NetBSD: aarch64.c,v 1.11 2020/07/05 19:40:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -29,7 +29,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: aarch64.c,v 1.10 2020/07/01 08:03:10 ryo Exp $");
+__RCSID("$NetBSD: aarch64.c,v 1.11 2020/07/05 19:40:27 riastradh Exp $");
 #endif /* no lint */
 
 #include 
@@ -229,6 +229,75 @@ struct fieldinfo id_aa64isar0_fieldinfo[
 		}
 	},
 	{
+		.bitpos = 20, .bitwidth = 4, .name = "Atomic",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No Atomic",
+			[1] = "LDADD/LDCLR/LDEOR/LDSET/LDSMAX/LDSMIN"
+			"/LDUMAX/LDUMIN/CAS/CASP/SWP",
+		}
+	},
+	{
+		.bitpos = 28, .bitwidth = 4, .name = "RDM",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No RDMA",
+			[1] = "SQRDMLAH/SQRDMLSH",
+		}
+	},
+	{
+		.bitpos = 32, .bitwidth = 4, .name = "SHA3",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No SHA3",
+			[1] = "EOR3/RAX1/XAR/BCAX",
+		}
+	},
+	{
+		.bitpos = 36, .bitwidth = 4, .name = "SM3",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No SM3",
+			[1] = "SM3SS1/SM3TT1A/SM3TT1B/SM3TT2A/SM3TT2B"
+			"/SM3PARTW1/SM3PARTW2",
+		}
+	},
+	{
+		.bitpos = 40, .bitwidth = 4, .name = "SM4",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No SM4",
+			[1] = "SM4E/SM4EKEY",
+		}
+	},
+	{
+		.bitpos = 44, .bitwidth = 4, .name = "DP",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No Dot Product",
+			[1] = "UDOT/SDOT",
+		}
+	},
+	{
+		.bitpos = 48, .bitwidth = 4, .name = "FHM",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No FHM",
+			[1] = "FMLAL/FMLSL",
+		}
+	},
+	{
+		.bitpos = 52, .bitwidth = 4, .name = "TS",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No TS",
+			[1] = "CFINV/RMIF/SETF16/SETF8",
+			[2] = "CFINV/RMIF/SETF16/SETF8/AXFLAG/XAFLAG",
+		}
+	},
+	{
+		.bitpos = 56, .bitwidth = 4, .name = "TLBI",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No outer shareable and TLB range maintenance"
+			" instructions",
+			[1] = "Outer shareable TLB maintenance instructions",
+			[2] = "Outer shareable and TLB range maintenance"
+			" instructions",
+		}
+	},
+	{
 		.bitpos = 60, .bitwidth = 4, .name = "RNDR",
 		.info = (const char *[16]) { /* 16=4bit */
 			[0] = "No RNDR/RNDRRS",



CVS commit: src/sys/dev/pci

2020-07-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Jul  5 19:28:37 UTC 2020

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

Log Message:
there is more to MSI/MSI-X support in ciss(4) than just allocating the
right interrupt, it needs some explicit support; disable for now
until the full support is there

PR kern/55461


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ciss_pci.c

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

Modified files:

Index: src/sys/dev/pci/ciss_pci.c
diff -u src/sys/dev/pci/ciss_pci.c:1.16 src/sys/dev/pci/ciss_pci.c:1.17
--- src/sys/dev/pci/ciss_pci.c:1.16	Sat Jul  4 14:49:24 2020
+++ src/sys/dev/pci/ciss_pci.c	Sun Jul  5 19:28:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss_pci.c,v 1.16 2020/07/04 14:49:24 jdolecek Exp $	*/
+/*	$NetBSD: ciss_pci.c,v 1.17 2020/07/05 19:28:37 jdolecek Exp $	*/
 /*	$OpenBSD: ciss_pci.c,v 1.9 2005/12/13 15:56:01 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.16 2020/07/04 14:49:24 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.17 2020/07/05 19:28:37 jdolecek Exp $");
 
 #include 
 #include 
@@ -263,7 +263,7 @@ ciss_pci_attach(device_t parent, device_
 	struct ciss_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	bus_size_t size, cfgsz;
-	pci_intr_handle_t *ih;
+	pci_intr_handle_t ih;
 	const char *intrstr;
 	int cfg_bar, memtype;
 	pcireg_t reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
@@ -339,16 +339,16 @@ ciss_pci_attach(device_t parent, device_
 	bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) | sc->iem);
 #endif
 
-	if (pci_intr_alloc(pa, , NULL, 0) != 0) {
+	if (pci_intr_map(pa, )) {
 		aprint_error_dev(self, "can't map interrupt\n");
 		bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
 		if (cfg_bar != CISS_BAR)
 			bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
 		return;
 	}
-	intrstr = pci_intr_string(pa->pa_pc, ih[0], intrbuf, sizeof(intrbuf));
-	sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih[0], IPL_BIO,
-	ciss_intr, sc, device_xname(self));
+	intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
+	sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih, IPL_BIO, ciss_intr,
+	sc, device_xname(self));
 	if (!sc->sc_ih) {
 		aprint_error_dev(sc->sc_dev, "can't establish interrupt");
 		if (intrstr)



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 11:37:02 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: ChangeLog NEWS configure configure.ac

Log Message:
tnftp 20200705 release

Changes since tnftp 20151004:
* Avoid crashes by exiting if lostpeer due to a signal
  (e.g., remote server disconnection).
* Issue PWD commands to the server only when we actually
  need the results, not speculatively, just in case we might.
  Works around broken servers, and is quicker too.
* Use "anonymous" instead of the local username for anonymous
  ftp. Avoids unnecesary information leak.
* Use the first name we requested the http/https URL for,
  not any name we ended up with after random redirects.
* Support using CONNECT for https:// via proxy.
* Improve SSL error reporting, and IPv6 endpoint reporting.
* Use the system glob() if required extensions are supported.
* Use the system libedit library by default, instead of
  the local (embedded) libedit.
* Update to NetBSD-ftp 20200608.
* Update local (embedded) libedit to NetBSD as at 2020-07-04.
  Fixes various crashes.
* Portability improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 othersrc/usr.bin/tnftp/ChangeLog
cvs rdiff -u -r1.14 -r1.15 othersrc/usr.bin/tnftp/NEWS
cvs rdiff -u -r1.52 -r1.53 othersrc/usr.bin/tnftp/configure
cvs rdiff -u -r1.37 -r1.38 othersrc/usr.bin/tnftp/configure.ac

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

Modified files:

Index: othersrc/usr.bin/tnftp/ChangeLog
diff -u othersrc/usr.bin/tnftp/ChangeLog:1.72 othersrc/usr.bin/tnftp/ChangeLog:1.73
--- othersrc/usr.bin/tnftp/ChangeLog:1.72	Sun Jul  5 10:55:11 2020
+++ othersrc/usr.bin/tnftp/ChangeLog	Sun Jul  5 11:37:02 2020
@@ -1,6 +1,11 @@
-$NetBSD: ChangeLog,v 1.72 2020/07/05 10:55:11 lukem Exp $
+$NetBSD: ChangeLog,v 1.73 2020/07/05 11:37:02 lukem Exp $
 
-Sun Jul  5 10:51:50 UTC 2020	lukem
+Sun Jul  5 11:18:52 UTC 2020	lukem
+
+	* Release as "tnftp 20200705".
+
+	* Provide dummy source in libnetbsd to avoid linker errors
+	  if no functions are replaced.
 
 	* Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.
 

Index: othersrc/usr.bin/tnftp/NEWS
diff -u othersrc/usr.bin/tnftp/NEWS:1.14 othersrc/usr.bin/tnftp/NEWS:1.15
--- othersrc/usr.bin/tnftp/NEWS:1.14	Sun Jul  5 10:55:11 2020
+++ othersrc/usr.bin/tnftp/NEWS	Sun Jul  5 11:37:02 2020
@@ -1,8 +1,8 @@
-$NetBSD: NEWS,v 1.14 2020/07/05 10:55:11 lukem Exp $
+$NetBSD: NEWS,v 1.15 2020/07/05 11:37:02 lukem Exp $
 
-This is tnftp version (unreleased).
+This is tnftp version 20200705.
 
-Changes in tnftp 20151004 to (unreleased):
+Changes in tnftp 20151004 to 20200705:
 
 	Avoid crashes by exiting if lostpeer due to a signal
 	(e.g., remote server disconnection).

Index: othersrc/usr.bin/tnftp/configure
diff -u othersrc/usr.bin/tnftp/configure:1.52 othersrc/usr.bin/tnftp/configure:1.53
--- othersrc/usr.bin/tnftp/configure:1.52	Sun Jul  5 11:14:57 2020
+++ othersrc/usr.bin/tnftp/configure	Sun Jul  5 11:37:02 2020
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Revision: 1.37 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftp 20151004.
+# Generated by GNU Autoconf 2.69 for tnftp 20200705.
 #
 # Report bugs to .
 #
@@ -596,8 +596,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tnftp'
 PACKAGE_TARNAME='tnftp'
-PACKAGE_VERSION='20151004'
-PACKAGE_STRING='tnftp 20151004'
+PACKAGE_VERSION='20200705'
+PACKAGE_STRING='tnftp 20200705'
 PACKAGE_BUGREPORT='lu...@netbsd.org'
 PACKAGE_URL=''
 
@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tnftp 20151004 to adapt to many kinds of systems.
+\`configure' configures tnftp 20200705 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1408,7 +1408,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of tnftp 20151004:";;
+ short | recursive ) echo "Configuration of tnftp 20200705:";;
esac
   cat <<\_ACEOF
 
@@ -1526,7 +1526,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tnftp configure 20151004
+tnftp configure 20200705
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2111,7 +2111,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tnftp $as_me 20151004, which was
+It was created by tnftp $as_me 20200705, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 

CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 11:14:57 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: configure
othersrc/usr.bin/tnftp/libnetbsd: Makefile.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 othersrc/usr.bin/tnftp/configure
cvs rdiff -u -r1.12 -r1.13 othersrc/usr.bin/tnftp/libnetbsd/Makefile.in

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

Modified files:

Index: othersrc/usr.bin/tnftp/configure
diff -u othersrc/usr.bin/tnftp/configure:1.51 othersrc/usr.bin/tnftp/configure:1.52
--- othersrc/usr.bin/tnftp/configure:1.51	Sun Jul  5 10:55:48 2020
+++ othersrc/usr.bin/tnftp/configure	Sun Jul  5 11:14:57 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.35 .
+# From configure.ac Revision: 1.37 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for tnftp 20151004.
 #
@@ -13,7 +13,7 @@
 # gives unlimited permission to copy, distribute and modify it.
 #
 #
-# Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
+# Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 ##  ##
@@ -1534,7 +1534,7 @@ This configure script is free software; 
 gives unlimited permission to copy, distribute and modify it.
 
 
-Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
+Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
 All rights reserved.
 
 _ACEOF

Index: othersrc/usr.bin/tnftp/libnetbsd/Makefile.in
diff -u othersrc/usr.bin/tnftp/libnetbsd/Makefile.in:1.12 othersrc/usr.bin/tnftp/libnetbsd/Makefile.in:1.13
--- othersrc/usr.bin/tnftp/libnetbsd/Makefile.in:1.12	Sat Jul  4 14:59:16 2020
+++ othersrc/usr.bin/tnftp/libnetbsd/Makefile.in	Sun Jul  5 11:14:57 2020
@@ -74,7 +74,7 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libnetbsd_la_DEPENDENCIES = $(LTLIBOBJS)
-am_libnetbsd_la_OBJECTS =
+am_libnetbsd_la_OBJECTS = libnetbsd.lo
 libnetbsd_la_OBJECTS = $(am_libnetbsd_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -239,7 +239,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 noinst_LTLIBRARIES = libnetbsd.la
-libnetbsd_la_SOURCES = 
+libnetbsd_la_SOURCES = libnetbsd.c
 libnetbsd_la_LIBADD = $(LTLIBOBJS)
 EXTRA_DIST = \
 	fseeko.c \
@@ -323,6 +323,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/usleep.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/utimes.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vasprintf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetbsd.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -473,7 +474,7 @@ clean-am: clean-generic clean-libtool cl
 	mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf $(DEPDIR)
+	-rm -rf $(DEPDIR) ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -519,7 +520,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf $(DEPDIR)
+	-rm -rf $(DEPDIR) ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 11:13:12 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: COPYING configure.ac

Log Message:
copyright up to 2020


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 othersrc/usr.bin/tnftp/COPYING
cvs rdiff -u -r1.36 -r1.37 othersrc/usr.bin/tnftp/configure.ac

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

Modified files:

Index: othersrc/usr.bin/tnftp/COPYING
diff -u othersrc/usr.bin/tnftp/COPYING:1.7 othersrc/usr.bin/tnftp/COPYING:1.8
--- othersrc/usr.bin/tnftp/COPYING:1.7	Tue Jan 12 07:01:01 2010
+++ othersrc/usr.bin/tnftp/COPYING	Sun Jul  5 11:13:12 2020
@@ -1,6 +1,6 @@
-$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $
+$NetBSD: COPYING,v 1.8 2020/07/05 11:13:12 lukem Exp $
 
-Copyright (c) 2001-2010 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
 All rights reserved.
 
 This code is derived from software contributed to The NetBSD Foundation

Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.36 othersrc/usr.bin/tnftp/configure.ac:1.37
--- othersrc/usr.bin/tnftp/configure.ac:1.36	Sun Jul  5 10:55:11 2020
+++ othersrc/usr.bin/tnftp/configure.ac	Sun Jul  5 11:13:12 2020
@@ -1,4 +1,4 @@
-#   $NetBSD: configure.ac,v 1.36 2020/07/05 10:55:11 lukem Exp $
+#   $NetBSD: configure.ac,v 1.37 2020/07/05 11:13:12 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -6,10 +6,10 @@ AC_INIT([tnftp], [20151004], [lukem@NetB
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
-Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
+Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.36 $])
+AC_REVISION([$Revision: 1.37 $])
 
 AS_SHELL_SANITIZE()
 



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 11:11:10 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: Makefile.am
Added Files:
othersrc/usr.bin/tnftp/libnetbsd: libnetbsd.c

Log Message:
libnetbsd: add dummy source to avoid an empty library


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/usr.bin/tnftp/libnetbsd/Makefile.am
cvs rdiff -u -r0 -r1.1 othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/Makefile.am
diff -u othersrc/usr.bin/tnftp/libnetbsd/Makefile.am:1.2 othersrc/usr.bin/tnftp/libnetbsd/Makefile.am:1.3
--- othersrc/usr.bin/tnftp/libnetbsd/Makefile.am:1.2	Mon Jan  4 06:24:20 2010
+++ othersrc/usr.bin/tnftp/libnetbsd/Makefile.am	Sun Jul  5 11:11:10 2020
@@ -1,9 +1,8 @@
-## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:20 lukem Exp $
+## $NetBSD: Makefile.am,v 1.3 2020/07/05 11:11:10 lukem Exp $
 
 noinst_LTLIBRARIES = libnetbsd.la
 
-libnetbsd_la_SOURCES =
-
+libnetbsd_la_SOURCES = libnetbsd.c
 
 CPPFLAGS = \
 	-I$(srcdir) \

Added files:

Index: othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c
diff -u /dev/null othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c:1.1
--- /dev/null	Sun Jul  5 11:11:10 2020
+++ othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c	Sun Jul  5 11:11:10 2020
@@ -0,0 +1,3 @@
+/* $NetBSD: libnetbsd.c,v 1.1 2020/07/05 11:11:10 lukem Exp $ */
+
+const char libnetbsd_dummy[] = "Ensure libnetbsd.la is not empty";



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:55:48 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: configure tnftp_config.h.in

Log Message:
regen for conditional glob replacement


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/usr.bin/tnftp/configure
cvs rdiff -u -r1.7 -r1.8 othersrc/usr.bin/tnftp/tnftp_config.h.in

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

Modified files:

Index: othersrc/usr.bin/tnftp/configure
diff -u othersrc/usr.bin/tnftp/configure:1.50 othersrc/usr.bin/tnftp/configure:1.51
--- othersrc/usr.bin/tnftp/configure:1.50	Sun Jul  5 10:19:31 2020
+++ othersrc/usr.bin/tnftp/configure	Sun Jul  5 10:55:48 2020
@@ -3220,6 +3220,7 @@ fi
 
 
 
+
 #
 # Checks for programs.
 #
@@ -14347,14 +14348,50 @@ _ACEOF
 
 fi
 
-# Always replace glob(); the vendor's may not be secure.
+# Use system glob if GLOB_BRACE and GLOB_TILDE are available.
 #
-case " $LIBOBJS " in
+use_local_glob=yes
+ac_fn_c_check_header_mongrel "$LINENO" "glob.h" "ac_cv_header_glob_h" "$ac_includes_default"
+if test "x$ac_cv_header_glob_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking glob supports required extensions" >&5
+$as_echo_n "checking glob supports required extensions... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include 
+int
+main ()
+{
+
+int f = GLOB_BRACE | GLOB_TILDE;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+			  use_local_glob=no
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - using local version" >&5
+$as_echo "no - using local version" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+if test "$use_local_glob" = yes; then :
+  case " $LIBOBJS " in
   *" glob.$ac_objext "* ) ;;
   *) LIBOBJS="$LIBOBJS glob.$ac_objext"
  ;;
 esac
 
+else
+  $as_echo "#define USE_GLOB_H 1" >>confdefs.h
+
+fi
 
 # We assume that if sprintf() supports %lld or %qd,
 # then all of *printf() does. If not, disable long long

Index: othersrc/usr.bin/tnftp/tnftp_config.h.in
diff -u othersrc/usr.bin/tnftp/tnftp_config.h.in:1.7 othersrc/usr.bin/tnftp/tnftp_config.h.in:1.8
--- othersrc/usr.bin/tnftp/tnftp_config.h.in:1.7	Sun Jul  5 10:19:31 2020
+++ othersrc/usr.bin/tnftp/tnftp_config.h.in	Sun Jul  5 10:55:48 2020
@@ -470,6 +470,9 @@
 /* Define to 1 if your  declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 
+/* Define if using system  instead of local glob. */
+#undef USE_GLOB_H
+
 /* Define if using IPv6 support. */
 #undef USE_INET6
 



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:55:11 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: ChangeLog NEWS configure.ac

Log Message:
Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 othersrc/usr.bin/tnftp/ChangeLog
cvs rdiff -u -r1.13 -r1.14 othersrc/usr.bin/tnftp/NEWS
cvs rdiff -u -r1.35 -r1.36 othersrc/usr.bin/tnftp/configure.ac

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

Modified files:

Index: othersrc/usr.bin/tnftp/ChangeLog
diff -u othersrc/usr.bin/tnftp/ChangeLog:1.71 othersrc/usr.bin/tnftp/ChangeLog:1.72
--- othersrc/usr.bin/tnftp/ChangeLog:1.71	Sun Jul  5 10:18:19 2020
+++ othersrc/usr.bin/tnftp/ChangeLog	Sun Jul  5 10:55:11 2020
@@ -1,6 +1,8 @@
-$NetBSD: ChangeLog,v 1.71 2020/07/05 10:18:19 lukem Exp $
+$NetBSD: ChangeLog,v 1.72 2020/07/05 10:55:11 lukem Exp $
 
-Sun Jul  5 10:17:44 UTC 2020	lukem
+Sun Jul  5 10:51:50 UTC 2020	lukem
+
+	* Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.
 
 	* libnetbsd/snprintf.c: Rename static functions to avoid conflicts
 	  with standard names.

Index: othersrc/usr.bin/tnftp/NEWS
diff -u othersrc/usr.bin/tnftp/NEWS:1.13 othersrc/usr.bin/tnftp/NEWS:1.14
--- othersrc/usr.bin/tnftp/NEWS:1.13	Sun Jul  5 10:29:08 2020
+++ othersrc/usr.bin/tnftp/NEWS	Sun Jul  5 10:55:11 2020
@@ -1,4 +1,4 @@
-$NetBSD: NEWS,v 1.13 2020/07/05 10:29:08 lukem Exp $
+$NetBSD: NEWS,v 1.14 2020/07/05 10:55:11 lukem Exp $
 
 This is tnftp version (unreleased).
 
@@ -21,6 +21,8 @@ Changes in tnftp 20151004 to (unreleased
 
 	Improve SSL error reporting, and IPv6 endpoint reporting.
 
+	Use the system glob() if required extensions are supported.
+
 	Use the system libedit library by default, instead of
 	the local (embedded) libedit.
 

Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.35 othersrc/usr.bin/tnftp/configure.ac:1.36
--- othersrc/usr.bin/tnftp/configure.ac:1.35	Sun Jul  5 09:37:53 2020
+++ othersrc/usr.bin/tnftp/configure.ac	Sun Jul  5 10:55:11 2020
@@ -1,4 +1,4 @@
-#   $NetBSD: configure.ac,v 1.35 2020/07/05 09:37:53 lukem Exp $
+#   $NetBSD: configure.ac,v 1.36 2020/07/05 10:55:11 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.35 $])
+AC_REVISION([$Revision: 1.36 $])
 
 AS_SHELL_SANITIZE()
 
@@ -75,6 +75,8 @@ AH_TEMPLATE([HAVE___BUILTIN_VA_COPY],
 [Define to 1 if the '__builtin_va_copy' function is supported.])
 AH_TEMPLATE([NO_EDITCOMPLETE],
 [Define if disabling command-line editing and completion.])
+AH_TEMPLATE([USE_GLOB_H],
+[Define if using system  instead of local glob.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_SOCKS],
@@ -332,9 +334,22 @@ AC_CHECK_FUNCS([getcwd gethostbyaddr get
 AS_IF([test "$ac_cv_func_getpgrp" = yes], [AC_FUNC_GETPGRP])
 AS_IF([test "$ac_cv_func_strptime" = yes], [AC_CHECK_DECLS([strptime])])
 
-# Always replace glob(); the vendor's may not be secure.
+# Use system glob if GLOB_BRACE and GLOB_TILDE are available.
 #
-AC_LIBOBJ([glob])
+use_local_glob=yes
+AC_CHECK_HEADER([glob.h],
+[AC_MSG_CHECKING([glob supports required extensions])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include ]], [[
+int f = GLOB_BRACE | GLOB_TILDE;
+]])],
+ [AC_MSG_RESULT([yes])
+			  use_local_glob=no],
+ [AC_MSG_RESULT([no - using local version])],
+ [AC_MSG_RESULT([unknown - cross-compiling])])])
+AS_IF([test "$use_local_glob" = yes],
+  [AC_LIBOBJ([glob])],
+  [AC_DEFINE([USE_GLOB_H], [1])])
 
 # We assume that if sprintf() supports %lld or %qd,
 # then all of *printf() does. If not, disable long long



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:29:08 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: NEWS

Log Message:
NEWS: prepare for next release


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 othersrc/usr.bin/tnftp/NEWS

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

Modified files:

Index: othersrc/usr.bin/tnftp/NEWS
diff -u othersrc/usr.bin/tnftp/NEWS:1.12 othersrc/usr.bin/tnftp/NEWS:1.13
--- othersrc/usr.bin/tnftp/NEWS:1.12	Sun Oct  4 06:20:58 2015
+++ othersrc/usr.bin/tnftp/NEWS	Sun Jul  5 10:29:08 2020
@@ -1,6 +1,35 @@
-$NetBSD: NEWS,v 1.12 2015/10/04 06:20:58 lukem Exp $
+$NetBSD: NEWS,v 1.13 2020/07/05 10:29:08 lukem Exp $
 
-This is tnftp version 20151004.
+This is tnftp version (unreleased).
+
+Changes in tnftp 20151004 to (unreleased):
+
+	Avoid crashes by exiting if lostpeer due to a signal
+	(e.g., remote server disconnection).
+
+	Issue PWD commands to the server only when we actually
+	need the results, not speculatively, just in case we might.
+	Works around broken servers, and is quicker too.
+
+	Use "anonymous" instead of the local username for anonymous
+	ftp. Avoids unnecesary information leak.
+
+	Use the first name we requested the http/https URL for,
+	not any name we ended up with after random redirects.
+
+	Support using CONNECT for https:// via proxy.
+
+	Improve SSL error reporting, and IPv6 endpoint reporting.
+
+	Use the system libedit library by default, instead of
+	the local (embedded) libedit.
+
+	Update to NetBSD-ftp 20200608.
+
+	Update local (embedded) libedit to NetBSD as at 2020-07-04.
+	Fixes various crashes.
+
+	Portability improvements.
 
 Changes in tnftp 20141104 to 20151004:
 



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:19:32 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: Makefile.in configure tnftp_config.h.in
othersrc/usr.bin/tnftp/libedit: Makefile.in
othersrc/usr.bin/tnftp/src: Makefile.in

Log Message:
regen for --with-local-libedit


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 othersrc/usr.bin/tnftp/Makefile.in
cvs rdiff -u -r1.49 -r1.50 othersrc/usr.bin/tnftp/configure
cvs rdiff -u -r1.6 -r1.7 othersrc/usr.bin/tnftp/tnftp_config.h.in
cvs rdiff -u -r1.11 -r1.12 othersrc/usr.bin/tnftp/libedit/Makefile.in
cvs rdiff -u -r1.15 -r1.16 othersrc/usr.bin/tnftp/src/Makefile.in

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

Modified files:

Index: othersrc/usr.bin/tnftp/Makefile.in
diff -u othersrc/usr.bin/tnftp/Makefile.in:1.11 othersrc/usr.bin/tnftp/Makefile.in:1.12
--- othersrc/usr.bin/tnftp/Makefile.in:1.11	Sat Jul  4 14:59:16 2020
+++ othersrc/usr.bin/tnftp/Makefile.in	Sun Jul  5 10:19:31 2020
@@ -50,7 +50,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-@USE_LIBEDIT_TRUE@am__append_1 = libedit
+@WITH_LOCAL_LIBEDIT_TRUE@am__append_1 = libedit
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/tnftp_config.h.in \

Index: othersrc/usr.bin/tnftp/configure
diff -u othersrc/usr.bin/tnftp/configure:1.49 othersrc/usr.bin/tnftp/configure:1.50
--- othersrc/usr.bin/tnftp/configure:1.49	Sat Jul  4 14:59:16 2020
+++ othersrc/usr.bin/tnftp/configure	Sun Jul  5 10:19:31 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.34 .
+# From configure.ac Revision: 1.35 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for tnftp 20151004.
 #
@@ -642,11 +642,13 @@ ac_includes_default="\
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
-USE_LIBEDIT_FALSE
-USE_LIBEDIT_TRUE
-LIBOBJS
+WITH_LOCAL_LIBEDIT_FALSE
+WITH_LOCAL_LIBEDIT_TRUE
+OPT_EDITCOMPLETE_FALSE
+OPT_EDITCOMPLETE_TRUE
 WITH_SSL_FALSE
 WITH_SSL_TRUE
+LIBOBJS
 OPENSSL_LDFLAGS
 OPENSSL_LIBS
 OPENSSL_INCLUDES
@@ -774,6 +776,7 @@ enable_maintainer_mode
 enable_editcomplete
 enable_ipv6
 enable_ssl
+with_local_libedit
 with_socks
 enable_dependency_tracking
 enable_shared
@@ -1418,7 +1421,7 @@ Optional Features:
   --enable-maintainer-mode  enable make rules and dependencies not useful
 			  (and sometimes confusing) to the casual installer
   --enable-editcomplete   turn on command line editing and completion
-  [default=enabled]
+  (requires system or local libedit) [default=enabled]
   --enable-ipv6   enable IPv6 support (if your OS supports it)
   [default=enabled]
   --enable-sslenable SSL support (requires --with-openssl)
@@ -1435,6 +1438,9 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]use PACKAGE [ARG=yes]
   --without-PACKAGE   do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-local-libedituse local libedit instead of system library: yes;
+  auto (try system, fallback to local); no
+  [default=auto]
   --with-socksenable support for (Dante) SOCKS5 proxy
   [default=auto]
   --with-pic[=PKGS]   try to use only PIC/non-PIC objects [default=use
@@ -3185,6 +3191,14 @@ else
 fi
 
 
+# Check whether --with-local-libedit was given.
+if test "${with_local_libedit+set}" = set; then :
+  withval=$with_local_libedit;
+else
+  with_local_libedit=auto
+fi
+
+
 # Check whether --with-socks was given.
 if test "${with_socks+set}" = set; then :
   withval=$with_socks;
@@ -3205,6 +3219,7 @@ fi
 
 
 
+
 #
 # Checks for programs.
 #
@@ -11853,8 +11868,13 @@ esac
 #
 # Checks for libraries.
 #
+
+# Check if libedit is required, and which implementation.
+#
 if test "$opt_editcomplete" = yes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: --enable-editcomplete; checking for required features" >&5
+$as_echo "$as_me: --enable-editcomplete; checking for required features" >&6;}
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
 $as_echo_n "checking for library containing tgetent... " >&6; }
 if ${ac_cv_search_tgetent+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -11912,9 +11932,70 @@ else
   as_fn_error $? "no relevant library found containing tgetent" "$LINENO" 5
 fi
 
+   if test "$with_local_libedit" != yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_init in -ledit" >&5
+$as_echo_n "checking for el_init in -ledit... " >&6; }
+if ${ac_cv_lib_edit_el_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ledit  

CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:18:19 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: ChangeLog

Log Message:
today's changelog


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 othersrc/usr.bin/tnftp/ChangeLog

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

Modified files:

Index: othersrc/usr.bin/tnftp/ChangeLog
diff -u othersrc/usr.bin/tnftp/ChangeLog:1.70 othersrc/usr.bin/tnftp/ChangeLog:1.71
--- othersrc/usr.bin/tnftp/ChangeLog:1.70	Sat Jul  4 14:55:18 2020
+++ othersrc/usr.bin/tnftp/ChangeLog	Sun Jul  5 10:18:19 2020
@@ -1,4 +1,27 @@
-$NetBSD: ChangeLog,v 1.70 2020/07/04 14:55:18 lukem Exp $
+$NetBSD: ChangeLog,v 1.71 2020/07/05 10:18:19 lukem Exp $
+
+Sun Jul  5 10:17:44 UTC 2020	lukem
+
+	* libnetbsd/snprintf.c: Rename static functions to avoid conflicts
+	  with standard names.
+
+	* libnetbsd/glob.c: Improve glob():
+		* Update to NetBSD glob.c 1.38.
+		* Switch from a recursive pattern matching algorithm to handle
+		  '*' to a backtracking one. Avoids DoS attacks with patterns
+		  "a*a*a*a*a*...b" matching against "...".
+		  See https://research.swtch.com/glob
+		* Bump the glob limits to 512KB for total string size and 64KB
+		  path entries. The old limits were too small for some
+		  important FTP use cases like a pkgsrc repository.
+
+	* Remove 3rd (endorsement) clause from my BSD-derived licenses.
+
+	* configure.ac: Add --with-local-libedit=(yes|auto|no) to control
+	  which libedit implementation to use [default auto]:
+		  * yes - force local implementation
+		  * auto - try system library, fallback to local implementation
+		  * no - force system library and fail if not found
 
 Sat Jul  4 14:51:41 UTC 2020	lukem
 



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:08:59 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: snprintf.c

Log Message:
rename some static functions to avoid conflicts with standard names

(based on othersrc/libexec/tnftpd/libnetbsd/snprintf.c rev 1.6)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 othersrc/usr.bin/tnftp/libnetbsd/snprintf.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/snprintf.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/snprintf.c:1.6 othersrc/usr.bin/tnftp/libnetbsd/snprintf.c:1.7
--- othersrc/usr.bin/tnftp/libnetbsd/snprintf.c:1.6	Sun Jul 22 05:19:02 2007
+++ othersrc/usr.bin/tnftp/libnetbsd/snprintf.c	Sun Jul  5 10:08:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintf.c,v 1.6 2007/07/22 05:19:02 lukem Exp $	*/
+/* $NetBSD: snprintf.c,v 1.7 2020/07/05 10:08:59 lukem Exp $ */
 
 /*
  * Copyright Patrick Powell 1995
@@ -500,7 +500,7 @@ abs_val(LDOUBLE value)
 }
 
 static LDOUBLE
-pow10(int exp)
+sn_pow10(int exp)
 {
 	LDOUBLE	result = 1;
 
@@ -513,7 +513,7 @@ pow10(int exp)
 }
 
 static long
-round(LDOUBLE value)
+sn_round(LDOUBLE value)
 {
 	long	intpart;
 
@@ -569,11 +569,11 @@ fmtfp(char *buffer, size_t *currlen, siz
 
 	/* We "cheat" by converting the fractional part to integer by
 	 * multiplying by a factor of 10 */
-	fracpart = round((pow10(max)) * (ufvalue - intpart));
+	fracpart = sn_round((sn_pow10(max)) * (ufvalue - intpart));
 
-	if (fracpart >= pow10(max)) {
+	if (fracpart >= sn_pow10(max)) {
 		intpart++;
-		fracpart -= pow10(max);
+		fracpart -= sn_pow10(max);
 	}
 #ifdef DEBUG_SNPRINTF
 	printf("fmtfp: %g %d.%d min=%d max=%d\n",



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 10:03:09 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: glob.c

Log Message:
sync to NetBSD glob.c 1.38 (via tnftpd)

Update from NetBSD src/lib/libc/gen/glob.c 1.34 to 1.38
(using the version from othersrc/libexec/tnftpd/libnetbsd/glob.c):
- Minimize changes from upstream NetBSD source.
- 1.35: Use unsigned foo not u_FOO. [Already done]
- 1.36: Bump the glob limits to 512KB for total string size and 64K path
  entries. The old limits were too small for some important FTP use cases
  like a pkgsrc repository.
- 1.37: Switch from a recursive pattern matching algorithm to handle '*'
  to a backtracking one. Avoids DoS attacks with patterns "a*a*a*a*a*...b"
  matching against "..." https://research.swtch.com/glob
- 1.38: Use the symbolic M_ALL and trim with M_MASK.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 othersrc/usr.bin/tnftp/libnetbsd/glob.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/glob.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/glob.c:1.12 othersrc/usr.bin/tnftp/libnetbsd/glob.c:1.13
--- othersrc/usr.bin/tnftp/libnetbsd/glob.c:1.12	Mon May  5 00:20:45 2014
+++ othersrc/usr.bin/tnftp/libnetbsd/glob.c	Sun Jul  5 10:03:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: glob.c,v 1.12 2014/05/05 00:20:45 lukem Exp $	*/
+/*	$NetBSD: glob.c,v 1.13 2020/07/05 10:03:09 lukem Exp $	*/
 /*	from: NetBSD: glob.c,v 1.34 2013/02/21 18:17:43 christos Exp	*/
 
 /*
@@ -33,6 +33,19 @@
  * SUCH DAMAGE.
  */
 
+#if 0
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static char sccsid[] = "@(#)glob.c	8.3 (Berkeley) 10/13/93";
+#else
+__RCSID(" NetBSD: glob.c,v 1.38 2017/05/08 14:42:16 christos Exp ");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#endif
+
 /*
  * glob(3) -- a superset of the one defined in POSIX 1003.2.
  *
@@ -61,8 +74,17 @@
 
 #include "tnftp.h"
 
+#define NO_GETPW_R
+
+#undef	TILDE			/* XXX: AIX 4.1.5 has this in  */
+
+#ifndef __UNCONST
+#define __UNCONST(a)	((void *)(unsigned long)(const void *)(a))
+#endif
+
 #if 0
 
+#include "namespace.h"
 #include 
 #include 
 
@@ -70,6 +92,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,13 +100,15 @@
 #include 
 #include 
 
+#ifdef HAVE_NBTOOL_CONFIG_H
+#define NO_GETPW_R
 #endif
 
-#define NO_GETPW_R
+#endif
 
-#define	GLOB_LIMIT_STRING	65536	/* number of readdirs */
+#define	GLOB_LIMIT_STRING	524288	/* number of readdirs */
 #define	GLOB_LIMIT_STAT		128	/* number of stat system calls */
-#define	GLOB_LIMIT_READDIR	16384	/* total buffer size of path strings */
+#define	GLOB_LIMIT_READDIR	65536	/* total buffer size of path strings */
 #define	GLOB_LIMIT_PATH		1024	/* number of path elements */
 #define GLOB_LIMIT_BRACE	128	/* Number of brace calls */
 
@@ -94,8 +119,6 @@ struct glob_limit {
 	size_t l_brace;
 };
 
-#undef	TILDE			/* XXX: AIX 4.1.5 has this in  */
-
 /*
  * XXX: For NetBSD 1.4.x compatibility. (kill me l8r)
  */
@@ -176,8 +199,8 @@ static void	 qprintf(const char *, Char 
 #endif
 
 int
-glob(const char * pattern, int flags, int (*errfunc)(const char *,
-int), glob_t * pglob)
+glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *,
+int), glob_t * __restrict pglob)
 {
 	const unsigned char *patnext;
 	int c;
@@ -932,39 +955,45 @@ nospace:
 
 
 /*
- * pattern matching function for filenames.  Each occurrence of the *
- * pattern causes a recursion level.
+ * pattern matching function for filenames.
  */
 static int
 match(const Char *name, const Char *pat, const Char *patend)
 {
 	int ok, negate_range;
 	Char c, k;
+	const Char *patNext, *nameNext, *nameStart, *nameEnd;
 
 	_DIAGASSERT(name != NULL);
 	_DIAGASSERT(pat != NULL);
 	_DIAGASSERT(patend != NULL);
-
-	while (pat < patend) {
-		c = *pat++;
+	patNext = pat;
+	nameStart = nameNext = name;
+	nameEnd = NULL;
+
+	while (pat < patend || *name) {
+		c = *pat;
+		if (*name == EOS)
+			nameEnd = name;
 		switch (c & M_MASK) {
 		case M_ALL:
-			while (pat < patend && (*pat & M_MASK) == M_ALL)
-pat++;	/* eat consecutive '*' */
-			if (pat == patend)
-return 1;
-			for (; !match(name, pat, patend); name++)
-if (*name == EOS)
-	return 0;
-			return 1;
+			while ((pat[1] & M_MASK) == M_ALL) pat++;
+			patNext = pat;
+			nameNext = name + 1;
+			pat++;
+			continue;
 		case M_ONE:
-			if (*name++ == EOS)
-return 0;
-			break;
+			if (*name == EOS)
+break;
+			pat++;
+			name++;
+			continue;
 		case M_SET:
 			ok = 0;
-			if ((k = *name++) == EOS)
-return 0;
+			if ((k = *name) == EOS)
+break;
+			pat++;
+			name++;
 			if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
 ++pat;
 			while (((c = *pat++) & M_MASK) != M_END)
@@ -975,15 +1004,24 @@ match(const Char *name, const Char *pat,
 } else if (c == k)
 	ok = 1;
 			if (ok == 

CVS commit: src/sys/arch/sparc64/dev

2020-07-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul  5 09:55:08 UTC 2020

Modified Files:
src/sys/arch/sparc64/dev: ffb.c

Log Message:
Adapt to proplib api changes


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc64/dev/ffb.c

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

Modified files:

Index: src/sys/arch/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.64 src/sys/arch/sparc64/dev/ffb.c:1.65
--- src/sys/arch/sparc64/dev/ffb.c:1.64	Sun Dec 22 23:23:31 2019
+++ src/sys/arch/sparc64/dev/ffb.c	Sun Jul  5 09:55:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffb.c,v 1.64 2019/12/22 23:23:31 thorpej Exp $	*/
+/*	$NetBSD: ffb.c,v 1.65 2020/07/05 09:55:07 martin Exp $	*/
 /*	$OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.64 2019/12/22 23:23:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.65 2020/07/05 09:55:07 martin Exp $");
 
 #include 
 #include 
@@ -306,7 +306,7 @@ ffb_attach(device_t self)
 		if (ffb_debug)
 			edid_print(>sc_edid_info);
 
-		data = prop_data_create_data(sc->sc_edid_data, EDID_DATA_LEN);
+		data = prop_data_create_copy(sc->sc_edid_data, EDID_DATA_LEN);
 		prop_dictionary_set(device_properties(self), "EDID", data);
 		prop_object_release(data);
 



CVS commit: src/sys/arch/sparc64/sparc64

2020-07-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul  5 09:56:06 UTC 2020

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

Log Message:
Adapt to proplib api changes


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/arch/sparc64/sparc64/autoconf.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.220 src/sys/arch/sparc64/sparc64/autoconf.c:1.221
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.220	Sun Jul  5 09:27:11 2020
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sun Jul  5 09:56:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.220 2020/07/05 09:27:11 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.221 2020/07/05 09:56:06 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.220 2020/07/05 09:27:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.221 2020/07/05 09:56:06 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1413,7 +1413,7 @@ noether:
 			prop_dictionary_set_uint64(sens, "cookie", 0);
 			prop_dictionary_set_string(sens, "name",
 			"temperature-sensor");
-			data = prop_data_create_data(_lm[0],
+			data = prop_data_create_copy(_lm[0],
 			sizeof(name_lm));
 			prop_dictionary_set(sens, "compatible", data);
 			prop_object_release(data);



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 09:54:26 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: err.c fseeko.c

Log Message:
Remove the 3rd clause from my BSD-derived license.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/usr.bin/tnftp/libnetbsd/err.c
cvs rdiff -u -r1.4 -r1.5 othersrc/usr.bin/tnftp/libnetbsd/fseeko.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/err.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/err.c:1.5 othersrc/usr.bin/tnftp/libnetbsd/err.c:1.6
--- othersrc/usr.bin/tnftp/libnetbsd/err.c:1.5	Sun Jul  5 09:53:01 2020
+++ othersrc/usr.bin/tnftp/libnetbsd/err.c	Sun Jul  5 09:54:26 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: err.c,v 1.5 2020/07/05 09:53:01 lukem Exp $	*/
+/*	$NetBSD: err.c,v 1.6 2020/07/05 09:54:26 lukem Exp $	*/
 
 /*
- * Copyright 1997-2000 Luke Mewburn .
+ * Copyright 1997-2000,2020 Luke Mewburn .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -12,8 +12,6 @@
  * 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.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES

Index: othersrc/usr.bin/tnftp/libnetbsd/fseeko.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/fseeko.c:1.4 othersrc/usr.bin/tnftp/libnetbsd/fseeko.c:1.5
--- othersrc/usr.bin/tnftp/libnetbsd/fseeko.c:1.4	Wed May 11 01:01:56 2005
+++ othersrc/usr.bin/tnftp/libnetbsd/fseeko.c	Sun Jul  5 09:54:26 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: fseeko.c,v 1.4 2005/05/11 01:01:56 lukem Exp $	*/
+/*	$NetBSD: fseeko.c,v 1.5 2020/07/05 09:54:26 lukem Exp $	*/
 
 /*
- * Copyright 2002 Luke Mewburn .
+ * Copyright 2002,2020 Luke Mewburn .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -12,8 +12,6 @@
  * 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.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES



CVS commit: src/sys/dev/pci

2020-07-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul  5 09:53:54 UTC 2020

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

Log Message:
Adapt to proplib api changes


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.108 src/sys/dev/pci/radeonfb.c:1.109
--- src/sys/dev/pci/radeonfb.c:1.108	Thu Jun 11 07:51:26 2020
+++ src/sys/dev/pci/radeonfb.c	Sun Jul  5 09:53:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.108 2020/06/11 07:51:26 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.109 2020/07/05 09:53:54 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.108 2020/06/11 07:51:26 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.109 2020/07/05 09:53:54 martin Exp $");
 
 #include 
 #include 
@@ -1596,7 +1596,7 @@ radeonfb_getprop_num(struct radeonfb_sof
 		return defval;
 	}
 	KASSERT(prop_object_type(pn) == PROP_TYPE_NUMBER);
-	return (prop_number_integer_value(pn));
+	return prop_number_unsigned_value(pn);
 }
 
 int
@@ -1978,7 +1978,7 @@ nobios:
 		  sc->sc_dev), "EDID")) != NULL) {
 
 			aprint_debug_dev(sc->sc_dev, "using static EDID\n");
-			memcpy(edid, prop_data_data_nocopy(edid_data), 128);
+			memcpy(edid, prop_data_value(edid_data), 128);
 			if (edid_parse(edid, eip) == 0) {
 
 sc->sc_ports[i].rp_edid_valid = 1;



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 09:53:01 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: err.c

Log Message:
consistent tab indenting, not a mix of spaces and tabs


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/usr.bin/tnftp/libnetbsd/err.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/err.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/err.c:1.4 othersrc/usr.bin/tnftp/libnetbsd/err.c:1.5
--- othersrc/usr.bin/tnftp/libnetbsd/err.c:1.4	Wed May 11 01:01:56 2005
+++ othersrc/usr.bin/tnftp/libnetbsd/err.c	Sun Jul  5 09:53:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.4 2005/05/11 01:01:56 lukem Exp $	*/
+/*	$NetBSD: err.c,v 1.5 2020/07/05 09:53:01 lukem Exp $	*/
 
 /*
  * Copyright 1997-2000 Luke Mewburn .
@@ -32,61 +32,61 @@
 void
 err(int eval, const char *fmt, ...)
 {
-	va_list	ap;
-int	sverrno;
+	va_list ap;
+	int	sverrno;
 
 	sverrno = errno;
-(void)fprintf(stderr, "%s: ", getprogname());
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
-if (fmt != NULL) {
-(void)vfprintf(stderr, fmt, ap);
-(void)fprintf(stderr, ": ");
-}
+	if (fmt != NULL) {
+		(void)vfprintf(stderr, fmt, ap);
+		(void)fprintf(stderr, ": ");
+	}
 	va_end(ap);
-(void)fprintf(stderr, "%s\n", strerror(sverrno));
-exit(eval);
+	(void)fprintf(stderr, "%s\n", strerror(sverrno));
+	exit(eval);
 }
 
 void
 errx(int eval, const char *fmt, ...)
 {
-	va_list	ap;
+	va_list ap;
 
-(void)fprintf(stderr, "%s: ", getprogname());
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
-if (fmt != NULL)
-(void)vfprintf(stderr, fmt, ap);
+	if (fmt != NULL)
+		(void)vfprintf(stderr, fmt, ap);
 	va_end(ap);
-(void)fprintf(stderr, "\n");
-exit(eval);
+	(void)fprintf(stderr, "\n");
+	exit(eval);
 }
 
 void
 warn(const char *fmt, ...)
 {
-	va_list	ap;
-int	sverrno;
+	va_list ap;
+	int	sverrno;
 
 	sverrno = errno;
-(void)fprintf(stderr, "%s: ", getprogname());
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
-if (fmt != NULL) {
-(void)vfprintf(stderr, fmt, ap);
-(void)fprintf(stderr, ": ");
-}
+	if (fmt != NULL) {
+		(void)vfprintf(stderr, fmt, ap);
+		(void)fprintf(stderr, ": ");
+	}
 	va_end(ap);
-(void)fprintf(stderr, "%s\n", strerror(sverrno));
+	(void)fprintf(stderr, "%s\n", strerror(sverrno));
 }
 
 void
 warnx(const char *fmt, ...)
 {
-	va_list	ap;
+	va_list ap;
 
-(void)fprintf(stderr, "%s: ", getprogname());
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
-if (fmt != NULL)
-(void)vfprintf(stderr, fmt, ap);
+	if (fmt != NULL)
+		(void)vfprintf(stderr, fmt, ap);
 	va_end(ap);
-(void)fprintf(stderr, "\n");
+	(void)fprintf(stderr, "\n");
 }



CVS commit: othersrc/usr.bin/tnftp/libedit

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 09:43:42 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp/libedit: Makefile.am

Log Message:
libedit: distribute makelist

Need makelist in the distribution (tar file).
Style; explicitly list all files in TEST/


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/usr.bin/tnftp/libedit/Makefile.am

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

Modified files:

Index: othersrc/usr.bin/tnftp/libedit/Makefile.am
diff -u othersrc/usr.bin/tnftp/libedit/Makefile.am:1.5 othersrc/usr.bin/tnftp/libedit/Makefile.am:1.6
--- othersrc/usr.bin/tnftp/libedit/Makefile.am:1.5	Sat Jul  4 14:34:28 2020
+++ othersrc/usr.bin/tnftp/libedit/Makefile.am	Sun Jul  5 09:43:42 2020
@@ -1,4 +1,4 @@
-## $NetBSD: Makefile.am,v 1.5 2020/07/04 14:34:28 lukem Exp $
+## $NetBSD: Makefile.am,v 1.6 2020/07/05 09:43:42 lukem Exp $
 
 noinst_LTLIBRARIES = libedit.la
 
@@ -78,7 +78,10 @@ help.h: vi.c emacs.c common.c
 	$(AM_V_GEN)$(MAKELIST) -bh $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c > $@
 
 EXTRA_DIST = \
-	TEST \
+	TEST/rl1.c \
+	TEST/tc1.c \
+	TEST/test_filecompletion.c \
+	TEST/wtc1.c \
 	chared.h \
 	chartype.h \
 	config.h \
@@ -91,6 +94,7 @@ EXTRA_DIST = \
 	histedit.h \
 	keymacro.h \
 	literal.h \
+	makelist \
 	map.h \
 	parse.h \
 	prompt.h \



CVS commit: othersrc/usr.bin/tnftp

2020-07-05 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jul  5 09:37:53 UTC 2020

Modified Files:
othersrc/usr.bin/tnftp: Makefile.am configure.ac todo
othersrc/usr.bin/tnftp/src: Makefile.am

Log Message:
implement --with-local-libedit

Add --with-local-libedit=(yes|auto|no) to control which libedit
implementation to use:
- yes - force local implementation
- auto - try system library, fallback to local implementation. Default
- no - force system library and fail if not found

Define NO_EDITCOMPLETE as AH_TEMPLATE() instead of adding to CFLAGS.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/usr.bin/tnftp/Makefile.am
cvs rdiff -u -r1.34 -r1.35 othersrc/usr.bin/tnftp/configure.ac
cvs rdiff -u -r1.14 -r1.15 othersrc/usr.bin/tnftp/todo
cvs rdiff -u -r1.4 -r1.5 othersrc/usr.bin/tnftp/src/Makefile.am

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

Modified files:

Index: othersrc/usr.bin/tnftp/Makefile.am
diff -u othersrc/usr.bin/tnftp/Makefile.am:1.3 othersrc/usr.bin/tnftp/Makefile.am:1.4
--- othersrc/usr.bin/tnftp/Makefile.am:1.3	Sun May  5 13:06:37 2013
+++ othersrc/usr.bin/tnftp/Makefile.am	Sun Jul  5 09:37:53 2020
@@ -1,10 +1,10 @@
-## $NetBSD: Makefile.am,v 1.3 2013/05/05 13:06:37 lukem Exp $
+## $NetBSD: Makefile.am,v 1.4 2020/07/05 09:37:53 lukem Exp $
 
 ACLOCAL_AMFLAGS = -I buildaux
 
 SUBDIRS = libnetbsd
 
-if USE_LIBEDIT
+if WITH_LOCAL_LIBEDIT
 SUBDIRS += libedit
 endif
 

Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.34 othersrc/usr.bin/tnftp/configure.ac:1.35
--- othersrc/usr.bin/tnftp/configure.ac:1.34	Sun Jan 31 22:23:59 2016
+++ othersrc/usr.bin/tnftp/configure.ac	Sun Jul  5 09:37:53 2020
@@ -1,4 +1,4 @@
-#   $NetBSD: configure.ac,v 1.34 2016/01/31 22:23:59 lukem Exp $
+#   $NetBSD: configure.ac,v 1.35 2020/07/05 09:37:53 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.34 $])
+AC_REVISION([$Revision: 1.35 $])
 
 AS_SHELL_SANITIZE()
 
@@ -28,6 +28,7 @@ AM_MAINTAINER_MODE()
 AC_ARG_ENABLE([editcomplete],
   [AS_HELP_STRING([--enable-editcomplete],
   [turn on command line editing and completion
+   (requires system or local libedit)
[default=enabled]])],
   [opt_editcomplete=$enableval],
   [opt_editcomplete=yes])
@@ -43,6 +44,13 @@ AC_ARG_ENABLE([ssl],
[default=auto]])],
   [with_ssl=$enableval],
   [with_ssl=auto])
+AC_ARG_WITH([local-libedit],
+[AS_HELP_STRING([--with-local-libedit],
+[use local libedit instead of system library:
+ yes; auto (try system, fallback to local); no
+ [default=auto]])],
+[],
+[with_local_libedit=auto])
 AC_ARG_WITH([socks],
 [AS_HELP_STRING([--with-socks],
 [enable support for (Dante) SOCKS5 proxy
@@ -65,6 +73,8 @@ AH_TEMPLATE([HAVE_VA_COPY],
 [Define to 1 if the 'va_copy' function is supported.])
 AH_TEMPLATE([HAVE___BUILTIN_VA_COPY],
 [Define to 1 if the '__builtin_va_copy' function is supported.])
+AH_TEMPLATE([NO_EDITCOMPLETE],
+[Define if disabling command-line editing and completion.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_SOCKS],
@@ -99,14 +109,31 @@ AS_CASE([$target_os],
 #
 # Checks for libraries.
 #
+
+# Check if libedit is required, and which implementation.
+#
 AS_IF([test "$opt_editcomplete" = yes],
-  [AC_SEARCH_LIBS([tgetent],
+  [AC_MSG_NOTICE([--enable-editcomplete; checking for required features])
+   AC_SEARCH_LIBS([tgetent],
   [termcap termlib curses ncurses tinfo],
   [],
-  [AC_MSG_ERROR(
-   [no relevant library found containing tgetent])])
-   ])
+  [AC_MSG_ERROR([no relevant library found containing tgetent])])
+   AS_IF([test "$with_local_libedit" != yes],
+ [AC_CHECK_LIB([edit],
+   [el_init],
+   [AC_MSG_NOTICE([using system libedit])
+with_local_libedit=no],
+   [AS_IF([test "$with_local_libedit" = no],
+  [AC_MSG_ERROR([--without-local-libedit was given, but system libedit was not found])])
+AC_MSG_NOTICE([using local libedit])
+with_local_libedit=yes])],
+ [AC_MSG_NOTICE([using local libedit])])],
+  [AC_MSG_NOTICE([--disable-editcomplete; disabling 

CVS commit: src/sys/arch/sparc64/sparc64

2020-07-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul  5 09:27:11 UTC 2020

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

Log Message:
Adapt to proplib api changes


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/sparc64/sparc64/autoconf.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.219 src/sys/arch/sparc64/sparc64/autoconf.c:1.220
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.219	Fri Jun 12 03:32:30 2020
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sun Jul  5 09:27:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.220 2020/07/05 09:27:11 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.220 2020/07/05 09:27:11 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1050,7 +1050,7 @@ static void
 add_gpio_LED(prop_array_t pins, const char *name, int num, int act, int def)
 {
 	prop_dictionary_t pin = prop_dictionary_create();
-	prop_dictionary_set_cstring(pin, "name", name);
+	prop_dictionary_set_string(pin, "name", name);
 	prop_dictionary_set_uint32(pin, "type", 0);	/* 0 for LED, for now */
 	prop_dictionary_set_uint32(pin, "pin", num);
 	prop_dictionary_set_bool(pin, "active_high", act);
@@ -1106,7 +1106,7 @@ add_drivebay_props_v210(device_t dev, in
 		char name[16];
 
 		snprintf(name, sizeof(name), "bay%d", target);		
-		prop_dictionary_set_cstring(dict, "location", name);
+		prop_dictionary_set_string(dict, "location", name);
 	}
 }
 
@@ -1258,7 +1258,7 @@ device_register(device_t dev, void *aux)
 if (!prom_get_node_ether(ofnode, eaddr))
 	goto noether;
 			}
-			blob = prop_data_create_data(eaddr, ETHER_ADDR_LEN);
+			blob = prop_data_create_copy(eaddr, ETHER_ADDR_LEN);
 			prop_dictionary_set(dict, "mac-address", blob);
 			prop_object_release(blob);
 			of_to_dataprop(dict, ofnode, "shared-pins",
@@ -1357,7 +1357,7 @@ noether:
 			for (i = 0x50; i <= 0x51; i++) {
 prop_dictionary_t spd =
 prop_dictionary_create();
-prop_dictionary_set_cstring(spd, "name",
+prop_dictionary_set_string(spd, "name",
 "dimm-spd");
 prop_dictionary_set_uint32(spd, "addr", i);
 prop_dictionary_set_uint64(spd, "cookie", 0);
@@ -1398,9 +1398,9 @@ noether:
 			sens = prop_dictionary_create();
 			prop_dictionary_set_uint32(sens, "addr", 0x2e);
 			prop_dictionary_set_uint64(sens, "cookie", 0);
-			prop_dictionary_set_cstring(sens, "name",
+			prop_dictionary_set_string(sens, "name",
 			"hardware-monitor");
-			data = prop_data_create_data(_adm[0],
+			data = prop_data_create_copy(_adm[0],
 			sizeof(name_adm));
 			prop_dictionary_set(sens, "compatible", data);
 			prop_object_release(data);
@@ -1411,7 +1411,7 @@ noether:
 			sens = prop_dictionary_create();
 			prop_dictionary_set_uint32(sens, "addr", 0x4e);
 			prop_dictionary_set_uint64(sens, "cookie", 0);
-			prop_dictionary_set_cstring(sens, "name",
+			prop_dictionary_set_string(sens, "name",
 			"temperature-sensor");
 			data = prop_data_create_data(_lm[0],
 			sizeof(name_lm));
@@ -1669,7 +1669,7 @@ copyprops(device_t busdev, int node, pro
 	pos = strstr(output_device, ":r");
 	if (pos == NULL)
 		return;
-	prop_dictionary_set_cstring(dict, "videomode", pos + 2);
+	prop_dictionary_set_string(dict, "videomode", pos + 2);
 }
 
 static void



CVS commit: src/sys/dev/pci

2020-07-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul  5 09:23:42 UTC 2020

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

Log Message:
Adapt to proplib interface changes


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/machfb.c

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

Modified files:

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.98 src/sys/dev/pci/machfb.c:1.99
--- src/sys/dev/pci/machfb.c:1.98	Sat Dec  7 01:00:40 2019
+++ src/sys/dev/pci/machfb.c	Sun Jul  5 09:23:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.98 2019/12/07 01:00:40 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.99 2020/07/05 09:23:42 martin Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include 
 __KERNEL_RCSID(0,
-	"$NetBSD: machfb.c,v 1.98 2019/12/07 01:00:40 macallan Exp $");
+	"$NetBSD: machfb.c,v 1.99 2020/07/05 09:23:42 martin Exp $");
 
 #include 
 #include 
@@ -517,7 +517,7 @@ mach64_attach(device_t parent, device_t 
 
 		sc->sc_edid_size = uimin(1024, prop_data_size(edid_data));
 		memset(sc->sc_edid_data, 0, sizeof(sc->sc_edid_data));
-		memcpy(sc->sc_edid_data, prop_data_data_nocopy(edid_data),
+		memcpy(sc->sc_edid_data, prop_data_value(edid_data),
 		sc->sc_edid_size);
 
 		edid_parse(sc->sc_edid_data, >sc_ei);