CVS commit: src/usr.sbin/sysinst

2024-06-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 20 19:00:35 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de

Log Message:
sysinst: fix umlaut in German translation


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/msg.mi.de

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/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.49 src/usr.sbin/sysinst/msg.mi.de:1.50
--- src/usr.sbin/sysinst/msg.mi.de:1.49	Thu Jun 20 05:46:22 2024
+++ src/usr.sbin/sysinst/msg.mi.de	Thu Jun 20 19:00:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.49 2024/06/20 05:46:22 nia Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.50 2024/06/20 19:00:35 rillig Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -643,7 +643,7 @@ message net_defroute
 {IPv4-Gateway}
 
 message net_media
-{Art der Netzwerkverbindung (fuer Automatik leer lassen)}
+{Art der Netzwerkverbindung (für Automatik leer lassen)}
 
 message net_ssid
 {WLAN-SSID?}



CVS commit: src/usr.sbin/sysinst

2024-06-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 20 19:00:35 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de

Log Message:
sysinst: fix umlaut in German translation


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/msg.mi.de

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



CVS commit: src/usr.sbin/sysinst

2024-06-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 20 05:46:22 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en

Log Message:
sysinst(8): Note that leaving the network "media type" empty autoconfigures


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/msg.mi.en

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/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.48 src/usr.sbin/sysinst/msg.mi.de:1.49
--- src/usr.sbin/sysinst/msg.mi.de:1.48	Thu Apr 25 11:25:08 2024
+++ src/usr.sbin/sysinst/msg.mi.de	Thu Jun 20 05:46:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.48 2024/04/25 11:25:08 hannken Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.49 2024/06/20 05:46:22 nia Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -643,7 +643,7 @@ message net_defroute
 {IPv4-Gateway}
 
 message net_media
-{Art der Netzwerkverbindung}
+{Art der Netzwerkverbindung (fuer Automatik leer lassen)}
 
 message net_ssid
 {WLAN-SSID?}

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.51 src/usr.sbin/sysinst/msg.mi.en:1.52
--- src/usr.sbin/sysinst/msg.mi.en:1.51	Thu Apr 25 11:25:08 2024
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Jun 20 05:46:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.51 2024/04/25 11:25:08 hannken Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.52 2024/06/20 05:46:22 nia Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -618,7 +618,7 @@ message net_defroute
 {IPv4 gateway}
 
 message net_media
-{Network media type}
+{Network media type (empty to autoconfigure)}
 
 message net_ssid
 {Wi-Fi SSID?}



CVS commit: src/usr.sbin/sysinst

2024-06-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 20 05:46:22 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en

Log Message:
sysinst(8): Note that leaving the network "media type" empty autoconfigures


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/msg.mi.en

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



CVS commit: src/usr.sbin/makefs

2024-06-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 17 23:53:42 UTC 2024

Modified Files:
src/usr.sbin/makefs: ffs.c

Log Message:
makefs(8): Fix format string for newly 64-bit target inode numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/usr.sbin/makefs/ffs.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/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.75 src/usr.sbin/makefs/ffs.c:1.76
--- src/usr.sbin/makefs/ffs.c:1.75	Thu Dec 28 12:13:55 2023
+++ src/usr.sbin/makefs/ffs.c	Mon Jun 17 23:53:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.75 2023/12/28 12:13:55 tsutsui Exp $	*/
+/*	$NetBSD: ffs.c,v 1.76 2024/06/17 23:53:42 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.75 2023/12/28 12:13:55 tsutsui Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.76 2024/06/17 23:53:42 riastradh Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -826,8 +826,8 @@ ffs_populate_dir(const char *dir, fsnode
 			root, fsopts);
 
 		if (debug & DEBUG_FS_POPULATE_NODE) {
-			printf("ffs_populate_dir: writing ino %d, %s",
-			cur->inode->ino, inode_type(cur->type));
+			printf("ffs_populate_dir: writing ino %lld, %s",
+			(long long)cur->inode->ino, inode_type(cur->type));
 			if (cur->inode->nlink > 1)
 printf(", nlink %d", cur->inode->nlink);
 			putchar('\n');



CVS commit: src/usr.sbin/makefs

2024-06-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 17 23:53:42 UTC 2024

Modified Files:
src/usr.sbin/makefs: ffs.c

Log Message:
makefs(8): Fix format string for newly 64-bit target inode numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/usr.sbin/makefs/ffs.c

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



CVS commit: src/usr.sbin/makefs

2024-06-17 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon Jun 17 20:22:20 UTC 2024

Modified Files:
src/usr.sbin/makefs: makefs.h

Log Message:
Bump inode number on target FS from 32 bits to 64 bits


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/makefs/makefs.h

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



CVS commit: src/usr.sbin/makefs

2024-06-17 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon Jun 17 20:22:20 UTC 2024

Modified Files:
src/usr.sbin/makefs: makefs.h

Log Message:
Bump inode number on target FS from 32 bits to 64 bits


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/makefs/makefs.h

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/makefs/makefs.h
diff -u src/usr.sbin/makefs/makefs.h:1.41 src/usr.sbin/makefs/makefs.h:1.42
--- src/usr.sbin/makefs/makefs.h:1.41	Sun Feb 18 16:59:16 2024
+++ src/usr.sbin/makefs/makefs.h	Mon Jun 17 20:22:20 2024
@@ -89,7 +89,7 @@ enum fi_flags {
 };
 
 typedef struct {
-	uint32_t	 ino;		/* inode number used on target fs */
+	uint64_t	 ino;		/* inode number used on target fs */
 	uint32_t	 nlink;		/* number of links to this entry */
 	enum fi_flags	 flags;		/* flags used by fs specific code */
 	struct stat	 st;		/* stat entry */



CVS commit: src/usr.sbin/makefs/cd9660

2024-06-17 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon Jun 17 13:31:17 UTC 2024

Modified Files:
src/usr.sbin/makefs/cd9660: cd9660_conversion.c

Log Message:
We know the target string buffer only needs 18 but gcc can't figure this out.
Fixes compiling with -Werror=format-truncation


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/cd9660/cd9660_conversion.c

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



CVS commit: src/usr.sbin/makefs/cd9660

2024-06-17 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Mon Jun 17 13:31:17 UTC 2024

Modified Files:
src/usr.sbin/makefs/cd9660: cd9660_conversion.c

Log Message:
We know the target string buffer only needs 18 but gcc can't figure this out.
Fixes compiling with -Werror=format-truncation


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/cd9660/cd9660_conversion.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/makefs/cd9660/cd9660_conversion.c
diff -u src/usr.sbin/makefs/cd9660/cd9660_conversion.c:1.5 src/usr.sbin/makefs/cd9660/cd9660_conversion.c:1.6
--- src/usr.sbin/makefs/cd9660/cd9660_conversion.c:1.5	Wed Feb  8 21:33:12 2017
+++ src/usr.sbin/makefs/cd9660/cd9660_conversion.c	Mon Jun 17 13:31:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_conversion.c,v 1.5 2017/02/08 21:33:12 christos Exp $	*/
+/*	$NetBSD: cd9660_conversion.c,v 1.6 2024/06/17 13:31:17 reinoud Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_conversion.c,v 1.5 2017/02/08 21:33:12 christos Exp $");
+__RCSID("$NetBSD: cd9660_conversion.c,v 1.6 2024/06/17 13:31:17 reinoud Exp $");
 #endif  /* !__lint */
 
 
@@ -174,7 +174,7 @@ void
 cd9660_time_8426(unsigned char *buf, time_t tim)
 {
 	struct tm t;
-	char temp[18];
+	char temp[70];	/* we know its only 18 but gcc can't figure this out */
 
 	if (stampst.st_ino)
 		(void)gmtime_r(, );



CVS commit: src/usr.sbin

2024-06-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jun  7 09:57:09 UTC 2024

Modified Files:
src/usr.sbin/envstat: prog_ops.h
src/usr.sbin/powerd: prog_ops.h
src/usr.sbin/traceroute: prog_ops.h

Log Message:
envstat(8), powerd(8), traceroute(8): Add support to CRUNCHOPS

Now, all rump-fied programs can be built as crunched binaries.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/envstat/prog_ops.h
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/powerd/prog_ops.h
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/traceroute/prog_ops.h

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/envstat/prog_ops.h
diff -u src/usr.sbin/envstat/prog_ops.h:1.2 src/usr.sbin/envstat/prog_ops.h:1.3
--- src/usr.sbin/envstat/prog_ops.h:1.2	Wed Dec 15 15:07:54 2010
+++ src/usr.sbin/envstat/prog_ops.h	Fri Jun  7 09:57:09 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.2 2010/12/15 15:07:54 pooka Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.3 2024/06/07 09:57:09 rin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,6 +31,8 @@
 
 #include 
 
+#ifndef CRUNCHOPS
+
 struct prog_ops {
 	int (*op_init)(void);
 
@@ -43,4 +45,12 @@ extern const struct prog_ops prog_ops;
 #define prog_open prog_ops.op_open
 #define prog_close prog_ops.op_close
 
+#else
+
+#define prog_init ((int (*)(void))NULL)
+#define prog_open open
+#define prog_close close
+
+#endif /* CRUNCHOPS */
+
 #endif /* _PROG_OPS_H_ */

Index: src/usr.sbin/powerd/prog_ops.h
diff -u src/usr.sbin/powerd/prog_ops.h:1.1 src/usr.sbin/powerd/prog_ops.h:1.2
--- src/usr.sbin/powerd/prog_ops.h:1.1	Sun Dec 19 22:52:08 2010
+++ src/usr.sbin/powerd/prog_ops.h	Fri Jun  7 09:57:09 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.1 2010/12/19 22:52:08 pgoyette Exp $ */
+/*  $NetBSD: prog_ops.h,v 1.2 2024/06/07 09:57:09 rin Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -33,6 +33,8 @@
 #include 
 #include 
 
+#ifndef CRUNCHOPS
+
 struct prog_ops {
 	int (*op_init)(void);
 
@@ -56,4 +58,17 @@ extern const struct prog_ops prog_ops;
 #define prog_fcntl prog_ops.op_fcntl
 #define prog_kqueue prog_ops.op_kqueue
 
+#else
+
+#define prog_init ((int (*)(void))NULL)
+#define prog_open open
+#define prog_close close
+#define prog_read read
+#define prog_kevent kevent
+#define prog_ioctl ioctl
+#define prog_fcntl fcntl
+#define prog_kqueue kqueue
+
+#endif /* CRUNCHOPS */
+
 #endif /* _PROG_OPS_H_ */

Index: src/usr.sbin/traceroute/prog_ops.h
diff -u src/usr.sbin/traceroute/prog_ops.h:1.2 src/usr.sbin/traceroute/prog_ops.h:1.3
--- src/usr.sbin/traceroute/prog_ops.h:1.2	Sun Aug 18 04:12:07 2019
+++ src/usr.sbin/traceroute/prog_ops.h	Fri Jun  7 09:57:09 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.2 2019/08/18 04:12:07 kamil Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.3 2024/06/07 09:57:09 rin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,6 +34,8 @@
 #include 
 #include 
 
+#ifndef CRUNCHOPS
+
 struct prog_ops {
 	int (*op_init)(void);
 
@@ -75,4 +77,21 @@ extern const struct prog_ops prog_ops;
 #define prog_sysctl prog_ops.op_sysctl
 #define prog_getifaddrs prog_ops.op_getifaddrs
 
+#else
+
+#define prog_init ((int (*)(void))NULL)
+#define prog_socket socket
+#define prog_setsockopt setsockopt
+#define prog_shutdown shutdown
+#define prog_poll poll
+#define prog_recvfrom recvfrom
+#define prog_sendto sendto
+#define prog_close close
+#define prog_connect connect
+#define prog_getsockname getsockname
+#define prog_sysctl sysctl
+#define prog_getifaddrs getifaddrs
+
+#endif /* CRUNCHOPS */
+
 #endif /* _PROG_OPS_H_ */



CVS commit: src/usr.sbin

2024-06-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jun  7 09:57:09 UTC 2024

Modified Files:
src/usr.sbin/envstat: prog_ops.h
src/usr.sbin/powerd: prog_ops.h
src/usr.sbin/traceroute: prog_ops.h

Log Message:
envstat(8), powerd(8), traceroute(8): Add support to CRUNCHOPS

Now, all rump-fied programs can be built as crunched binaries.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/envstat/prog_ops.h
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/powerd/prog_ops.h
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/traceroute/prog_ops.h

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



CVS commit: src/usr.sbin/btpand

2024-06-04 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Jun  4 06:24:58 UTC 2024

Modified Files:
src/usr.sbin/btpand: btpand.c

Log Message:
Fix off-by-one bug in btpand

`ul` reaches `__arraycount(services)` before the bound-check happens, causing 
undefined behaviour.

from Dapeng Gao  via FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btpand/btpand.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/btpand/btpand.c
diff -u src/usr.sbin/btpand/btpand.c:1.8 src/usr.sbin/btpand/btpand.c:1.9
--- src/usr.sbin/btpand/btpand.c:1.8	Wed May 18 13:56:32 2022
+++ src/usr.sbin/btpand/btpand.c	Tue Jun  4 06:24:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: btpand.c,v 1.8 2022/05/18 13:56:32 andvar Exp $	*/
+/*	$NetBSD: btpand.c,v 1.9 2024/06/04 06:24:58 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2008-2009 Iain Hibbert
@@ -27,7 +27,7 @@
 
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008-2009 Iain Hibbert. All rights reserved.");
-__RCSID("$NetBSD: btpand.c,v 1.8 2022/05/18 13:56:32 andvar Exp $");
+__RCSID("$NetBSD: btpand.c,v 1.9 2024/06/04 06:24:58 plunky Exp $");
 
 #include 
 
@@ -155,11 +155,14 @@ main(int argc, char *argv[])
 
 		case 's': /* service */
 		case 'S': /* service (no SDP) */
-			for (ul = 0; strcasecmp(optarg, services[ul].type); ul++) {
-if (ul == __arraycount(services))
-	errx(EXIT_FAILURE, "%s: unknown service", optarg);
+			for (ul = 0; ul < __arraycount(services); ul++) {
+if (strcasecmp(optarg, services[ul].type) == 0)
+	break;
 			}
 
+			if (ul == __arraycount(services))
+errx(EXIT_FAILURE, "%s: unknown service", optarg);
+
 			if (ch == 's') {
 service_type = services[ul].type;
 service_name = services[ul].name;



CVS commit: src/usr.sbin/btpand

2024-06-04 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Jun  4 06:24:58 UTC 2024

Modified Files:
src/usr.sbin/btpand: btpand.c

Log Message:
Fix off-by-one bug in btpand

`ul` reaches `__arraycount(services)` before the bound-check happens, causing 
undefined behaviour.

from Dapeng Gao  via FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btpand/btpand.c

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



CVS commit: src/usr.sbin/installboot

2024-06-01 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sat Jun  1 20:19:42 UTC 2024

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

Log Message:
installboot.8: reflect current evbmips support


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/usr.sbin/installboot/installboot.8

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

Modified files:

Index: src/usr.sbin/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.109 src/usr.sbin/installboot/installboot.8:1.110
--- src/usr.sbin/installboot/installboot.8:1.109	Sun May 19 15:48:57 2024
+++ src/usr.sbin/installboot/installboot.8	Sat Jun  1 20:19:41 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: installboot.8,v 1.109 2024/05/19 15:48:57 tsutsui Exp $
+.\"	$NetBSD: installboot.8,v 1.110 2024/06/01 20:19:41 gutteridge Exp $
 .\"
 .\" Copyright (c) 2002-2023 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\" Usage: \*(UB
 .ds UB U\(hyBoot
 .
-.Dd May 19, 2024
+.Dd June 1, 2024
 .Dt INSTALLBOOT 8
 .Os
 .Sh NAME
@@ -725,6 +725,9 @@ SiByte/Broadcom
 and
 .Tn BCM1480
 CPUs.
+There is also
+\*(UB support for the
+.Tn Creator CI20 .
 .Bl -tag -width Pa
 .
 .It Pa /usr/mdec/sbmips/boot
@@ -742,10 +745,9 @@ primary bootstrap for LFSv1 and LFSv2 fi
 .It Pa /usr/mdec/sbmips/netboot
 .Tn SBMIPS
 primary bootstrap for network root.
-.Pp
-Note that
-.Nm
-does not currently support evbmips directly.
+.It Pa /usr/share/installboot/evbmips/boards.plist
+Base board database, used to provide information about which
+\*(UB package is required for a given board.
 .
 .El
 .



CVS commit: src/usr.sbin/installboot

2024-06-01 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sat Jun  1 20:19:42 UTC 2024

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

Log Message:
installboot.8: reflect current evbmips support


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/usr.sbin/installboot/installboot.8

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



CVS commit: src/usr.sbin/inetd

2024-05-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 24 21:55:13 UTC 2024

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

Log Message:
s/SO_ACCEPTFITLER/SO_ACCEPTFILTER/.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.sbin/inetd/inetd.8

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

Modified files:

Index: src/usr.sbin/inetd/inetd.8
diff -u src/usr.sbin/inetd/inetd.8:1.67 src/usr.sbin/inetd/inetd.8:1.68
--- src/usr.sbin/inetd/inetd.8:1.67	Tue Oct 12 22:47:18 2021
+++ src/usr.sbin/inetd/inetd.8	Fri May 24 21:55:13 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inetd.8,v 1.67 2021/10/12 22:47:18 rillig Exp $
+.\"	$NetBSD: inetd.8,v 1.68 2024/05/24 21:55:13 andvar Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -481,7 +481,7 @@ An accept filter, equivalent to
 in positional notation (see
 .Xr accept_filter 9
 and
-.Dv SO_ACCEPTFITLER
+.Dv SO_ACCEPTFILTER
 in
 .Xr setsockopt 2 ) .
 .It Sy protocol



CVS commit: src/usr.sbin/inetd

2024-05-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 24 21:55:13 UTC 2024

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

Log Message:
s/SO_ACCEPTFITLER/SO_ACCEPTFILTER/.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.sbin/inetd/inetd.8

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



CVS commit: src/usr.sbin/installboot

2024-05-24 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri May 24 09:59:42 UTC 2024

Modified Files:
src/usr.sbin/installboot: cd9660.c

Log Message:
Fix tools build errors on Cygwin.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/installboot/cd9660.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/installboot/cd9660.c
diff -u src/usr.sbin/installboot/cd9660.c:1.1 src/usr.sbin/installboot/cd9660.c:1.2
--- src/usr.sbin/installboot/cd9660.c:1.1	Sun May 19 15:48:57 2024
+++ src/usr.sbin/installboot/cd9660.c	Fri May 24 09:59:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.1 2024/05/19 15:48:57 tsutsui Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.2 2024/05/24 09:59:42 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2005 Izumi Tsutsui.  All rights reserved.
@@ -30,7 +30,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660.c,v 1.1 2024/05/19 15:48:57 tsutsui Exp $");
+__RCSID("$NetBSD: cd9660.c,v 1.2 2024/05/24 09:59:42 tsutsui Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -38,6 +38,9 @@ __RCSID("$NetBSD: cd9660.c,v 1.1 2024/05
 #if !HAVE_NBTOOL_CONFIG_H
 #include 
 #endif
+#if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
+#include 
+#endif
 
 #include 
 #include 



CVS commit: src/usr.sbin/installboot

2024-05-24 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri May 24 09:59:42 UTC 2024

Modified Files:
src/usr.sbin/installboot: cd9660.c

Log Message:
Fix tools build errors on Cygwin.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/installboot/cd9660.c

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



CVS commit: src/usr.sbin/installboot

2024-05-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed May 22 15:42:42 UTC 2024

Modified Files:
src/usr.sbin/installboot: Makefile installboot.h machines.c
Removed Files:
src/usr.sbin/installboot/arch: emips.c

Log Message:
Remove no-op emips stuff.

It seems blindly copied and modified from pmax, but emips bootloader
can be specified by "Ml40x_2ace.plx" config file on the Giano simulator.
(not sure what on the real Xilinx ML401 board, but maybe hardcoded)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/installboot/Makefile
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/installboot/installboot.h
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/installboot/machines.c
cvs rdiff -u -r1.2 -r0 src/usr.sbin/installboot/arch/emips.c

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



CVS commit: src/usr.sbin/installboot

2024-05-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed May 22 15:42:42 UTC 2024

Modified Files:
src/usr.sbin/installboot: Makefile installboot.h machines.c
Removed Files:
src/usr.sbin/installboot/arch: emips.c

Log Message:
Remove no-op emips stuff.

It seems blindly copied and modified from pmax, but emips bootloader
can be specified by "Ml40x_2ace.plx" config file on the Giano simulator.
(not sure what on the real Xilinx ML401 board, but maybe hardcoded)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/installboot/Makefile
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/installboot/installboot.h
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/installboot/machines.c
cvs rdiff -u -r1.2 -r0 src/usr.sbin/installboot/arch/emips.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/installboot/Makefile
diff -u src/usr.sbin/installboot/Makefile:1.59 src/usr.sbin/installboot/Makefile:1.60
--- src/usr.sbin/installboot/Makefile:1.59	Sun May 19 15:48:57 2024
+++ src/usr.sbin/installboot/Makefile	Wed May 22 15:42:42 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.59 2024/05/19 15:48:57 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.60 2024/05/22 15:42:42 tsutsui Exp $
 #
 
 .include 
@@ -12,7 +12,7 @@ ARCH_XLAT+= sun2-sun68k.c sun3-sun68k.c
 
 .if !defined(SMALLPROG) && !defined(ARCH_FILES)
 ARCH_FILES=  alpha.c amiga.c
-ARCH_FILES+= emips.c evbarm.c evbmips.c ews4800mips.c
+ARCH_FILES+= evbarm.c evbmips.c ews4800mips.c
 ARCH_FILES+= hp300.c hppa.c
 ARCH_FILES+= i386.c
 ARCH_FILES+= landisk.c

Index: src/usr.sbin/installboot/installboot.h
diff -u src/usr.sbin/installboot/installboot.h:1.45 src/usr.sbin/installboot/installboot.h:1.46
--- src/usr.sbin/installboot/installboot.h:1.45	Sun May 19 15:48:57 2024
+++ src/usr.sbin/installboot/installboot.h	Wed May 22 15:42:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.h,v 1.45 2024/05/19 15:48:57 tsutsui Exp $	*/
+/*	$NetBSD: installboot.h,v 1.46 2024/05/22 15:42:42 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -193,7 +193,6 @@ int		raw_findstage2(ib_params *, uint32_
 extern struct ib_mach ib_mach_alpha;
 extern struct ib_mach ib_mach_amd64;
 extern struct ib_mach ib_mach_amiga;
-extern struct ib_mach ib_mach_emips;
 extern struct ib_mach ib_mach_evbarm;
 extern struct ib_mach ib_mach_evbmips;
 extern struct ib_mach ib_mach_ews4800mips;

Index: src/usr.sbin/installboot/machines.c
diff -u src/usr.sbin/installboot/machines.c:1.43 src/usr.sbin/installboot/machines.c:1.44
--- src/usr.sbin/installboot/machines.c:1.43	Sun Jun 21 17:17:02 2020
+++ src/usr.sbin/installboot/machines.c	Wed May 22 15:42:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machines.c,v 1.43 2020/06/21 17:17:02 thorpej Exp $	*/
+/*	$NetBSD: machines.c,v 1.44 2024/05/22 15:42:42 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if !defined(__lint)
-__RCSID("$NetBSD: machines.c,v 1.43 2020/06/21 17:17:02 thorpej Exp $");
+__RCSID("$NetBSD: machines.c,v 1.44 2024/05/22 15:42:42 tsutsui Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -48,7 +48,6 @@ struct ib_mach * const machines[] = {
 _mach_alpha,
 _mach_amd64,
 _mach_amiga,
-_mach_emips,
 _mach_evbarm,
 _mach_evbmips,
 _mach_ews4800mips,



CVS commit: src/usr.sbin/installboot

2024-05-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 19 15:48:58 UTC 2024

Modified Files:
src/usr.sbin/installboot: Makefile fstypes.c installboot.8
installboot.h
src/usr.sbin/installboot/arch: hp300.c
Added Files:
src/usr.sbin/installboot: cd9660.c

Log Message:
Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/installboot/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/installboot/cd9660.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/fstypes.c
cvs rdiff -u -r1.108 -r1.109 src/usr.sbin/installboot/installboot.8
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/installboot/installboot.h
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/installboot/arch/hp300.c

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



CVS commit: src/usr.sbin/installboot

2024-05-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 19 15:48:58 UTC 2024

Modified Files:
src/usr.sbin/installboot: Makefile fstypes.c installboot.8
installboot.h
src/usr.sbin/installboot/arch: hp300.c
Added Files:
src/usr.sbin/installboot: cd9660.c

Log Message:
Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/installboot/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/installboot/cd9660.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/fstypes.c
cvs rdiff -u -r1.108 -r1.109 src/usr.sbin/installboot/installboot.8
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/installboot/installboot.h
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/installboot/arch/hp300.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/installboot/Makefile
diff -u src/usr.sbin/installboot/Makefile:1.58 src/usr.sbin/installboot/Makefile:1.59
--- src/usr.sbin/installboot/Makefile:1.58	Sat Jun  3 21:26:29 2023
+++ src/usr.sbin/installboot/Makefile	Sun May 19 15:48:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.58 2023/06/03 21:26:29 lukem Exp $
+#	$NetBSD: Makefile,v 1.59 2024/05/19 15:48:57 tsutsui Exp $
 #
 
 .include 
@@ -69,9 +69,31 @@ SRCS+= ffs_bswap.c
 #SRCS+= ext2fs.c ext2fs_bswap.c
 .endif
 
+.if !empty(ARCH_FILES:C/(hp300|macppc)/cd9660/:Mcd9660.c) && \
+!defined(SMALLPROG)
+CPPFLAGS+=	-DSUPPORT_CD9660
+SRCS+= cd9660.c cd9660_util.c
+
+.if !make(obj) && !make(clean) && !make(cleandir)
+.BEGIN:
+	-rm -rf fs
+	${HOST_INSTALL_DIR} fs
+	${HOST_INSTALL_DIR} fs/cd9660
+	${HOST_LN} -s ${NETBSDSRCDIR}/sys/fs/unicode.h fs
+	${HOST_LN} -s ${NETBSDSRCDIR}/sys/fs/cd9660/iso.h fs/cd9660
+	${HOST_LN} -s ${NETBSDSRCDIR}/sys/fs/cd9660/cd9660_extern.h fs/cd9660
+.endif
+
+cleandir distclean: cleaninc
+
+cleaninc:
+	-rm -rf fs
+.endif
+
 UFSSRC=		${NETBSDSRCDIR}/sys/ufs
+CD9660SRC=	${NETBSDSRCDIR}/sys/fs/cd9660
 CPPFLAGS+=	-I${.CURDIR} -I.
-.PATH:		${.CURDIR}/arch ${UFSSRC}/ffs ${UFSSRC}/ext2fs
+.PATH:		${.CURDIR}/arch ${UFSSRC}/ffs ${UFSSRC}/ext2fs ${CD9660SRC}
 
 .if !defined(HOSTPROGNAME)
 .for f in i386 macppc

Index: src/usr.sbin/installboot/fstypes.c
diff -u src/usr.sbin/installboot/fstypes.c:1.13 src/usr.sbin/installboot/fstypes.c:1.14
--- src/usr.sbin/installboot/fstypes.c:1.13	Thu Jan 14 16:27:49 2010
+++ src/usr.sbin/installboot/fstypes.c	Sun May 19 15:48:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.c,v 1.13 2010/01/14 16:27:49 tsutsui Exp $	*/
+/*	$NetBSD: fstypes.c,v 1.14 2024/05/19 15:48:57 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if !defined(__lint)
-__RCSID("$NetBSD: fstypes.c,v 1.13 2010/01/14 16:27:49 tsutsui Exp $");
+__RCSID("$NetBSD: fstypes.c,v 1.14 2024/05/19 15:48:57 tsutsui Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -48,11 +48,33 @@ __RCSID("$NetBSD: fstypes.c,v 1.13 2010/
 
 struct ib_fs fstypes[] = {
 #ifndef NO_STAGE2
-	{ .name = "ffs",  .match = ffs_match,	.findstage2 = ffs_findstage2	},
-	{ .name = "raid", .match = raid_match,	.findstage2 = ffs_findstage2	},
-	{ .name = "raw",  .match = raw_match,	.findstage2 = raw_findstage2	},
+	{
+		.name = "ffs",
+		.match = ffs_match,
+		.findstage2 = ffs_findstage2
+	},
+	{
+		.name = "raid",
+		.match = raid_match,
+		.findstage2 = ffs_findstage2
+	},
+#ifdef SUPPORT_CD9660
+	{
+		.name = "cd9660",
+		.match = cd9660_match,
+		.findstage2 = cd9660_findstage2
+	},
 #endif
-	{ .name = NULL, }
+	/* raw_match() always matches, so raw should be at the end. */
+	{
+		.name = "raw",
+		.match = raw_match,
+		.findstage2 = raw_findstage2
+	},
+#endif
+	{
+		.name = NULL
+	}
 };
 
 #ifndef NO_STAGE2

Index: src/usr.sbin/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.108 src/usr.sbin/installboot/installboot.8:1.109
--- src/usr.sbin/installboot/installboot.8:1.108	Tue Dec 26 06:00:35 2023
+++ 

CVS commit: src/usr.sbin/installboot

2024-05-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 19 15:44:22 UTC 2024

Modified Files:
src/usr.sbin/installboot: installboot.h

Log Message:
Reorder function prototypes per source files.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/installboot/installboot.h

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/installboot/installboot.h
diff -u src/usr.sbin/installboot/installboot.h:1.43 src/usr.sbin/installboot/installboot.h:1.44
--- src/usr.sbin/installboot/installboot.h:1.43	Sun Jul 10 19:28:00 2022
+++ src/usr.sbin/installboot/installboot.h	Sun May 19 15:44:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.h,v 1.43 2022/07/10 19:28:00 brook Exp $	*/
+/*	$NetBSD: installboot.h,v 1.44 2024/05/19 15:44:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -171,15 +171,19 @@ int		shared_bbinfo_clearboot(ib_params *
 int		shared_bbinfo_setboot(ib_params *, struct bbinfo_params *,
 		int (*)(ib_params *, struct bbinfo_params *, uint8_t *));
 
-	/* fstypes.c */
-int		hardcode_stage2(ib_params *, uint32_t *, ib_block *);
+	/* ext2fs.c */
+int		ext2fs_match(ib_params *);
+int		ext2fs_findstage2(ib_params *, uint32_t *, ib_block *);
+
+	/* ffs.c */
 int		ffs_match(ib_params *);
 int		ffs_findstage2(ib_params *, uint32_t *, ib_block *);
 int		raid_match(ib_params *);
+
+	/* fstypes.c */
+int		hardcode_stage2(ib_params *, uint32_t *, ib_block *);
 int		raw_match(ib_params *);
 int		raw_findstage2(ib_params *, uint32_t *, ib_block *);
-int		ext2fs_match(ib_params *);
-int		ext2fs_findstage2(ib_params *, uint32_t *, ib_block *);
 
 	/* machines.c */
 extern struct ib_mach ib_mach_alpha;



CVS commit: src/usr.sbin/installboot

2024-05-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May 19 15:44:22 UTC 2024

Modified Files:
src/usr.sbin/installboot: installboot.h

Log Message:
Reorder function prototypes per source files.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/installboot/installboot.h

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



CVS commit: src/usr.sbin/flashctl

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 20:38:05 UTC 2024

Modified Files:
src/usr.sbin/flashctl: Makefile flashctl.c

Log Message:
usr.sbin/flashctl: skip lint's strict bool mode with Clang

The strict bool mode is already checked in GCC mode, so restore the
previous idiomatic code.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/flashctl/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/flashctl/flashctl.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/flashctl/Makefile
diff -u src/usr.sbin/flashctl/Makefile:1.3 src/usr.sbin/flashctl/Makefile:1.4
--- src/usr.sbin/flashctl/Makefile:1.3	Sun Jan  8 15:49:51 2023
+++ src/usr.sbin/flashctl/Makefile	Mon May 13 20:38:05 2024
@@ -1,11 +1,12 @@
-# $NetBSD: Makefile,v 1.3 2023/01/08 15:49:51 rillig Exp $
+# $NetBSD: Makefile,v 1.4 2024/05/13 20:38:05 rillig Exp $
 
 SRCS=		flashctl.c
 
 PROG=		flashctl
 MAN=		flashctl.8
-LINTFLAGS+=	-T		# strict bool mode
+LINTFLAGS+=	${MKLLVM:U-T:D}	# strict bool mode
 
 WARNS=		4
 
 .include 
+

Index: src/usr.sbin/flashctl/flashctl.c
diff -u src/usr.sbin/flashctl/flashctl.c:1.10 src/usr.sbin/flashctl/flashctl.c:1.11
--- src/usr.sbin/flashctl/flashctl.c:1.10	Sun May 12 19:03:55 2024
+++ src/usr.sbin/flashctl/flashctl.c	Mon May 13 20:38:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $	*/
+/*	$NetBSD: flashctl.c,v 1.11 2024/05/13 20:38:05 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $");
+__RCSID("$NetBSD: flashctl.c,v 1.11 2024/05/13 20:38:05 rillig Exp $");
 
 #include 
 #include 
@@ -233,11 +233,11 @@ to_intmax(intmax_t *num, const char *str
 
 	errno = 0;
 	if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) {
-		if (isxdigit((unsigned char)str[2]) == 0)
+		if (!isxdigit((unsigned char)str[2]))
 			return EINVAL;
 		*num = strtoimax(str, , 16);
 	} else {
-		if (isdigit((unsigned char)str[0]) == 0)
+		if (!isdigit((unsigned char)str[0]))
 			return EINVAL;
 		*num = strtoimax(str, , 10);
 	}



CVS commit: src/usr.sbin/flashctl

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 20:38:05 UTC 2024

Modified Files:
src/usr.sbin/flashctl: Makefile flashctl.c

Log Message:
usr.sbin/flashctl: skip lint's strict bool mode with Clang

The strict bool mode is already checked in GCC mode, so restore the
previous idiomatic code.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/flashctl/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/flashctl/flashctl.c

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



lint's strict bool mode (was: Re: CVS commit: src/usr.sbin/flashctl)

2024-05-13 Thread Roland Illig
Am 13.05.2024 um 16:06 schrieb Taylor R Campbell:
>> Module Name:src
>> Committed By:   rillig
>> Date:   Sun May 12 19:03:55 UTC 2024
>>
>> Modified Files:
>> src/usr.sbin/flashctl: flashctl.c
>>
>> Log Message:
>> flashctl: fix lint's strict bool mode with Clang preprocessor
>>
>> Treating the return value from the  character classification
>> functions as an 'int' is neither elegant nor idiomatic, but it works for
>> now.
>>
>> -   if (!isxdigit((unsigned char)str[2]))
>> +   if (isxdigit((unsigned char)str[2]) == 0)
>
> Why is this change necessary?  Weren't you teaching lint to handle
> this case without complaining?

Yes, I did. The thing is that I only ever tested lint's strict bool mode
with the GCC preprocessor, and that preprocessor marks every token from
a macro expansion as coming from a system header or coming from the
user's code. Therefore, lint could be more lenient when checking the
result of the isxdigit macro, as its main operator, the cast to '(int)',
is from a system header, so it's OK that it has the "wrong" type.

On the other hand, the strcmp function is not listed in "namespace.h"
and does not have a macro definition, and although the function
declaration comes from a system header, the GCC preprocessor does not
mark the function call expression as coming from a system header.

This is the difference by which lint treats 'isxdigit(ch)' as bool-like
but 'strcmp(s1, s2)' as strictly 'int'.

A few days or weeks ago, Christos started builds that have both
MKLLVM=yes and MKLINT=yes, thus using the Clang preprocessor as lint's
preprocessor. Apparently nobody else has done this in the last few
years. Clang's preprocessor's output does not mark the tokens from macro
expansions as coming from a system header or from the user's code. Due
to this, lint can no longer be lenient for system header macro
expansions as it doesn't get the system header information anymore.

> We shouldn't change anything like
>
>   if (!isxdigit(...))
>   if (ferror(...))
>
> to
>
>   if (isxdigit(...) == 0)
>   if (ferror(...) != 0)
>
> The original is clearer and idiomatic code, even if it's a little
> silly that the return value is declared as int and not bool
> (presumably for historical reasons, if the interfaces were defined
> before bool existed).

I agree. For usr.bin/error, I tried a different variant, namely to only
activate lint's strict bool mode when MKLLVM is undefined, thus when the
GCC preprocessor is used. I guess activating the strict bool mode only
in GCC mode is good enough to catch all type mismatches.

The combination of MKLLVM=yes MKLINT=yes is also the cause why lint now
allows do-while-0 even in strict bool mode, as the FD_ZERO macro uses
that idiom and I didn't dare to change the macro to do-while-false, as
that would either require , or to deviate from the idiom
by using 'do { ... } while (0 != 0)', as that would look suspicious.

I will switch usr.sbin/flashctl to the only-in-GCC-mode variant and
restore the previous idiomatic code.

Roland



Re: CVS commit: src/usr.sbin/flashctl

2024-05-13 Thread Taylor R Campbell
> Module Name:src
> Committed By:   rillig
> Date:   Sun May 12 19:03:55 UTC 2024
> 
> Modified Files:
> src/usr.sbin/flashctl: flashctl.c
> 
> Log Message:
> flashctl: fix lint's strict bool mode with Clang preprocessor
> 
> Treating the return value from the  character classification
> functions as an 'int' is neither elegant nor idiomatic, but it works for
> now.
> 
> -   if (!isxdigit((unsigned char)str[2]))
> +   if (isxdigit((unsigned char)str[2]) == 0)

Why is this change necessary?  Weren't you teaching lint to handle
this case without complaining?  We shouldn't change anything like

if (!isxdigit(...))
if (ferror(...))

to

if (isxdigit(...) == 0)
if (ferror(...) != 0)

The original is clearer and idiomatic code, even if it's a little
silly that the return value is declared as int and not bool
(presumably for historical reasons, if the interfaces were defined
before bool existed).


CVS commit: src/usr.sbin/acpitools/acpidump

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:00:21 UTC 2024

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
s/iast/iasl/ from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/acpitools/acpidump/acpi.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/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.55 src/usr.sbin/acpitools/acpidump/acpi.c:1.56
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.55	Tue May 24 20:50:21 2022
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Sun May 12 23:00:21 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.55 2022/05/24 20:50:21 andvar Exp $ */
+/* $NetBSD: acpi.c,v 1.56 2024/05/12 23:00:21 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.55 2022/05/24 20:50:21 andvar Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.56 2024/05/12 23:00:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -4719,7 +4719,7 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
 		goto out;
 	}
 	if (status != 0) {
-		fprintf(stderr, "iast exit status = %d\n", status);
+		fprintf(stderr, "iasl exit status = %d\n", status);
 	}
 
 	/* Dump iasl's output to stdout */



CVS commit: src/usr.sbin/acpitools/acpidump

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:00:21 UTC 2024

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
s/iast/iasl/ from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/acpitools/acpidump/acpi.c

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



CVS commit: src/usr.sbin/flashctl

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 19:03:55 UTC 2024

Modified Files:
src/usr.sbin/flashctl: flashctl.c

Log Message:
flashctl: fix lint's strict bool mode with Clang preprocessor

Treating the return value from the  character classification
functions as an 'int' is neither elegant nor idiomatic, but it works for
now.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/flashctl/flashctl.c

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



CVS commit: src/usr.sbin/flashctl

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 19:03:55 UTC 2024

Modified Files:
src/usr.sbin/flashctl: flashctl.c

Log Message:
flashctl: fix lint's strict bool mode with Clang preprocessor

Treating the return value from the  character classification
functions as an 'int' is neither elegant nor idiomatic, but it works for
now.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/flashctl/flashctl.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/flashctl/flashctl.c
diff -u src/usr.sbin/flashctl/flashctl.c:1.9 src/usr.sbin/flashctl/flashctl.c:1.10
--- src/usr.sbin/flashctl/flashctl.c:1.9	Sun Jan  8 16:01:49 2023
+++ src/usr.sbin/flashctl/flashctl.c	Sun May 12 19:03:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: flashctl.c,v 1.9 2023/01/08 16:01:49 rillig Exp $	*/
+/*	$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: flashctl.c,v 1.9 2023/01/08 16:01:49 rillig Exp $");
+__RCSID("$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $");
 
 #include 
 #include 
@@ -233,11 +233,11 @@ to_intmax(intmax_t *num, const char *str
 
 	errno = 0;
 	if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) {
-		if (!isxdigit((unsigned char)str[2]))
+		if (isxdigit((unsigned char)str[2]) == 0)
 			return EINVAL;
 		*num = strtoimax(str, , 16);
 	} else {
-		if (!isdigit((unsigned char)str[0]))
+		if (isdigit((unsigned char)str[0]) == 0)
 			return EINVAL;
 		*num = strtoimax(str, , 10);
 	}



CVS commit: src/usr.sbin/makefs

2024-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 15:57:56 UTC 2024

Modified Files:
src/usr.sbin/makefs: makefs.8 makefs.c walk.c

Log Message:
Add an option to warn and error out for mtree missing entries.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/makefs/walk.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/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.71 src/usr.sbin/makefs/makefs.8:1.72
--- src/usr.sbin/makefs/makefs.8:1.71	Thu Nov 17 01:40:41 2022
+++ src/usr.sbin/makefs/makefs.8	Wed May  8 11:57:56 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.71 2022/11/17 06:40:41 chs Exp $
+.\"	$NetBSD: makefs.8,v 1.72 2024/05/08 15:57:56 christos Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 4, 2021
+.Dd May 8, 2024
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -260,6 +260,10 @@ ISO/Ecma UDF file system.
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
+Repeating this flag causes
+.Nm
+to print a warning for each missing system nodes and exit with an error code
+if there are any missing.
 .It Fl Z
 Create a sparse file for
 .Sy ffs .

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.57 src/usr.sbin/makefs/makefs.c:1.58
--- src/usr.sbin/makefs/makefs.c:1.57	Sun Feb 18 11:59:16 2024
+++ src/usr.sbin/makefs/makefs.c	Wed May  8 11:57:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.57 2024/02/18 16:59:16 christos Exp $	*/
+/*	$NetBSD: makefs.c,v 1.58 2024/05/08 15:57:56 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: makefs.c,v 1.57 2024/02/18 16:59:16 christos Exp $");
+__RCSID("$NetBSD: makefs.c,v 1.58 2024/05/08 15:57:56 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -261,7 +261,7 @@ main(int argc, char *argv[])
 			break;
 
 		case 'x':
-			fsoptions.onlyspec = 1;
+			fsoptions.onlyspec++;
 			break;
 
 		case 'Z':

Index: src/usr.sbin/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.39 src/usr.sbin/makefs/walk.c:1.40
--- src/usr.sbin/makefs/walk.c:1.39	Wed Apr 24 17:59:39 2024
+++ src/usr.sbin/makefs/walk.c	Wed May  8 11:57:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.39 2024/04/24 21:59:39 rillig Exp $	*/
+/*	$NetBSD: walk.c,v 1.40 2024/05/08 15:57:56 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.39 2024/04/24 21:59:39 rillig Exp $");
+__RCSID("$NetBSD: walk.c,v 1.40 2024/05/08 15:57:56 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -65,6 +65,7 @@ static	void	 apply_specentry(const char 
 static	fsnode	*create_fsnode(const char *, const char *, const char *,
 			   struct stat *);
 static	fsinode	*link_check(fsinode *);
+static size_t missing = 0;
 
 /*
  * fsnode_cmp --
@@ -429,6 +430,9 @@ apply_specfile(const char *specfile, con
 	apply_specdir(dir, root, parent, speconly);
 
 	free_nodes(root);
+	if (missing)
+		errx(EXIT_FAILURE, "Add %zu missing entries in `%s'", 
+		missing, specfile);
 }
 
 static void
@@ -469,6 +473,11 @@ apply_specdir(const char *dir, NODE *spe
 	break;
 			}
 			if (curnode == NULL) {
+if (speconly > 1) {
+	warnx("missing specfile entry for %s/%s",
+	dir, curfsnode->name);
+	missing++;
+}
 if (debug & DEBUG_APPLY_SPECONLY) {
 	printf("%s: trimming %s/%s %p\n",
 	__func__, dir, curfsnode->name,



CVS commit: src/usr.sbin/makefs

2024-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 15:57:56 UTC 2024

Modified Files:
src/usr.sbin/makefs: makefs.8 makefs.c walk.c

Log Message:
Add an option to warn and error out for mtree missing entries.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/crash

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 22:07:32 UTC 2024

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

Log Message:
Add ${TOOL_DATE} (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/crash/Makefile

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

Modified files:

Index: src/usr.sbin/crash/Makefile
diff -u src/usr.sbin/crash/Makefile:1.50 src/usr.sbin/crash/Makefile:1.51
--- src/usr.sbin/crash/Makefile:1.50	Tue Nov 21 21:01:07 2023
+++ src/usr.sbin/crash/Makefile	Fri Apr 26 18:07:32 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.50 2023/11/22 02:01:07 thorpej Exp $
+#	$NetBSD: Makefile,v 1.51 2024/04/26 22:07:32 christos Exp $
 
 PROG=		crash
 MAN=		crash.8
@@ -119,7 +119,7 @@ NVFLAGS+=-R
 # vers.c
 SRCS+=	vers.c
 vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
-	${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
+	TOOL_DATE=${TOOL_DATE} ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
 CLEANFILES+=	vers.c version
 
 .else# } {



CVS commit: src/usr.sbin/crash

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 22:07:32 UTC 2024

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

Log Message:
Add ${TOOL_DATE} (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/crash/Makefile

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



CVS commit: src/usr.sbin/fstyp

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:21:25 UTC 2024

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

Log Message:
PR/58202: Malte Dehling: Don't link libzfs


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/fstyp/Makefile

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

Modified files:

Index: src/usr.sbin/fstyp/Makefile
diff -u src/usr.sbin/fstyp/Makefile:1.14 src/usr.sbin/fstyp/Makefile:1.15
--- src/usr.sbin/fstyp/Makefile:1.14	Sat Jun  3 17:26:29 2023
+++ src/usr.sbin/fstyp/Makefile	Fri Apr 26 14:21:25 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2023/06/03 21:26:29 lukem Exp $
+#	$NetBSD: Makefile,v 1.15 2024/04/26 18:21:25 christos Exp $
 
 .include 
 
@@ -17,7 +17,8 @@ WARNS?=	6
 COPTS.zfs.c+=	-Wno-unknown-pragmas
 COPTS.zfs.c+=	-Wno-sign-conversion
 COPTS.zfs.c+=	-Wno-strict-prototypes
-LDADD+=	-lnvpair -lzfs
+LDADD+=	-lnvpair
+DPADD+= ${LIBNVPAIR}
 
 OSNET=${NETBSDSRCDIR}/external/cddl/osnet
 CPPFLAGS+=	-DHAVE_ZFS



CVS commit: src/usr.sbin/fstyp

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:21:25 UTC 2024

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

Log Message:
PR/58202: Malte Dehling: Don't link libzfs


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/fstyp/Makefile

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



CVS commit: src/usr.sbin/sysinst

2024-04-25 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr 25 11:25:09 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en msg.mi.es msg.mi.pl util.c

Log Message:
Increase length of set description to 40 characters so recent additions fit.

Ok: martin@

Fixes PR install/58188 "sysinst fails to display status of base32 set"


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.76 -r1.77 src/usr.sbin/sysinst/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/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.47 src/usr.sbin/sysinst/msg.mi.de:1.48
--- src/usr.sbin/sysinst/msg.mi.de:1.47	Mon Apr 22 14:41:26 2024
+++ src/usr.sbin/sysinst/msg.mi.de	Thu Apr 25 11:25:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.47 2024/04/22 14:41:26 nia Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.48 2024/04/25 11:25:08 hannken Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -875,8 +875,8 @@ message cur_distsets
 }
 
 message cur_distsets_header
-{   Distributionspaket   Ausgewählt
-    --
+{   Distributionspaket Ausgewählt
+   -- --
 }
 
 message set_base

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.50 src/usr.sbin/sysinst/msg.mi.en:1.51
--- src/usr.sbin/sysinst/msg.mi.en:1.50	Mon Apr 22 14:41:26 2024
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Apr 25 11:25:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.50 2024/04/22 14:41:26 nia Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.51 2024/04/25 11:25:08 hannken Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -809,8 +809,8 @@ message cur_distsets
 }
 
 message cur_distsets_header
-{   Distribution set Selected
-    
+{   Distribution set   Selected
+   -- 
 }
 
 message set_base

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.42 src/usr.sbin/sysinst/msg.mi.es:1.43
--- src/usr.sbin/sysinst/msg.mi.es:1.42	Mon Apr 22 14:41:26 2024
+++ src/usr.sbin/sysinst/msg.mi.es	Thu Apr 25 11:25:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.42 2024/04/22 14:41:26 nia Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.43 2024/04/25 11:25:08 hannken Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -834,8 +834,8 @@ message cur_distsets
 }
 
 message cur_distsets_header
-{   Conjunto de distribución Selecc.
-    
+{   Conjunto de distribución   Selecc.
+   -- 
 }
 
 message set_base

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.48 src/usr.sbin/sysinst/msg.mi.pl:1.49
--- src/usr.sbin/sysinst/msg.mi.pl:1.48	Mon Apr 22 14:41:26 2024
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu Apr 25 11:25:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.48 2024/04/22 14:41:26 nia Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.49 2024/04/25 11:25:08 hannken Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -806,8 +806,8 @@ message cur_distsets
 }
 
 message cur_distsets_header
-{Pakiet dystrybucyjny Uzyc?
-- -
+{Pakiet dystrybucyjny   Uzyc?
+--- -
 }
 
 message set_base

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.76 src/usr.sbin/sysinst/util.c:1.77
--- src/usr.sbin/sysinst/util.c:1.76	Mon Apr 22 14:41:26 2024
+++ src/usr.sbin/sysinst/util.c	Thu Apr 25 11:25:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.76 2024/04/22 14:41:26 nia Exp $	*/
+/*	$NetBSD: util.c,v 1.77 2024/04/25 11:25:08 hannken Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -246,7 +246,7 @@ init_set_status(int flags)
 	i = strlen(msg_all); if (i > len) {len = i; longest = msg_all; }
 	i = strlen(msg_some); if (i > len) {len = i; longest = msg_some; }
 	i = strlen(msg_none); if (i > len) {len = i; longest = msg_none; }
-	select_menu_width = snprintf(NULL, 0, "%-30s %s", "", longest);
+	select_menu_width = snprintf(NULL, 0, "%-40s %s", "", longest);
 
 	/* Give the md code a chance to choose the right kernel, etc. */
 	md_init_set_status(flags);
@@ -870,7 +870,7 @@ set_label(menudesc *menu, int opt, void 
 		}
 	}
 
-	wprintw(menu->mw, "%-30s %s", msg_string(desc), selected);
+	wprintw(menu->mw, "%-40s %s", msg_string(desc), selected);
 }
 
 static int set_sublist(menudesc *menu, void *arg);



CVS commit: src/usr.sbin/sysinst

2024-04-25 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr 25 11:25:09 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en msg.mi.es msg.mi.pl util.c

Log Message:
Increase length of set description to 40 characters so recent additions fit.

Ok: martin@

Fixes PR install/58188 "sysinst fails to display status of base32 set"


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.76 -r1.77 src/usr.sbin/sysinst/util.c

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



CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Apr 24 21:59:39 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: fix out-of-bounds fsnode count in fsnode_sort

Found by running './makefs img.dat cd9660'.

While here, apply more KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Apr 24 21:59:39 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: fix out-of-bounds fsnode count in fsnode_sort

Found by running './makefs img.dat cd9660'.

While here, apply more KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.38 src/usr.sbin/makefs/walk.c:1.39
--- src/usr.sbin/makefs/walk.c:1.38	Wed Apr 24 14:23:37 2024
+++ src/usr.sbin/makefs/walk.c	Wed Apr 24 21:59:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.38 2024/04/24 14:23:37 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.39 2024/04/24 21:59:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.38 2024/04/24 14:23:37 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.39 2024/04/24 21:59:39 rillig Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -93,7 +93,6 @@ fsnode_sort(fsnode *first, const char *r
 	size_t num = 0;
 
 	for (fsnode *tmp = first; tmp; tmp = tmp->next, num++) {
-		num++;
 		if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
 			printf("%s: pre sort: %s %s %s\n",
 			__func__, root, dir, tmp->name);
@@ -103,7 +102,7 @@ fsnode_sort(fsnode *first, const char *r
 	for (fsnode *tmp = first; tmp; tmp = tmp->next)
 		*listptr++ = tmp;
 
-	qsort (list, num, sizeof(*list), fsnode_cmp);
+	qsort(list, num, sizeof(*list), fsnode_cmp);
 
 	for (size_t i = 0; i < num - 1; ++i)
 		list[i]->next = list[i + 1];
@@ -562,7 +561,7 @@ apply_specdir(const char *dir, NODE *spe
 			if (curfsnode->type != S_IFDIR)
 errx(EXIT_FAILURE,
 "`%s' is not a directory", path);
-			assert (curfsnode->child != NULL);
+			assert(curfsnode->child != NULL);
 			apply_specdir(path, curnode, curfsnode->child, speconly);
 		}
 	}
@@ -676,14 +675,14 @@ dump_fsnodes(fsnode *root)
 			assert(cur->symlink != NULL);
 			printf(" -> %s", cur->symlink);
 		} else {
-			assert (cur->symlink == NULL);
+			assert(cur->symlink == NULL);
 		}
 		if (cur->inode->nlink > 1)
 			printf(", nlinks=%d", cur->inode->nlink);
 		putchar('\n');
 
 		if (cur->child) {
-			assert (cur->type == S_IFDIR);
+			assert(cur->type == S_IFDIR);
 			dump_fsnodes(cur->child);
 		}
 	}



CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 14:23:37 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
use __func__


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.37 src/usr.sbin/makefs/walk.c:1.38
--- src/usr.sbin/makefs/walk.c:1.37	Wed Apr 24 10:02:39 2024
+++ src/usr.sbin/makefs/walk.c	Wed Apr 24 10:23:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.37 2024/04/24 14:02:39 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.38 2024/04/24 14:23:37 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.37 2024/04/24 14:02:39 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.38 2024/04/24 14:23:37 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -95,7 +95,8 @@ fsnode_sort(fsnode *first, const char *r
 	for (fsnode *tmp = first; tmp; tmp = tmp->next, num++) {
 		num++;
 		if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
-			printf ("pre sort: %s %s %s\n", root, dir, tmp->name);
+			printf("%s: pre sort: %s %s %s\n",
+			__func__, root, dir, tmp->name);
 	}
 
 	list = listptr = ecalloc(num, sizeof(*list));
@@ -112,7 +113,8 @@ fsnode_sort(fsnode *first, const char *r
 	free(list);
 	if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
 		for (fsnode *tmp = first; tmp; tmp = tmp->next)
-			printf("post sort: %s %s %s\n", root, dir, tmp->name);
+			printf("%s: post sort: %s %s %s\n",
+			__func__, root, dir, tmp->name);
 
 	return first;
 }
@@ -144,7 +146,7 @@ walk_dir(const char *root, const char *d
 	if ((size_t)len >= sizeof(path))
 		errx(EXIT_FAILURE, "Pathname too long.");
 	if (debug & DEBUG_WALK_DIR)
-		printf("walk_dir: %s %p\n", path, parent);
+		printf("%s: %s %p\n", __func__, path, parent);
 	if ((dirp = opendir(path)) == NULL)
 		err(EXIT_FAILURE, "Can't opendir `%s'", path);
 	rp = path + strlen(root) + 1;
@@ -173,7 +175,8 @@ walk_dir(const char *root, const char *d
 dot = 0;
 			}
 		if (debug & DEBUG_WALK_DIR_NODE)
-			printf("scanning %s/%s/%s\n", root, dir, name);
+			printf("%s: scanning %s/%s/%s\n",
+			__func__, root, dir, name);
 		if (snprintf(path + len, sizeof(path) - len, "/%s", name) >=
 		(int)sizeof(path) - len)
 			errx(EXIT_FAILURE, "Pathname too long.");
@@ -198,7 +201,7 @@ walk_dir(const char *root, const char *d
 #ifdef S_ISSOCK
 		if (S_ISSOCK(stbuf.st_mode & S_IFMT)) {
 			if (debug & DEBUG_WALK_DIR_NODE)
-printf("  skipping socket %s\n", path);
+printf("%s: skipping socket %s\n", __func__, path);
 			continue;
 		}
 #endif
@@ -218,8 +221,8 @@ walk_dir(const char *root, const char *d
 if (S_ISDIR(cur->type) &&
 S_ISDIR(stbuf.st_mode)) {
 	if (debug & DEBUG_WALK_DIR_NODE)
-		printf("merging %s with %p\n",
-		path, cur->child);
+		printf("%s: merging %s with %p\n",
+		__func__, path, cur->child);
 	cur->child = walk_dir(root, rp, cur,
 	cur->child, replace, follow);
 	continue;
@@ -232,7 +235,8 @@ walk_dir(const char *root, const char *d
 	inode_type(cur->type));
 else {
 	if (debug & DEBUG_WALK_DIR_NODE)
-		printf("replacing %s %s\n",
+		printf("%s: replacing %s %s\n",
+		__func__,
 		inode_type(stbuf.st_mode),
 		path);
 	if (cur == join->next)
@@ -280,7 +284,8 @@ walk_dir(const char *root, const char *d
 cur->inode = curino;
 cur->inode->nlink++;
 if (debug & DEBUG_WALK_DIR_LINKCHECK)
-	printf("link_check: found [%ju, %ju]\n",
+	printf("%s: link check found [%ju, %ju]\n",
+	__func__,
 	(uintmax_t)curino->st.st_dev,
 	(uintmax_t)curino->st.st_ino);
 			}
@@ -403,7 +408,7 @@ apply_specfile(const char *specfile, con
 	assert(parent != NULL);
 
 	if (debug & DEBUG_APPLY_SPECFILE)
-		printf("apply_specfile: %s, %s %p\n", specfile, dir, parent);
+		printf("%s: %s, %s %p\n", __func__, specfile, dir, parent);
 
 /* read in the specfile */
 	if ((fp = fopen(specfile, "r")) == NULL)
@@ -438,7 +443,7 @@ apply_specdir(const char *dir, NODE *spe
 	assert(dirnode != NULL);
 
 	if (debug & DEBUG_APPLY_SPECFILE)
-		printf("apply_specdir: %s %p %p\n", dir, specnode, dirnode);
+		printf("%s: %s %p %p\n", __func__, dir, specnode, dirnode);
 
 	if (specnode->type != F_DIR)
 		errx(EXIT_FAILURE, "Specfile node `%s/%s' is not a directory",
@@ -466,7 +471,9 @@ apply_specdir(const char *dir, NODE *spe
 			}
 			if (curnode == NULL) {
 if (debug & DEBUG_APPLY_SPECONLY) {
-	printf("apply_specdir: trimming %s/%s %p\n", dir, curfsnode->name, curfsnode);
+	printf("%s: trimming %s/%s %p\n",
+	__func__, dir, curfsnode->name,
+	curfsnode);
 }
 free_fsnodes(curfsnode);
 			}
@@ -477,13 +484,12 @@ 

CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 14:23:37 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
use __func__


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 14:02:39 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
make a separate sorting function and KNF (thanks rillig)


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.36 src/usr.sbin/makefs/walk.c:1.37
--- src/usr.sbin/makefs/walk.c:1.36	Tue Apr 23 18:18:56 2024
+++ src/usr.sbin/makefs/walk.c	Wed Apr 24 10:02:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.36 2024/04/23 22:18:56 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.37 2024/04/24 14:02:39 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.36 2024/04/23 22:18:56 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.37 2024/04/24 14:02:39 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -86,6 +86,37 @@ fsnode_cmp(const void *vleft, const void
 	return strcmp(lname, rname);
 }
 
+static fsnode *
+fsnode_sort(fsnode *first, const char *root, const char *dir)
+{
+	fsnode **list, **listptr;
+	size_t num = 0;
+
+	for (fsnode *tmp = first; tmp; tmp = tmp->next, num++) {
+		num++;
+		if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
+			printf ("pre sort: %s %s %s\n", root, dir, tmp->name);
+	}
+
+	list = listptr = ecalloc(num, sizeof(*list));
+	for (fsnode *tmp = first; tmp; tmp = tmp->next)
+		*listptr++ = tmp;
+
+	qsort (list, num, sizeof(*list), fsnode_cmp);
+
+	for (size_t i = 0; i < num - 1; ++i)
+		list[i]->next = list[i + 1];
+	list[num - 1]->next = NULL;
+	first = list[0];
+	assert(strcmp(first->name, ".") == 0);
+	free(list);
+	if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
+		for (fsnode *tmp = first; tmp; tmp = tmp->next)
+			printf("post sort: %s %s %s\n", root, dir, tmp->name);
+
+	return first;
+}
+
 /*
  * walk_dir --
  *	build a tree of fsnodes from `root' and `dir', with a parent
@@ -106,14 +137,11 @@ walk_dir(const char *root, const char *d
 	char		*name, *rp;
 	int		dot, len;
 
-	fsnode **list, **listptr;
-	int num = 0;
-
 	assert(root != NULL);
 	assert(dir != NULL);
 
 	len = snprintf(path, sizeof(path), "%s/%s", root, dir);
-	if (len >= (int)sizeof(path))
+	if ((size_t)len >= sizeof(path))
 		errx(EXIT_FAILURE, "Pathname too long.");
 	if (debug & DEBUG_WALK_DIR)
 		printf("walk_dir: %s %p\n", path, parent);
@@ -155,14 +183,16 @@ walk_dir(const char *root, const char *d
 		} else {
 			if (lstat(path, ) == -1)
 err(EXIT_FAILURE, "Can't lstat `%s'", path);
-			/* As symlink permission bits vary between filesystems
-			   (ie. 0755 on FFS/NetBSD, 0777 for ext[234]/Linux),
-			   force them to 0755.  */
+			/*
+			 * Symlink permission bits vary between filesystems/OSs
+			 * (ie. 0755 on FFS/NetBSD, 0777 for ext[234]/Linux),
+			 * force them to 0755.
+			 */
 			if (S_ISLNK(stbuf.st_mode)) {
 stbuf.st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO);
 stbuf.st_mode |= S_IRWXU
- | S_IRGRP | S_IXGRP
- | S_IROTH | S_IXOTH;
+| S_IRGRP | S_IXGRP
+| S_IROTH | S_IXOTH;
 			}
 		}
 #ifdef S_ISSOCK
@@ -273,35 +303,7 @@ walk_dir(const char *root, const char *d
 	if (closedir(dirp) == -1)
 		err(EXIT_FAILURE, "Can't closedir `%s/%s'", root, dir);
 
-	/*
-	 * Sort entries.
-	 */
-	/* Create a plain list: Count, alloc, add.  */
-	for (fsnode *tmp = first; tmp; tmp = tmp->next) {
-		num++;
-		if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
-			printf ("pre sort: %s %s %s\n", root, dir, tmp->name);
-	}
-	list = listptr = ecalloc (num, sizeof (*list));
-	for (fsnode *tmp = first; tmp; tmp = tmp->next)
-		*listptr++ = tmp;
-	/* Sort plain list.  */
-	qsort (list, num, sizeof (*list), _cmp);
-	/* Rewire.  */
-	for (int i = 0; i < num - 1; ++i)
-		list[i]->next = list[i+1];
-	list[num - 1]->next = NULL;
-	first = list[0];
-	/* Check `first` to be ".".  */
-	assert (strcmp (first->name, ".") == 0);
-	/* Free.  */
-	free (list);
-	/* Dump sorted state.  */
-	if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
-		for (fsnode *tmp = first; tmp; tmp = tmp->next)
-			printf ("post sort: %s %s %s\n", root, dir, tmp->name);
-
-	return first;
+	return fsnode_sort(first, root, dir);
 }
 
 static fsnode *



CVS commit: src/usr.sbin/makefs

2024-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 14:02:39 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
make a separate sorting function and KNF (thanks rillig)


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/mtree

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 01:44:51 UTC 2024

Modified Files:
src/usr.sbin/mtree: create.c

Log Message:
For the NetBSD tools build we provide our own fts.h not FreeBSD's so the
comparator should have the NetBSD signature.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.sbin/mtree/create.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/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.77 src/usr.sbin/mtree/create.c:1.78
--- src/usr.sbin/mtree/create.c:1.77	Sat Dec  2 08:34:48 2023
+++ src/usr.sbin/mtree/create.c	Tue Apr 23 21:44:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $	*/
+/*	$NetBSD: create.c,v 1.78 2024/04/24 01:44:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.78 2024/04/24 01:44:51 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,7 +84,7 @@ static uid_t uid;
 static mode_t mode;
 static u_long flags;
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H)
 #define	FTS_CONST const
 #else
 #define	FTS_CONST



CVS commit: src/usr.sbin/mtree

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 01:44:51 UTC 2024

Modified Files:
src/usr.sbin/mtree: create.c

Log Message:
For the NetBSD tools build we provide our own fts.h not FreeBSD's so the
comparator should have the NetBSD signature.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.sbin/mtree/create.c

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



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:18:56 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
pass lint, simplify


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.35 src/usr.sbin/makefs/walk.c:1.36
--- src/usr.sbin/makefs/walk.c:1.35	Tue Apr 23 18:12:48 2024
+++ src/usr.sbin/makefs/walk.c	Tue Apr 23 18:18:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.35 2024/04/23 22:12:48 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.36 2024/04/23 22:18:56 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.35 2024/04/23 22:12:48 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.36 2024/04/23 22:18:56 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -73,16 +73,17 @@ static	fsinode	*link_check(fsinode *);
  *	as compared by `strcmp()`.
  */
 static int
-fsnode_cmp (const void *_left, const void *_right)
+fsnode_cmp(const void *vleft, const void *vright)
 {
-	const fsnode * const left  = *(const fsnode * const *)_left;
-	const fsnode * const right = *(const fsnode * const *)_right;
+	const fsnode * const *left  = vleft;
+	const fsnode * const *right = vright;
+	const char *lname = (*left)->name, *rname = (*right)->name;
 
-	if (strcmp (left->name, ".") == 0)
+	if (strcmp(lname, ".") == 0)
 		return -1;
-	if (strcmp (right->name, ".") == 0)
+	if (strcmp(rname, ".") == 0)
 		return 1;
-	return strcmp (left->name, right->name);
+	return strcmp(lname, rname);
 }
 
 /*
@@ -249,14 +250,14 @@ walk_dir(const char *root, const char *d
 cur->inode = curino;
 cur->inode->nlink++;
 if (debug & DEBUG_WALK_DIR_LINKCHECK)
-	printf("link_check: found [%llu, %llu]\n",
-	(unsigned long long)curino->st.st_dev,
-	(unsigned long long)curino->st.st_ino);
+	printf("link_check: found [%ju, %ju]\n",
+	(uintmax_t)curino->st.st_dev,
+	(uintmax_t)curino->st.st_ino);
 			}
 		}
 		if (S_ISLNK(cur->type)) {
 			char	slink[PATH_MAX+1];
-			int	llen;
+			ssize_t	llen;
 
 			llen = readlink(path, slink, sizeof(slink) - 1);
 			if (llen == -1)
@@ -594,9 +595,9 @@ apply_specentry(const char *dir, NODE *s
 	}
 		/* XXX: ignoring F_NLINK for now */
 	if (specnode->flags & F_SIZE) {
-		ASEPRINT("size", "%lld",
-		(long long)dirnode->inode->st.st_size,
-		(long long)specnode->st_size);
+		ASEPRINT("size", "%jd",
+		(intmax_t)dirnode->inode->st.st_size,
+		(intmax_t)specnode->st_size);
 		dirnode->inode->st.st_size = specnode->st_size;
 	}
 	if (specnode->flags & F_SLINK) {
@@ -629,13 +630,13 @@ apply_specentry(const char *dir, NODE *s
 		ASEPRINT("flags", "%#lX",
 		(unsigned long)dirnode->inode->st.st_flags,
 		(unsigned long)specnode->st_flags);
-		dirnode->inode->st.st_flags = specnode->st_flags;
+		dirnode->inode->st.st_flags = (unsigned int)specnode->st_flags;
 	}
 #endif
 	if (specnode->flags & F_DEV) {
-		ASEPRINT("rdev", "%#llx",
-		(unsigned long long)dirnode->inode->st.st_rdev,
-		(unsigned long long)specnode->st_rdev);
+		ASEPRINT("rdev", "%#jx",
+		(uintmax_t)dirnode->inode->st.st_rdev,
+		(uintmax_t)specnode->st_rdev);
 		dirnode->inode->st.st_rdev = specnode->st_rdev;
 	}
 #undef ASEPRINT
@@ -712,16 +713,16 @@ link_check(fsinode *entry)
 	static struct entry {
 		fsinode *data;
 	} *htable;
-	static int htshift;  /* log(allocated size) */
-	static int htmask;   /* allocated size - 1 */
-	static int htused;   /* 2*number of insertions */
-	int h, h2;
+	static size_t htshift;  /* log(allocated size) */
+	static size_t htmask;   /* allocated size - 1 */
+	static size_t htused;   /* 2*number of insertions */
+	size_t h, h2;
 	uint64_t tmp;
 	/* this constant is (1<<64)/((1+sqrt(5))/2)
 	 * aka (word size)/(golden ratio)
 	 */
 	const uint64_t HTCONST = 11400714819323198485ULL;
-	const int HTBITS = 64;
+	const size_t HTBITS = 64;
 
 	/* Never store zero in hashtable */
 	assert(entry);
@@ -742,8 +743,7 @@ link_check(fsinode *entry)
 		htable = ecalloc(htmask+1, sizeof(*htable));
 		/* populate newly allocated hashtable */
 		if (ohtable) {
-			int i;
-			for (i = 0; i <= htmask>>1; i++)
+			for (size_t i = 0; i <= htmask>>1; i++)
 if (ohtable[i].data)
 	link_check(ohtable[i].data);
 			free(ohtable);



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:18:56 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
pass lint, simplify


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:12:48 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: Fix symlink permission bits

Permission bits for symlinks are taken straight from `lstat()`. However, the
actual bits presented to the user are filesystem/kernel specific. For example,
Linux with ext2/3/4 will use 0777 for symlinks, whereas NetBSD/FFS will
show 0755. As far as `makefs` is in the loop, the target filesystem will likely
be FFS, so use 0755.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:12:48 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: Fix symlink permission bits

Permission bits for symlinks are taken straight from `lstat()`. However, the
actual bits presented to the user are filesystem/kernel specific. For example,
Linux with ext2/3/4 will use 0777 for symlinks, whereas NetBSD/FFS will
show 0755. As far as `makefs` is in the loop, the target filesystem will likely
be FFS, so use 0755.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.34 src/usr.sbin/makefs/walk.c:1.35
--- src/usr.sbin/makefs/walk.c:1.34	Tue Apr 23 18:12:16 2024
+++ src/usr.sbin/makefs/walk.c	Tue Apr 23 18:12:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.34 2024/04/23 22:12:16 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.35 2024/04/23 22:12:48 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.34 2024/04/23 22:12:16 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.35 2024/04/23 22:12:48 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -154,6 +154,15 @@ walk_dir(const char *root, const char *d
 		} else {
 			if (lstat(path, ) == -1)
 err(EXIT_FAILURE, "Can't lstat `%s'", path);
+			/* As symlink permission bits vary between filesystems
+			   (ie. 0755 on FFS/NetBSD, 0777 for ext[234]/Linux),
+			   force them to 0755.  */
+			if (S_ISLNK(stbuf.st_mode)) {
+stbuf.st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO);
+stbuf.st_mode |= S_IRWXU
+ | S_IRGRP | S_IXGRP
+ | S_IROTH | S_IXOTH;
+			}
 		}
 #ifdef S_ISSOCK
 		if (S_ISSOCK(stbuf.st_mode & S_IFMT)) {



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:12:16 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: Sort directory contents by name (Jan-Benedict Glaw)

`makefs` inserts nodes into its internal data structures in the order as
returned by `readdir()` calls. As this is unpredictable, sort entries by
name before creating the target filesystem.

  This is done by first converting the (per-directory) linked list into
a plain array, sort it, finally re-link the list. Special case for the
sorting function: The "." directory entry seems to be ment to be always
at the front, so always check that first.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/makefs

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 22:12:16 UTC 2024

Modified Files:
src/usr.sbin/makefs: walk.c

Log Message:
makefs: Sort directory contents by name (Jan-Benedict Glaw)

`makefs` inserts nodes into its internal data structures in the order as
returned by `readdir()` calls. As this is unpredictable, sort entries by
name before creating the target filesystem.

  This is done by first converting the (per-directory) linked list into
a plain array, sort it, finally re-link the list. Special case for the
sorting function: The "." directory entry seems to be ment to be always
at the front, so always check that first.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/makefs/walk.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/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.33 src/usr.sbin/makefs/walk.c:1.34
--- src/usr.sbin/makefs/walk.c:1.33	Thu Dec 28 07:13:55 2023
+++ src/usr.sbin/makefs/walk.c	Tue Apr 23 18:12:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.33 2023/12/28 12:13:55 tsutsui Exp $	*/
+/*	$NetBSD: walk.c,v 1.34 2024/04/23 22:12:16 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.33 2023/12/28 12:13:55 tsutsui Exp $");
+__RCSID("$NetBSD: walk.c,v 1.34 2024/04/23 22:12:16 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -66,6 +66,24 @@ static	fsnode	*create_fsnode(const char 
 			   struct stat *);
 static	fsinode	*link_check(fsinode *);
 
+/*
+ * fsnode_cmp --
+ *	This function is used by `qsort` so sort one directory's
+ *	entries.  `.` is always first, sollowed by anything else
+ *	as compared by `strcmp()`.
+ */
+static int
+fsnode_cmp (const void *_left, const void *_right)
+{
+	const fsnode * const left  = *(const fsnode * const *)_left;
+	const fsnode * const right = *(const fsnode * const *)_right;
+
+	if (strcmp (left->name, ".") == 0)
+		return -1;
+	if (strcmp (right->name, ".") == 0)
+		return 1;
+	return strcmp (left->name, right->name);
+}
 
 /*
  * walk_dir --
@@ -87,6 +105,9 @@ walk_dir(const char *root, const char *d
 	char		*name, *rp;
 	int		dot, len;
 
+	fsnode **list, **listptr;
+	int num = 0;
+
 	assert(root != NULL);
 	assert(dir != NULL);
 
@@ -241,7 +262,36 @@ walk_dir(const char *root, const char *d
 			cur->first = first;
 	if (closedir(dirp) == -1)
 		err(EXIT_FAILURE, "Can't closedir `%s/%s'", root, dir);
-	return (first);
+
+	/*
+	 * Sort entries.
+	 */
+	/* Create a plain list: Count, alloc, add.  */
+	for (fsnode *tmp = first; tmp; tmp = tmp->next) {
+		num++;
+		if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
+			printf ("pre sort: %s %s %s\n", root, dir, tmp->name);
+	}
+	list = listptr = ecalloc (num, sizeof (*list));
+	for (fsnode *tmp = first; tmp; tmp = tmp->next)
+		*listptr++ = tmp;
+	/* Sort plain list.  */
+	qsort (list, num, sizeof (*list), _cmp);
+	/* Rewire.  */
+	for (int i = 0; i < num - 1; ++i)
+		list[i]->next = list[i+1];
+	list[num - 1]->next = NULL;
+	first = list[0];
+	/* Check `first` to be ".".  */
+	assert (strcmp (first->name, ".") == 0);
+	/* Free.  */
+	free (list);
+	/* Dump sorted state.  */
+	if (debug & DEBUG_DUMP_FSNODES_VERBOSE)
+		for (fsnode *tmp = first; tmp; tmp = tmp->next)
+			printf ("post sort: %s %s %s\n", root, dir, tmp->name);
+
+	return first;
 }
 
 static fsnode *



CVS commit: src/usr.sbin/sysinst

2024-04-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 11 06:42:18 UTC 2024

Modified Files:
src/usr.sbin/sysinst: mbr.c

Log Message:
fix typo in method name: part_attr_fornat_str -> part_attr_format_str.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/mbr.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/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.47 src/usr.sbin/sysinst/mbr.c:1.48
--- src/usr.sbin/sysinst/mbr.c:1.47	Thu Feb  8 20:51:24 2024
+++ src/usr.sbin/sysinst/mbr.c	Thu Apr 11 06:42:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.47 2024/02/08 20:51:24 andvar Exp $ */
+/*	$NetBSD: mbr.c,v 1.48 2024/04/11 06:42:18 andvar Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -2829,7 +2829,7 @@ struct part_attr_set_data {
 };
 
 static bool
-part_attr_fornat_str(const struct disk_partitions *arg, part_id id,
+part_attr_format_str(const struct disk_partitions *arg, part_id id,
 const mbr_info_t *mb, int i, bool primary,
 const struct mbr_partition *mp, void *cookie)
 {
@@ -2942,7 +2942,7 @@ mbr_custom_attribute_format(const struct
 	data.parts = parts;
 	data.info = info;
 
-	return mbr_part_apply(arg, id, part_attr_fornat_str, );
+	return mbr_part_apply(arg, id, part_attr_format_str, );
 }
 
 static bool



CVS commit: src/usr.sbin/sysinst

2024-04-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 11 06:42:18 UTC 2024

Modified Files:
src/usr.sbin/sysinst: mbr.c

Log Message:
fix typo in method name: part_attr_fornat_str -> part_attr_format_str.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/mbr.c

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



CVS commit: src/usr.sbin/postinstall

2024-04-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  5 16:44:54 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
remove dup named dir


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.62 src/usr.sbin/postinstall/postinstall.in:1.63
--- src/usr.sbin/postinstall/postinstall.in:1.62	Sun Mar 10 14:23:18 2024
+++ src/usr.sbin/postinstall/postinstall.in	Fri Apr  5 12:44:54 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.62 2024/03/10 18:23:18 rillig Exp $
+# $NetBSD: postinstall.in,v 1.63 2024/04/05 16:44:54 christos Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1706,6 +1706,12 @@ do_named()
 	compare_dir "${op}" "${SRC_DIR}/etc/namedb" "${DEST_DIR}/etc/namedb" \
 		644 \
 		root.cache
+
+	local od="${DEST_DIR}/usr/libexec/named"
+	if [ -d "$od" ]; then
+		rm -fr "$od"
+		msg "Removed obsolete '${od}'"
+	fi
 }
 
 



CVS commit: src/usr.sbin/postinstall

2024-04-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  5 16:44:54 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
remove dup named dir


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/mountd

2024-03-29 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Mar 29 22:50:27 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): mark up the list of groups to --maproot  as optional


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/mountd

2024-03-29 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Mar 29 22:50:27 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): mark up the list of groups to --maproot  as optional


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.38 src/usr.sbin/mountd/exports.5:1.39
--- src/usr.sbin/mountd/exports.5:1.38	Fri Mar 29 14:15:02 2024
+++ src/usr.sbin/mountd/exports.5	Fri Mar 29 22:50:27 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.38 2024/03/29 14:15:02 riastradh Exp $
+.\"	$NetBSD: exports.5,v 1.39 2024/03/29 22:50:27 uwe Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -155,7 +155,7 @@ on the local machine
 .Pc .
 The user may be specified by name or number.
 .Sm off
-.It Fl maproot Li = Ar user\^ Li \&: Ar group1\^ Li \&: group2\^ Li \&: Ar ...
+.It Fl maproot Li = Ar user\^ Li \&: Op Ar group1\^ Li \&: group2\^ Li \&: Ar ...
 .Sm on
 The colon separated list is used to specify the precise credential
 to be used for remote access by root.
@@ -167,13 +167,13 @@ should be used to distinguish a credenti
 complete credential for that user.
 .Sm off
 .It Fl mapall Li = Ar user
-.It Fl mapall Li = Ar user\^ Li \&: Ar group1\^ Li \&: Ar group2\^ Li \&: Ar ...
+.It Fl mapall Li = Ar user\^ Li \&: Op Ar group1\^ Li \&: Ar group2\^ Li \&: Ar ...
 .Sm on
 Mapping for all client uids (including root)
 using the same semantics as
 .Fl maproot .
 .It Fl r Ar user
-.It Fl r Ar user\^ Ns Li \&: Ns Ar group1\^ Ns Li \&: Ns Ar group2\^ Ns Li \&: Ns Ar ...
+.It Fl r Ar user\^ Ns Li \&: Ns Op Ar group1\^ Ns Li \&: Ns Ar group2\^ Ns Li \&: Ns Ar ...
 Synonym for
 .Fl maproot ,
 for compatibility with older export file formats.



CVS commit: src/usr.sbin/mountd

2024-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 29 14:15:02 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Tiny punctuation fix in man page.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.37 src/usr.sbin/mountd/exports.5:1.38
--- src/usr.sbin/mountd/exports.5:1.37	Fri Mar 29 00:23:05 2024
+++ src/usr.sbin/mountd/exports.5	Fri Mar 29 14:15:02 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.37 2024/03/29 00:23:05 snj Exp $
+.\"	$NetBSD: exports.5,v 1.38 2024/03/29 14:15:02 riastradh Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -408,7 +408,7 @@ directory within
 .Pa /u2
 and mapping all uids to credentials for the principal
 that is authenticated by a Kerberos ticket.
-.Pq Sy Kerberos not implemented .
+.Pq Sy Kerberos not implemented.
 .It Pa /a
 is exported to the network
 .Ql 192.168.0.0 ,



CVS commit: src/usr.sbin/mountd

2024-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 29 14:15:02 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Tiny punctuation fix in man page.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/moused

2024-03-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Mar 29 06:13:40 UTC 2024

Modified Files:
src/usr.sbin/moused: moused.c

Log Message:
moused: remove undocumented and unused option 'C'


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/moused/moused.c

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



CVS commit: src/usr.sbin/moused

2024-03-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Mar 29 06:13:40 UTC 2024

Modified Files:
src/usr.sbin/moused: moused.c

Log Message:
moused: remove undocumented and unused option 'C'


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/moused/moused.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/moused/moused.c
diff -u src/usr.sbin/moused/moused.c:1.30 src/usr.sbin/moused/moused.c:1.31
--- src/usr.sbin/moused/moused.c:1.30	Sat Jun 24 05:15:42 2023
+++ src/usr.sbin/moused/moused.c	Fri Mar 29 06:13:40 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: moused.c,v 1.30 2023/06/24 05:15:42 msaitoh Exp $ */
+/* $NetBSD: moused.c,v 1.31 2024/03/29 06:13:40 rillig Exp $ */
 /**
  ** Copyright (c) 1995 Michael Smith, All rights reserved.
  **
@@ -48,7 +48,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: moused.c,v 1.30 2023/06/24 05:15:42 msaitoh Exp $");
+__RCSID("$NetBSD: moused.c,v 1.31 2024/03/29 06:13:40 rillig Exp $");
 #endif /* not lint */
 
 #include 
@@ -685,15 +685,6 @@ main(int argc, char *argv[])
 	}
 	break;
 
-	case 'C':
-	rodent.clickthreshold = atoi(optarg);
-	if ((rodent.clickthreshold < 0) || 
-	(rodent.clickthreshold > MAX_CLICKTHRESHOLD)) {
-	warnx("invalid argument `%s'", optarg);
-	usage();
-	}
-	break;
-
 	case 'D':
 	rodent.flags |= ClearDTR;
 	break;



CVS commit: src/usr.sbin/mountd

2024-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Mar 29 00:23:06 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
pick some nits


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.36 src/usr.sbin/mountd/exports.5:1.37
--- src/usr.sbin/mountd/exports.5:1.36	Wed Mar 27 13:11:14 2024
+++ src/usr.sbin/mountd/exports.5	Fri Mar 29 00:23:05 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.36 2024/03/27 13:11:14 uwe Exp $
+.\"	$NetBSD: exports.5,v 1.37 2024/03/29 00:23:05 snj Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -70,7 +70,7 @@ or
 Warning:
 Exporting a directory exposes the
 .Em entire
-content of the filesystem that the directory lives in to
+contents of the filesystem that the directory lives in to
 .Tn NFS
 clients.
 .Ef
@@ -312,7 +312,7 @@ A, B or C; see
 .Xr inet 4
 .Pc .
 .Pp
-Scoped IPv6 address must carry scope identifier as documented in
+Scoped IPv6 address must carry a scope identifier as documented in
 .Xr inet6 4 .
 For example,
 .Ql fe80::%ne2/10
@@ -338,11 +338,11 @@ The default remote mount-point file.
 .Pp
 If you have modified the
 .Pa /etc/exports
-file, send the mountd a
+file, send the mountd process a
 .Dv SIGHUP
 to make it re-read it:
 .Pp
-.Dl "kill -HUP $(cat /var/run/mountd.pid)" .
+.Dl "kill -HUP $(cat /var/run/mountd.pid)"
 .Sh EXAMPLES
 .Bd -literal -offset indent
 /usr /usr/local -maproot=0:10 friends



CVS commit: src/usr.sbin/mountd

2024-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Mar 29 00:23:06 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
pick some nits


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/mountd

2024-03-27 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Mar 27 13:11:14 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): improve mark up


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/mountd

2024-03-27 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Mar 27 13:11:14 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): improve mark up


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.35 src/usr.sbin/mountd/exports.5:1.36
--- src/usr.sbin/mountd/exports.5:1.35	Wed Mar 27 01:43:26 2024
+++ src/usr.sbin/mountd/exports.5	Wed Mar 27 13:11:14 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.35 2024/03/27 01:43:26 riastradh Exp $
+.\"	$NetBSD: exports.5,v 1.36 2024/03/27 13:11:14 uwe Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)exports.5	8.3 (Berkeley) 3/29/95
 .\"
-.Dd October 8, 2006
+.Dd March 27, 2024
 .Dt EXPORTS 5
 .Os
 .Sh NAME
@@ -55,16 +55,16 @@ Each entry in
 is a line with a list of directories followed by a list of hosts,
 netgroups, and options, separated by spaces or tabs:
 .Pp
-.Dl Pf / Va dir "..." Oo Va host | Va netgroup | Fl Va option Oc "..."
+.D1 Li / Ns Ar dir Li ... Oo Ar host | Ar netgroup | Fl Ar option Oc Li ...
 .Pp
 All directories in a single line must live in the same filesystem,
 which is exported to the hosts and netgroups listed, according to the
 options specified.
 Exported directories must not have pathname components that are
 symbolic links,
-.Ql "." ,
+.Ql \&. ,
 or
-.Ql ".." .
+.Ql \&.. .
 .Pp
 .Bf -symbolic
 Warning:
@@ -110,8 +110,9 @@ must come before any hosts, netgroups, o
 Options begin with
 .Ql - .
 All other items on an export line are interpreted either as netgroups
-(see
-.Xr netgroup 5 )
+.Po see
+.Xr netgroup 5
+.Pc
 or as hosts, which can be either names, as in example.com, or numbers,
 as in 192.0.2.123 or 2001:db8:1234:abcd::42.
 Sets of hosts in a contiguous network range can be specified with the
@@ -129,7 +130,7 @@ options are exported to
 hosts on the network, with no access control.
 .Pp
 Supported export options:
-.Bl -tag -width ".Fl noresvport"
+.Bl -tag -width Fl
 .It Fl alldirs
 Allow mount requests from clients at any point within the filesystem,
 including regular files.
@@ -144,39 +145,40 @@ A client
 can still access the whole filesystem via individual RPCs if it
 wanted to, even if just one subdirectory has been mounted.
 .Sm off
-.It Fl maproot No = Ar user
+.It Fl maproot Li = Ar user
 .Sm on
 The credential of the specified user is used for remote access by root.
 The credential includes all the groups to which the user is a member
-on the local machine (see
-.Xr id 1 ) .
+on the local machine
+.Po see
+.Xr id 1
+.Pc .
 The user may be specified by name or number.
 .Sm off
-.It Fl maproot No = Ar user : group1 : group2 : ...
+.It Fl maproot Li = Ar user\^ Li \&: Ar group1\^ Li \&: group2\^ Li \&: Ar ...
 .Sm on
 The colon separated list is used to specify the precise credential
 to be used for remote access by root.
 The elements of the list may be either names or numbers.
 Note that
-.Sm off
-.Ql Ar user ":"
-.Sm on
+.Sq Ar user\^ Ns Li \&:
+(with the trailing colon)
 should be used to distinguish a credential containing no groups from a
 complete credential for that user.
 .Sm off
-.It Fl mapall No = Ar user
-.It Fl mapall No = Ar user : group1 : group2 : ...
+.It Fl mapall Li = Ar user
+.It Fl mapall Li = Ar user\^ Li \&: Ar group1\^ Li \&: Ar group2\^ Li \&: Ar ...
 .Sm on
 Mapping for all client uids (including root)
 using the same semantics as
 .Fl maproot .
 .It Fl r Ar user
-.It Fl r Ar user Ns : Ns Ar group1 Ns : Ns Ar group2 Ns : Ar ...
+.It Fl r Ar user\^ Ns Li \&: Ns Ar group1\^ Ns Li \&: Ns Ar group2\^ Ns Li \&: Ns Ar ...
 Synonym for
 .Fl maproot ,
 for compatibility with older export file formats.
 .Pp
-Note:
+.Em Note :
 Not a synonym for the read-only option
 .Fl ro .
 .El
@@ -196,7 +198,7 @@ If a
 option is given,
 all users (including root) will be mapped to that credential in
 place of their own.
-.Bl -tag -width ".Fl noresvport"
+.Bl -tag -width Fl
 .It Fl kerb
 Specifies that the Kerberos authentication server should be
 used to authenticate and map client credentials.
@@ -204,8 +206,11 @@ used to authenticate and map client cred
 .It Fl ro
 Export filesystem read-only.
 Clients will be forbidden to change or write to anything in the
-filesystem (except for named pipes, sockets, and device nodes, where
-write semantics is client-side anyway).
+filesystem
+.Po
+except for named pipes, sockets, and device nodes, where
+write semantics is client-side anyway
+.Pc .
 .It Fl o
 Synonym for
 .Fl ro
@@ -226,9 +231,7 @@ Using this option decreases the security
 (WebNFS)
 Enables WebNFS export, equivalent to combining
 .Fl public ,
-.Sm off
-.Fl mapall No = Ar nobody ,
-.Sm on
+.Fl mapall=nobody ,
 and
 .Fl ro .
 .It Fl 

CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 27 01:43:26 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Substantially rewrite for clarity.

Hope this is an improvement over the turgid paragraphs all about
first/second/third cases of everything.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.34 src/usr.sbin/mountd/exports.5:1.35
--- src/usr.sbin/mountd/exports.5:1.34	Wed Mar 27 00:46:17 2024
+++ src/usr.sbin/mountd/exports.5	Wed Mar 27 01:43:26 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.34 2024/03/27 00:46:17 riastradh Exp $
+.\"	$NetBSD: exports.5,v 1.35 2024/03/27 01:43:26 riastradh Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -39,116 +39,147 @@
 mount requests
 .Sh DESCRIPTION
 The
-.Nm exports
+.Nm
 file on an
 .Tn NFS
-server, used by
-.Xr mountd 8 ,
-lists filesystems to be exported to
+server lists filesystems to be exported to
 .Tn NFS
 clients.
+It is read and applied by
+.Xr mountd 8
+on start and on
+.Dv SIGHUP .
+.Pp
+Each entry in
+.Nm
+is a line with a list of directories followed by a list of hosts,
+netgroups, and options, separated by spaces or tabs:
+.Pp
+.Dl Pf / Va dir "..." Oo Va host | Va netgroup | Fl Va option Oc "..."
+.Pp
+All directories in a single line must live in the same filesystem,
+which is exported to the hosts and netgroups listed, according to the
+options specified.
+Exported directories must not have pathname components that are
+symbolic links,
+.Ql "." ,
+or
+.Ql ".." .
 .Pp
+.Bf -symbolic
+Warning:
 Exporting a directory exposes the
 .Em entire
 content of the filesystem that the directory lives in to
 .Tn NFS
-clients, even it it isn't the root directory of a filesystem on the
-server.
-The list of exports is only what the server advertises to clients in
-the mount protocol, not a restriction on what files or directories
-within exported filesystems clients have access to with
-.Tn NFS .
-.Pp
-Each line in the file
-(other than comment lines that begin with a
-.Sq # )
-specifies the mount point(s) and export flags within one local server
-filesystem for one or more hosts.
-A host may be specified only once for each local filesystem on the
-server and there may be only one default entry for each server
-filesystem that applies to all other hosts.
-The latter exports the filesystem to the
-.Dq world
-and should
-be used only when the filesystem contains public information.
+clients.
+.Ef
+This happens even if an exported directory is not the root directory of
+a filesystem on the server.
+.Tn NFS
+clients are only prevented from access to files and directories on
+filesystems that are
+.Em not
+exported at all.
 .Pp
-If you have modified the
-.Pa /etc/exports
-file, send the mountd a SIGHUP to make it re-read the
-.Pa /etc/exports
-file:
-.Dq kill -HUP `cat /var/run/mountd.pid` .
+.Bf -symbolic
+Warning:
+Access control is only by network address.
+.Ef
+.Tn NFS
+servers with any non-public data should be exposed only to restricted
+or firewalled networks with ingress filtering.
+There is no authentication or encryption to make it safe for
+restricting access on the open internet.
+.Pp
+Blank lines are ignored.
+Text beginning with
+.Ql #
+until the end of line is ignored as a comment.
+Each line ending with
+.Ql \e
+has the next line appended, without the
+.Ql \e ,
+as a continuation line.
+Characters can be escaped with
+.Ql \e .
+.Pp
+All directories, which begin with
+.Ql / ,
+must come before any hosts, netgroups, or options on a line.
+Options begin with
+.Ql - .
+All other items on an export line are interpreted either as netgroups
+(see
+.Xr netgroup 5 )
+or as hosts, which can be either names, as in example.com, or numbers,
+as in 192.0.2.123 or 2001:db8:1234:abcd::42.
+Sets of hosts in a contiguous network range can be specified with the
+.Fl network
+option.
 .Pp
-In a mount entry,
-the first field(s) specify the directory path(s) within a server filesystem
-that can be mounted on by the corresponding client(s).
-There are two forms of this specification.
-The first is to list all mount points as absolute
-directory paths separated by whitespace.
-The second is to specify the pathname of the root of the filesystem
-followed by the
-.Fl alldirs
-flag;
-this form allows the host(s) to mount at any point within the filesystem,
+The same filesystem may be exported on multiple lines with different
+options to different sets of hosts, as long as it is exported at most
+once to each host, netgroup, or network.
+.Pp
+Export lines with no hosts, netgroups, or
+.Fl network
+options are exported to
+.Em any
+hosts on the network, with no access control.

CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 27 01:43:26 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Substantially rewrite for clarity.

Hope this is an improvement over the turgid paragraphs all about
first/second/third cases of everything.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 27 00:46:17 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Revert warning about `-ro' on read/write file systems.

Looks like the nfs server does enforce that after all, in spite of
the rather oblique commentary in the BUGS section about export
options being tied to local mount point options with which they must
be noncontradictory.

And there's no reason in principle it shouldn't enforce this -- it
just need to block various file system _operations_, rather than the
subtree issue where the criteria for evaluating whether operations
are allowed on particular _file handles_ are too painful to
contemplate.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/mountd/exports.5

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/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.33 src/usr.sbin/mountd/exports.5:1.34
--- src/usr.sbin/mountd/exports.5:1.33	Tue Mar 26 23:32:43 2024
+++ src/usr.sbin/mountd/exports.5	Wed Mar 27 00:46:17 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.33 2024/03/26 23:32:43 riastradh Exp $
+.\"	$NetBSD: exports.5,v 1.34 2024/03/27 00:46:17 riastradh Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -174,33 +174,14 @@ This option is currently not implemented
 .Pp
 The
 .Fl ro
-option should be specified for filesystems that are read-only (default
-is to assume read/write).
+option specifies that the filesystem should be exported read-only
+(default read/write).
 The option
 .Fl o
 is a synonym for
 .Fl ro
 in an effort to be backward compatible with older export file formats.
 .Pp
-.Bf -symbolic
-Warning:
-Exporting a read/write filesystem with
-.Fl ro
-.Em does not
-prevent clients from writing to it.
-.Ef
-To prevent clients from writing to a filesystem, it must be mounted
-read-only
-.Em on the server
-in the first place.
-To export a read/write filesystem so clients can only read from it, not
-write to it, you can mount a read-only nullfs from the filesystem with
-.Xr mount_null 8
-using the
-.Fl o Cm ro
-option, and then export the read-only nullfs instead.
-See also caveats about nullfs namespace below.
-.Pp
 The
 .Fl noresvport
 option specifies that NFS RPC calls for the filesystem do not have to come
@@ -424,7 +405,7 @@ systems.
 .Pp
 .Pp
 Filesystems that provide a namespace for a subtree of another
-filesystem such as nullfs 
+filesystem such as nullfs
 .No ( Xr mount_null 8 )
 and umapfs
 .No ( Xr mount_umap 8 )



CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 27 00:46:17 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5

Log Message:
exports(5): Revert warning about `-ro' on read/write file systems.

Looks like the nfs server does enforce that after all, in spite of
the rather oblique commentary in the BUGS section about export
options being tied to local mount point options with which they must
be noncontradictory.

And there's no reason in principle it shouldn't enforce this -- it
just need to block various file system _operations_, rather than the
subtree issue where the criteria for evaluating whether operations
are allowed on particular _file handles_ are too painful to
contemplate.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/mountd/exports.5

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



CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 26 23:32:43 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5 mountd.8

Log Message:
exports(5), mountd(8): First pass at clarifying export semantics.

The exports(5) man page is full of walls of turgid prose that should
be itemized lists with syntax templates, and I'm itching to rewrite
it, but let's get the security-relevant warnings out of the way
first.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/mountd/exports.5
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/mountd/mountd.8

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

Modified files:

Index: src/usr.sbin/mountd/exports.5
diff -u src/usr.sbin/mountd/exports.5:1.32 src/usr.sbin/mountd/exports.5:1.33
--- src/usr.sbin/mountd/exports.5:1.32	Thu Mar 28 22:54:25 2013
+++ src/usr.sbin/mountd/exports.5	Tue Mar 26 23:32:43 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: exports.5,v 1.32 2013/03/28 22:54:25 njoly Exp $
+.\"	$NetBSD: exports.5,v 1.33 2024/03/26 23:32:43 riastradh Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -34,22 +34,30 @@
 .Os
 .Sh NAME
 .Nm exports
-.Nd define remote mount points for
+.Nd exported filesystem mount points for
 .Tn NFS
 mount requests
-.Sh SYNOPSIS
-.Nm exports
 .Sh DESCRIPTION
 The
 .Nm exports
-file specifies remote mount points for the
+file on an
 .Tn NFS
-mount protocol per the
+server, used by
+.Xr mountd 8 ,
+lists filesystems to be exported to
 .Tn NFS
-server specification; see
-.%T "Network File System Protocol Specification RFC 1094, Appendix A"
-and
-.%T "NFS: Network File System Version 3 Specification, Appendix I" .
+clients.
+.Pp
+Exporting a directory exposes the
+.Em entire
+content of the filesystem that the directory lives in to
+.Tn NFS
+clients, even it it isn't the root directory of a filesystem on the
+server.
+The list of exports is only what the server advertises to clients in
+the mount protocol, not a restriction on what files or directories
+within exported filesystems clients have access to with
+.Tn NFS .
 .Pp
 Each line in the file
 (other than comment lines that begin with a
@@ -166,14 +174,33 @@ This option is currently not implemented
 .Pp
 The
 .Fl ro
-option specifies that the filesystem should be exported read-only
-(default read/write).
+option should be specified for filesystems that are read-only (default
+is to assume read/write).
 The option
 .Fl o
 is a synonym for
 .Fl ro
 in an effort to be backward compatible with older export file formats.
 .Pp
+.Bf -symbolic
+Warning:
+Exporting a read/write filesystem with
+.Fl ro
+.Em does not
+prevent clients from writing to it.
+.Ef
+To prevent clients from writing to a filesystem, it must be mounted
+read-only
+.Em on the server
+in the first place.
+To export a read/write filesystem so clients can only read from it, not
+write to it, you can mount a read-only nullfs from the filesystem with
+.Xr mount_null 8
+using the
+.Fl o Cm ro
+option, and then export the read-only nullfs instead.
+See also caveats about nullfs namespace below.
+.Pp
 The
 .Fl noresvport
 option specifies that NFS RPC calls for the filesystem do not have to come
@@ -369,6 +396,23 @@ The default remote mount-point file.
 .Xr mountd 8 ,
 .Xr nfsd 8 ,
 .Xr showmount 8
+.Rs
+.%T NFS: Network File System Protocol Specification
+.%R RFC 1094
+.%I IETF Network Working Group
+.%O Appendix A
+.%U https://datatracker.ietf.org/doc/html/rfc1094#appendix-A.1
+.Re
+.Rs
+.%A B. Callaghan
+.%A B. Pawlowski
+.%A P. Staubach
+.%T NFS Version 3 Protocol Specification
+.%R RFC 1813
+.%I IETF Network Working Group
+.%O Appendix I
+.%U https://datatracker.ietf.org/doc/html/rfc1813#section-5.0
+.Re
 .Sh CAVEATS
 Don't re-export NFS-mounted filesystems unless you are sure of the
 implications.
@@ -377,6 +421,21 @@ systems being exported, e.g. when timest
 Re-exporting should work to some extent and can even be useful in
 some cases, but don't expect it works as well as with local file
 systems.
+.Pp
+.Pp
+Filesystems that provide a namespace for a subtree of another
+filesystem such as nullfs 
+.No ( Xr mount_null 8 )
+and umapfs
+.No ( Xr mount_umap 8 )
+.Em do not
+restrict
+.Tn NFS
+clients to that namespace, so they cannot be used to securely limit
+.Tn NFS
+clients to a subtree of a filesystem.
+If you want to export one subtree and prevent access to other subtrees,
+the exported subtree must be on its own filesystem on the server.
 .Sh BUGS
 The export options are tied to the local mount points in the kernel and
 must be non-contradictory for any exported subdirectory of the local

Index: src/usr.sbin/mountd/mountd.8
diff -u src/usr.sbin/mountd/mountd.8:1.42 src/usr.sbin/mountd/mountd.8:1.43
--- src/usr.sbin/mountd/mountd.8:1.42	Wed Mar 15 20:39:12 2023
+++ src/usr.sbin/mountd/mountd.8	Tue Mar 26 23:32:43 2024
@@ -1,4 +1,4 @@
-.\"	

CVS commit: src/usr.sbin/mountd

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 26 23:32:43 UTC 2024

Modified Files:
src/usr.sbin/mountd: exports.5 mountd.8

Log Message:
exports(5), mountd(8): First pass at clarifying export semantics.

The exports(5) man page is full of walls of turgid prose that should
be itemized lists with syntax templates, and I'm itching to rewrite
it, but let's get the security-relevant warnings out of the way
first.

PR misc/58063


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/mountd/exports.5
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/mountd/mountd.8

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



CVS commit: src/usr.sbin/sysinst

2024-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 17:29:58 UTC 2024

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/gpt.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/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.31 src/usr.sbin/sysinst/gpt.c:1.32
--- src/usr.sbin/sysinst/gpt.c:1.31	Thu Feb  8 20:51:24 2024
+++ src/usr.sbin/sysinst/gpt.c	Sun Mar 24 17:29:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.31 2024/02/08 20:51:24 andvar Exp $	*/
+/*	$NetBSD: gpt.c,v 1.32 2024/03/24 17:29:58 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -569,12 +569,14 @@ gpt_get_part_attr_str(const struct disk_
 static bool
 gpt_insert_part_into_list(struct gpt_disk_partitions *parts,
 struct gpt_part_entry **list,
-struct gpt_part_entry *entry, const char **err_msg)
+struct gpt_part_entry *entry, const char **err_msg, part_id *new_id)
 {
 	struct gpt_part_entry *p, *last;
+	part_id pno;
 
 	/* find the first entry past the new one (if any) */
-	for (last = NULL, p = *list; p != NULL; last = p, p = p->gp_next) {
+	for (pno = 0, last = NULL, p = *list; p != NULL;
+	last = p, p = p->gp_next, pno++) {
 		if (p->gp_start > entry->gp_start)
 			break;
 	}
@@ -609,7 +611,8 @@ gpt_insert_part_into_list(struct gpt_dis
 	}
 	if (*list == NULL)
 		*list = entry;
-
+	if (new_id != NULL)
+		*new_id = pno;
 	return true;
 }
 
@@ -651,7 +654,7 @@ gpt_set_part_info(struct disk_partitions
 			*n = *p;
 			p->gp_flags &= ~GPEF_ON_DISK;
 			if (!gpt_insert_part_into_list(parts, >obsolete,
-			n, err_msg))
+			n, err_msg, NULL))
 return false;
 		} else if (info->size != p->gp_size) {
 			p->gp_flags |= GPEF_RESIZED;
@@ -1076,6 +1079,7 @@ gpt_add_part(struct disk_partitions *arg
 	struct disk_part_free_space space;
 	struct disk_part_info data = *info;
 	struct gpt_part_entry *p, *n;
+	part_id pno;
 	bool ok;
 
 	if (err_msg != NULL)
@@ -1107,7 +,8 @@ gpt_add_part(struct disk_partitions *arg
 		return NO_PART;
 	}
 	p->gp_flags |= GPEF_MODIFIED;
-	ok = gpt_insert_part_into_list(parts, >partitions, p, err_msg);
+	ok = gpt_insert_part_into_list(parts, >partitions, p,
+	err_msg, );
 	if (ok) {
 		if (info->flags & PTI_INSTALL_TARGET) {
 			/* update target mark - we can only have one */
@@ -1119,7 +1124,7 @@ gpt_add_part(struct disk_partitions *arg
 
 		parts->dp.num_part++;
 		parts->dp.free_space -= p->gp_size;
-		return parts->dp.num_part-1;
+		return pno;
 	} else {
 		free(p);
 		return NO_PART;
@@ -1157,7 +1162,7 @@ gpt_delete_partition(struct disk_partiti
 	res = true;
 	if (p->gp_flags & GPEF_ON_DISK) {
 		if (!gpt_insert_part_into_list(parts, >obsolete,
-		p, err_msg))
+		p, err_msg, NULL))
 			res = false;
 	} else {
 		free(p);



CVS commit: src/usr.sbin/sysinst

2024-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 17:29:58 UTC 2024

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/gpt.c

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



CVS commit: src/usr.sbin/sysinst

2024-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 16:06:37 UTC 2024

Modified Files:
src/usr.sbin/sysinst: configmenu.c

Log Message:
PR 58062: fix a bug I introduced with the https support: update
the pkgsrc/binary pkgs download URL not only when https transport
is selected.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/configmenu.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/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.18 src/usr.sbin/sysinst/configmenu.c:1.19
--- src/usr.sbin/sysinst/configmenu.c:1.18	Sun Dec 17 18:46:42 2023
+++ src/usr.sbin/sysinst/configmenu.c	Sun Mar 24 16:06:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.18 2023/12/17 18:46:42 martin Exp $ */
+/* $NetBSD: configmenu.c,v 1.19 2024/03/24 16:06:37 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -340,12 +340,11 @@ set_binpkg(struct menudesc *menu, void *
 		 * Make sure we have the TLS certs in a usable state
 		 * (if target is a new installation)
 		 */
-		if (pkg.xfer == XFER_HTTPS) {
+		if (pkg.xfer == XFER_HTTPS)
 			run_program(RUN_CHROOT | RUN_SILENT,
 			"/bin/sh /etc/rc.d/certctl_init onestart");
-			make_url(pkgpath, , pkg_dir);
-		}
 
+		make_url(pkgpath, , pkg_dir);
 		if (run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
 			"pkg_add %s/pkgin", pkgpath) == 0) {
 			allok = 1;



CVS commit: src/usr.sbin/sysinst

2024-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 16:06:37 UTC 2024

Modified Files:
src/usr.sbin/sysinst: configmenu.c

Log Message:
PR 58062: fix a bug I introduced with the https support: update
the pkgsrc/binary pkgs download URL not only when https transport
is selected.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/configmenu.c

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



CVS commit: src/usr.sbin/usbdevs

2024-03-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Mar 24 03:23:19 UTC 2024

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
usbdevs(8): don't assume usb bus count is the same as max usb bus unit

keep track of the highest usbN value, not the count of busses.

fixes a problem where you do "drvctl -d usb0" (or a parent), and then
"usbdevs" won't print info on the last bus.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/usbdevs/usbdevs.c

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



CVS commit: src/usr.sbin/usbdevs

2024-03-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Mar 24 03:23:19 UTC 2024

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
usbdevs(8): don't assume usb bus count is the same as max usb bus unit

keep track of the highest usbN value, not the count of busses.

fixes a problem where you do "drvctl -d usb0" (or a parent), and then
"usbdevs" won't print info on the last bus.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/usbdevs/usbdevs.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/usbdevs/usbdevs.c
diff -u src/usr.sbin/usbdevs/usbdevs.c:1.41 src/usr.sbin/usbdevs/usbdevs.c:1.42
--- src/usr.sbin/usbdevs/usbdevs.c:1.41	Tue Sep 13 08:34:37 2022
+++ src/usr.sbin/usbdevs/usbdevs.c	Sun Mar 24 03:23:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs.c,v 1.41 2022/09/13 08:34:37 riastradh Exp $	*/
+/*	$NetBSD: usbdevs.c,v 1.42 2024/03/24 03:23:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,10 +31,10 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: usbdevs.c,v 1.41 2022/09/13 08:34:37 riastradh Exp $");
+__RCSID("$NetBSD: usbdevs.c,v 1.42 2024/03/24 03:23:19 mrg Exp $");
 #endif
 
-#include 
+#include 
 
 #include 
 
@@ -328,8 +328,12 @@ dumpone(char *name, int f, int addr)
 		usbdump(f);
 }
 
+/*
+ * Find the highest usb device unit.  Searches recursively
+ * thought the device list, tracking highest unit seen.
+ */
 static int
-getusbcount_device(int fd, const char *dev, int depth)
+get_highest_usb_device_unit(int fd, const char *dev, int depth)
 {
 	struct devlistargs laa = {
 		.l_childname = NULL,
@@ -337,19 +341,23 @@ getusbcount_device(int fd, const char *d
 	};
 	size_t i;
 	size_t children;
-	int nbusses = 0;
+	int highbus = 0;
 
 	if (depth && (dev == NULL || *dev == '\0'))
 		return 0;
 
 	/*
-	 * Look for children that match "usb[0-9]*".  Could maybe
+	 * Look for children that match "usb[0-9]*".  The high 
+	 * bus from this value, regardles
 	 * simply return 1 here, but there's always a chance that
 	 * someone has eg, a USB to PCI bridge, with a USB
 	 * controller behind PCI.
 	 */
-	if (strncmp(dev, "usb", 3) == 0 && isdigit((int)dev[3]))
-		nbusses++;
+	if (strncmp(dev, "usb", 3) == 0 && isdigit((int)dev[3])) {
+		int new_high = atoi(dev+3);
+
+		highbus = MAX(new_high, highbus);
+	}
 
 	strlcpy(laa.l_devname, dev, sizeof(laa.l_devname));
 
@@ -366,11 +374,14 @@ getusbcount_device(int fd, const char *d
 		err(EXIT_FAILURE, "DRVLISTDEV: number of children grew");
 
 	for (i = 0; i < laa.l_children; i++) {
-		nbusses += getusbcount_device(fd, laa.l_childname[i],
+		int new_high;
+
+		new_high = get_highest_usb_device_unit(fd, laa.l_childname[i],
 		depth + 1);
+		highbus = MAX(new_high, highbus);
 	}
 
-	return nbusses;
+	return highbus;
 }
 
 int
@@ -411,17 +422,17 @@ main(int argc, char **argv)
 	argv += optind;
 
 	if (dev == NULL) {
-		int nbusses;
+		int highbus;
 		int fd = open(DRVCTLDEV, O_RDONLY, 0);
 
 		/* If no drvctl configured, default to 16. */
 		if (fd != -1)
-			nbusses = getusbcount_device(fd, "", 0);
+			highbus = get_highest_usb_device_unit(fd, "", 0);
 		else
-			nbusses = 16;
+			highbus = 16;
 		close(fd);
 
-		for (ncont = 0, i = 0; i < nbusses; i++) {
+		for (ncont = 0, i = 0; i <= highbus; i++) {
 			snprintf(buf, sizeof(buf), "%s%d", USBDEV, i);
 			f = open(buf, O_RDONLY);
 			if (f >= 0) {



CVS commit: src/usr.sbin/sysinst

2024-03-20 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Mar 21 02:24:35 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.en

Log Message:
sysinst: Clarify that usernames are maximum 8 characters

At least one user reported thinking that the previous wording implied
that usernames required padding to 8 characters.

This syncs the english translation with the german.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/msg.mi.en

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/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.47 src/usr.sbin/sysinst/msg.mi.en:1.48
--- src/usr.sbin/sysinst/msg.mi.en:1.47	Tue Oct 31 14:03:33 2023
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Mar 21 02:24:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.47 2023/10/31 14:03:33 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.48 2024/03/21 02:24:35 nia Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1217,7 +1217,7 @@ message saveprompt {Save changes before 
 message cantsave {Changes cannot be saved.}
 message noroot {No root partition defined.  Cannot continue\n}
 
-message addusername {8 character username to add}
+message addusername {Username to add (maximum 8 characters)}
 message addusertowheel {Do you wish to add this user to group wheel?}
 
 message Delete_partition



CVS commit: src/usr.sbin/sysinst

2024-03-20 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Mar 21 02:24:35 UTC 2024

Modified Files:
src/usr.sbin/sysinst: msg.mi.en

Log Message:
sysinst: Clarify that usernames are maximum 8 characters

At least one user reported thinking that the previous wording implied
that usernames required padding to 8 characters.

This syncs the english translation with the german.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/msg.mi.en

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



CVS commit: src/usr.sbin/cpuctl

2024-03-18 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 19 01:19:11 UTC 2024

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

Log Message:
cpuctl.8: fix grammar in a sentence


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/cpuctl/cpuctl.8

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

Modified files:

Index: src/usr.sbin/cpuctl/cpuctl.8
diff -u src/usr.sbin/cpuctl/cpuctl.8:1.22 src/usr.sbin/cpuctl/cpuctl.8:1.23
--- src/usr.sbin/cpuctl/cpuctl.8:1.22	Tue Sep 12 20:45:17 2023
+++ src/usr.sbin/cpuctl/cpuctl.8	Tue Mar 19 01:19:11 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cpuctl.8,v 1.22 2023/09/12 20:45:17 wiz Exp $
+.\"	$NetBSD: cpuctl.8,v 1.23 2024/03/19 01:19:11 gutteridge Exp $
 .\"
 .\" Copyright (c) 2007, 2008, 2012, 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -83,7 +83,7 @@ already exists on the CPU in question ar
 If
 .Ar cpu
 is not specified or \-1, all CPUs are updated.
-(AMD CPU updates need to be update all CPUs at once.)
+(AMD CPU updates need to update all CPUs at once.)
 If
 .Ar cpu
 is \-2, the current CPUs are updated.



CVS commit: src/usr.sbin/cpuctl

2024-03-18 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 19 01:19:11 UTC 2024

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

Log Message:
cpuctl.8: fix grammar in a sentence


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/cpuctl/cpuctl.8

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



CVS commit: src/usr.sbin/postinstall

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:23:18 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: fix parameter order in usage message


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.61 src/usr.sbin/postinstall/postinstall.in:1.62
--- src/usr.sbin/postinstall/postinstall.in:1.61	Sat Mar  9 06:51:40 2024
+++ src/usr.sbin/postinstall/postinstall.in	Sun Mar 10 18:23:18 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.61 2024/03/09 06:51:40 rillig Exp $
+# $NetBSD: postinstall.in,v 1.62 2024/03/10 18:23:18 rillig Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -235,7 +235,7 @@ check_dir()
 #
 check_ids()
 {
-	[ $# -ge 6 ] || err 3 "USAGE: checks_ids op type file start srcfile id ..."
+	[ $# -ge 6 ] || err 3 "USAGE: checks_ids op type file srcfile start id ..."
 	local op="$1"
 	local type="$2"
 	local file="$3"



CVS commit: src/usr.sbin/postinstall

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:23:18 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: fix parameter order in usage message


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2024-03-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  9 06:51:40 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: fix endless loop (since 2024-03-07)


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2024-03-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar  9 06:51:40 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: fix endless loop (since 2024-03-07)


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.60 src/usr.sbin/postinstall/postinstall.in:1.61
--- src/usr.sbin/postinstall/postinstall.in:1.60	Thu Mar  7 22:03:16 2024
+++ src/usr.sbin/postinstall/postinstall.in	Sat Mar  9 06:51:40 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.60 2024/03/07 22:03:16 christos Exp $
+# $NetBSD: postinstall.in,v 1.61 2024/03/09 06:51:40 rillig Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -100,7 +100,7 @@ mkdtemp()
 	while true; do
 		dir="${base}.${serial}"
 		mkdir -m 0700 "${dir}" && break
-		_serial=$((${serial} + 1))
+		serial=$((${serial} + 1))
 	done
 	echo "${dir}"
 }



CVS commit: src/usr.sbin/postinstall

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 22:03:16 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
no local in loops, simplify eval (thanks kre)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.59 src/usr.sbin/postinstall/postinstall.in:1.60
--- src/usr.sbin/postinstall/postinstall.in:1.59	Thu Mar  7 11:54:16 2024
+++ src/usr.sbin/postinstall/postinstall.in	Thu Mar  7 17:03:16 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.59 2024/03/07 16:54:16 christos Exp $
+# $NetBSD: postinstall.in,v 1.60 2024/03/07 22:03:16 christos Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -95,9 +95,10 @@ mkdtemp()
 
 	local base="/tmp/_postinstall.$$"
 	local serial=0
+	local dir
 
 	while true; do
-		local dir="${base}.${serial}"
+		dir="${base}.${serial}"
 		mkdir -m 0700 "${dir}" && break
 		_serial=$((${serial} + 1))
 	done
@@ -320,11 +321,11 @@ populate_dir()
 	check_dir "${op}" "${dst}" 755 || return 1
 
 	local cmpdir_rv=0
-	local f
+	local f fs fd error
 	for f in "$@"; do
-		local fs="${src}/${f}"
-		local fd="${dst}/${f}"
-		local error=""
+		fs="${src}/${f}"
+		fd="${dst}/${f}"
+		error=""
 		if [ ! -f "${fd}" ]; then
 			error="${fd} does not exist"
 		elif ! cmp -s "${fs}" "${fd}" ; then
@@ -423,8 +424,7 @@ rcconf_is_set()
 			[ -f "${f}" ] && . "${f}"
 		done
 		eval echo -n \"\${${var}}\" 1>&3
-		if eval "[ -n \"\${${var}}\" \
-			-o \"\${${var}-UNSET}\" != \"UNSET\" ]"; then
+		if eval "[ -n \"\${${var}+SET}\" ]"; then
 			if [ -n "${verbose}" ]; then
 msg \
 "Obsolete rc.conf(5) variable '\$${var}' found.${notfixed}"
@@ -963,11 +963,11 @@ do_blocklist()
 {
 	[ -n "$1" ] || err 3 "USAGE: do_blocklist fix|check"
 	local op="$1"
-	local i
+	local i old
 
 	# if we are actually using blocklistd
 	for i in /var/db/blacklist.db /etc/blacklistd.conf; do
-		local old="${DEST_DIR}${i}"
+		old="${DEST_DIR}${i}"
 		if [ ! -f "${old}" ]; then
 			continue
 		elif [ "$1" = "check" ]; then
@@ -1068,6 +1068,7 @@ do_catpages()
 {
 	local op="$1"
 	local failed=0
+	local manbase sec
 	for manbase in /usr/share/man /usr/X11R6/man /usr/X11R7/man; do
 		for sec in 1 2 3 4 5 6 7 8 9; do
 			obsolete_catpages "$1" "${DEST_DIR}${manbase}" "${sec}"
@@ -2200,8 +2201,8 @@ do_rc()
 		${extra_scripts}
 	failed=$(( ${failed} + $? ))
 
+	local i rc_file
 	for i in ${rc_external_files}; do
-	local rc_file
 	case $i in
 	*d) rc_file=${i};;
 	*)	rc_file=${i}d;;
@@ -2527,6 +2528,7 @@ do_x11()
 		notfixed="${NOT_FIXED}"
 	fi
 
+	local d
 	# check if /usr/X11R6/lib/X11 needs to migrate to /etc/X11
 	if [ -n "${libx11}" ]; then
 		for d in \



CVS commit: src/usr.sbin/postinstall

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 22:03:16 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
no local in loops, simplify eval (thanks kre)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 16:54:16 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
- fix named.conf (remove dnssec-enable option)
- use proper local variables instead of adding _ or other prefixes.
- centralize rm use
- use grep -q instead of > /dev/null
- reduce constant duplication


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 16:54:16 UTC 2024

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
- fix named.conf (remove dnssec-enable option)
- use proper local variables instead of adding _ or other prefixes.
- centralize rm use
- use grep -q instead of > /dev/null
- reduce constant duplication


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.58 src/usr.sbin/postinstall/postinstall.in:1.59
--- src/usr.sbin/postinstall/postinstall.in:1.58	Sun Jan 28 19:57:38 2024
+++ src/usr.sbin/postinstall/postinstall.in	Thu Mar  7 11:54:16 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.58 2024/01/29 00:57:38 riastradh Exp $
+# $NetBSD: postinstall.in,v 1.59 2024/03/07 16:54:16 christos Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,6 +60,7 @@
 : ${SED:=sed}
 : ${SORT:=sort}
 : ${STAT:=stat}
+: ${RM:=rm}
 
 #
 #	helper functions
@@ -67,11 +68,11 @@
 
 err()
 {
-	exitval=$1
+	local exitval=$1
 	shift
 	echo 1>&2 "${PROGNAME}: $*"
 	if [ -n "${SCRATCHDIR}" ]; then
-	/bin/rm -rf "${SCRATCHDIR}"
+	${RM} -rf "${SCRATCHDIR}"
 	fi
 	exit ${exitval}
 }
@@ -92,15 +93,15 @@ mkdtemp()
 	[ -d /tmp ] || err 2 /tmp is not a directory
 	[ -w /tmp ] || err 2 /tmp is not writable
 
-	_base="/tmp/_postinstall.$$"
-	_serial=0
+	local base="/tmp/_postinstall.$$"
+	local serial=0
 
 	while true; do
-		_dir="${_base}.${_serial}"
-		mkdir -m 0700 "${_dir}" && break
-		_serial=$((${_serial} + 1))
+		local dir="${base}.${serial}"
+		mkdir -m 0700 "${dir}" && break
+		_serial=$((${serial} + 1))
 	done
-	echo "${_dir}"
+	echo "${dir}"
 }
 
 # Quote args to make them safe in the shell.
@@ -131,7 +132,7 @@ shell_quote()
 			# '\'''\'' sequences that result from multiple
 			# adjacent quotes in he input.
 			qarg="$(printf "%s\n" "$arg" | \
-			${SED:-sed} -e "s/'/'''/g" \
+			${SED} -e "s/'/'''/g" \
 -e "1s/^/'/" -e "\$s/\$/'/" \
 -e "1s/^''//" -e "\$s/''\$//" \
 -e "s/'''/'/g"
@@ -206,18 +207,18 @@ adddisableditem()
 check_dir()
 {
 	[ $# -eq 3 ] || err 3 "USAGE: check_dir op dir mode"
-	_cdop="$1"
-	_cddir="$2"
-	_cdmode="$3"
-	[ -d "${_cddir}" ] && return 0
-	if [ "${_cdop}" = "check" ]; then
-		msg "${_cddir} is not a directory"
+	local op="$1"
+	local dir="$2"
+	local mode="$3"
+	[ -d "${dir}" ] && return 0
+	if [ "${op}" = "check" ]; then
+		msg "${dir} is not a directory"
 		return 1
-	elif ! mkdir -m "${_cdmode}" "${_cddir}" ; then
-		msg "Can't create missing ${_cddir}"
+	elif ! mkdir -m "${mode}" "${dir}" ; then
+		msg "Can't create missing ${dir}"
 		return 1
 	else
-		msg "Missing ${_cddir} created"
+		msg "Missing ${dir} created"
 	fi
 	return 0
 }
@@ -234,27 +235,27 @@ check_dir()
 check_ids()
 {
 	[ $# -ge 6 ] || err 3 "USAGE: checks_ids op type file start srcfile id ..."
-	_op="$1"
-	_type="$2"
-	_file="$3"
-	_srcfile="$4"
-	_start="$5"
+	local op="$1"
+	local type="$2"
+	local file="$3"
+	local srcfile="$4"
+	local start="$5"
 	shift 5
-	#_ids="$@"
+	#local ids="$@"
 
-	if [ ! -f "${_file}" ]; then
-		msg "${_file} doesn't exist; can't check for missing ${_type}"
+	if [ ! -f "${file}" ]; then
+		msg "${file} doesn't exist; can't check for missing ${type}"
 		return 1
 	fi
-	if [ ! -r "${_file}" ]; then
-		msg "${_file} is not readable; can't check for missing ${_type}"
+	if [ ! -r "${file}" ]; then
+		msg "${file} is not readable; can't check for missing ${type}"
 		return 1
 	fi
-	_notfixed=""
-	if [ "${_op}" = "fix" ]; then
-		_notfixed="${NOT_FIXED}"
+	local notfixed=""
+	if [ "${op}" = "fix" ]; then
+		notfixed="${NOT_FIXED}"
 	fi
-	_missing="$(${AWK} -v start=$_start -F: '
+	local missing="$(${AWK} -v start=$start -F: '
 		BEGIN {
 			for (x = 1; x < ARGC; x++) {
 if (ARGV[x] == "SKIP")
@@ -278,14 +279,14 @@ check_ids()
 start++;
 			}
 		}
-	' "$@" < "${_file}")"	|| return 1
-	if [ -n "${_missing}" ]; then
-		msg "Error ${_type}${_notfixed}:" $(echo ${_missing})
+	' "$@" < "${file}")"	|| return 1
+	if [ -n "${missing}" ]; then
+		msg "Error ${type}${notfixed}:" $(echo ${missing})
 		msg "Use the following as a template:"
-		set -- ${_missing}
+		set -- ${missing}
 		while [ $# -gt 0 ]
 		do
-			${GREP} -E "^${1}:" ${_srcfile}
+			${GREP} -E "^${1}:" ${srcfile}
 			shift 2
 		done | sort -t: -k3n
 		msg "and adjust if necessary."
@@ -294,8 +295,8 @@ check_ids()
 	return 0
 }
 
-# populate_dir op onlynew src dest mode file ...
-#	Perform op ("check" or "fix") on files in src/ against dest/
+# populate_dir op onlynew src dst mode file ...
+#	Perform op ("check" or "fix") on files in src/ against dst/
 #	If op = "check" display missing or changed files, optionally with 

CVS commit: src/usr.sbin/certctl

2024-03-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  4 20:37:32 UTC 2024

Modified Files:
src/usr.sbin/certctl: certctl.sh

Log Message:
certctl(8): Pacify formal POSIX sh syntax.

According to POSIX 2018, the syntax between `then' and `elif' and
`fi' must be a _non-empty_ list of commands:

compound_list: linebreak term
 | linebreak term separator
 ;
...
if_clause: If compound_list Then compound_list else_part Fi
 | If compound_list Then compound_list   Fi
 ;
else_part: Elif compound_list Then compound_list
 | Elif compound_list Then compound_list else_part
 | Else compound_list
 ;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02

NetBSD's sh(1) currently doesn't enforce this and allows an empty
sequence of commands, but let's not rely on that nonstandard quirk.

Noted in PR 57997.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/certctl/certctl.sh

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



CVS commit: src/usr.sbin/certctl

2024-03-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  4 20:37:32 UTC 2024

Modified Files:
src/usr.sbin/certctl: certctl.sh

Log Message:
certctl(8): Pacify formal POSIX sh syntax.

According to POSIX 2018, the syntax between `then' and `elif' and
`fi' must be a _non-empty_ list of commands:

compound_list: linebreak term
 | linebreak term separator
 ;
...
if_clause: If compound_list Then compound_list else_part Fi
 | If compound_list Then compound_list   Fi
 ;
else_part: Elif compound_list Then compound_list
 | Elif compound_list Then compound_list else_part
 | Else compound_list
 ;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02

NetBSD's sh(1) currently doesn't enforce this and allows an empty
sequence of commands, but let's not rely on that nonstandard quirk.

Noted in PR 57997.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/certctl/certctl.sh

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/certctl/certctl.sh
diff -u src/usr.sbin/certctl/certctl.sh:1.6 src/usr.sbin/certctl/certctl.sh:1.7
--- src/usr.sbin/certctl/certctl.sh:1.6	Sun Mar  3 15:53:55 2024
+++ src/usr.sbin/certctl/certctl.sh	Mon Mar  4 20:37:31 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-#	$NetBSD: certctl.sh,v 1.6 2024/03/03 15:53:55 riastradh Exp $
+#	$NetBSD: certctl.sh,v 1.7 2024/03/04 20:37:31 riastradh Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -440,6 +440,7 @@ rehash()
 		return 1
 	elif [ ! -e "$certsdir" ]; then
 		# Directory doesn't exist at all.  Nothing to do!
+		:
 	elif [ ! -d "$certsdir" ]; then
 		error "certificates directory is not a directory"
 		return 1



CVS commit: src/usr.sbin/certctl

2024-03-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Mar  3 15:53:55 UTC 2024

Modified Files:
src/usr.sbin/certctl: certctl.sh

Log Message:
certctl(8): Avoid basename(1).

Saves some time running subprocesses.  Since this is only used for
non-directories (i.e., there's never trailing / on the inputs), it
suffices to delete the longest prefix matching glob `*/' with shell
parameter expansion -- much cheaper than spawning a subprocess.

Shaves off about 1/3 of the time spent in `certctl list' on an
aarch64 VM in qemu.

PR bin/57993


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/certctl/certctl.sh

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/certctl/certctl.sh
diff -u src/usr.sbin/certctl/certctl.sh:1.5 src/usr.sbin/certctl/certctl.sh:1.6
--- src/usr.sbin/certctl/certctl.sh:1.5	Tue Sep  5 12:32:30 2023
+++ src/usr.sbin/certctl/certctl.sh	Sun Mar  3 15:53:55 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-#	$NetBSD: certctl.sh,v 1.5 2023/09/05 12:32:30 riastradh Exp $
+#	$NetBSD: certctl.sh,v 1.6 2024/03/03 15:53:55 riastradh Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,7 +30,7 @@
 set -o pipefail
 set -Ceu
 
-progname=$(basename -- "$0")
+progname=${0##*/}
 
 ### Options and arguments
 
@@ -276,8 +276,7 @@ list_default_trusted()
 
 			# Print the vis-encoded absolute path to the
 			# certificate and base name on a single line.
-			vbase=$(basename -- "$vcert.")
-			vbase=${vbase%.}
+			vbase=${vcert##*/}
 			printf '%s %s\n' "$vcert" "$vbase"
 		done
 	done
@@ -339,8 +338,7 @@ list_distrusted()
 		# Print the vis-encoded absolute path to the
 		# certificate and base name on a single line.
 		vcert=$(printf '%s' "$cert" | vis -M)
-		vbase=$(basename -- "$vcert.")
-		vbase=${vbase%.}
+		vbase=${vcert##*/}
 		printf '%s %s\n' "$vcert" "$vbase"
 	done
 
@@ -562,8 +560,7 @@ cmd_trust()
 	fi
 
 	# Verify we currently distrust a certificate by this base name.
-	certbase=$(basename -- "$cert.")
-	certbase=${certbase%.}
+	certbase=${cert##*/}
 	if [ ! -h "$distrustdir/$certbase" ]; then
 		error "not currently distrusted: $vcert"
 		return 1
@@ -574,7 +571,7 @@ cmd_trust()
 	target=$(readlink -n -- "$distrustdir/$certbase" && printf .)
 	target=${target%.}
 	if [ "$cert" != "$target" ]; then
-		vcertbase=$(basename -- "$vcert")
+		vcertbase=${vcert##*/}
 		error "distrusted $vcertbase does not point to $vcert"
 		return 1
 	fi
@@ -617,8 +614,7 @@ cmd_untrust()
 	# Check whether this certificate is already distrusted.
 	# - If the same base name points to the same path, stop here.
 	# - Otherwise, fail noisily.
-	certbase=$(basename "$cert.")
-	certbase=${certbase%.}
+	certbase=${cert##*/}
 	if [ -h "$distrustdir/$certbase" ]; then
 		target=$(readlink -n -- "$distrustdir/$certbase" && printf .)
 		target=${target%.}



CVS commit: src/usr.sbin/certctl

2024-03-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Mar  3 15:53:55 UTC 2024

Modified Files:
src/usr.sbin/certctl: certctl.sh

Log Message:
certctl(8): Avoid basename(1).

Saves some time running subprocesses.  Since this is only used for
non-directories (i.e., there's never trailing / on the inputs), it
suffices to delete the longest prefix matching glob `*/' with shell
parameter expansion -- much cheaper than spawning a subprocess.

Shaves off about 1/3 of the time spent in `certctl list' on an
aarch64 VM in qemu.

PR bin/57993


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/certctl/certctl.sh

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



CVS commit: src/usr.sbin/makefs

2024-02-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Feb 29 08:13:52 UTC 2024

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
makefs/msdos: Fix broken [extra-directory ...] case

"path + cur->name" is not same as "cur->root + cur->path + cur->name"
for extra-directory files, as extra-directory files are
in different location. Do what makefs ffs code does.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/makefs/msdos.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/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.24 src/usr.sbin/makefs/msdos.c:1.25
--- src/usr.sbin/makefs/msdos.c:1.24	Sun Feb 18 16:58:51 2024
+++ src/usr.sbin/makefs/msdos.c	Thu Feb 29 08:13:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.24 2024/02/18 16:58:51 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.25 2024/02/29 08:13:52 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: msdos.c,v 1.24 2024/02/18 16:58:51 christos Exp $");
+__RCSID("$NetBSD: msdos.c,v 1.25 2024/02/29 08:13:52 tkusumi Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -226,8 +226,8 @@ msdos_populate_dir(const char *path, str
 	assert(fsopts != NULL);
 
 	for (cur = root->next; cur != NULL; cur = cur->next) {
-		if ((size_t)snprintf(pbuf, sizeof(pbuf), "%s/%s", path,
-		cur->name) >= sizeof(pbuf)) {
+		if ((size_t)snprintf(pbuf, sizeof(pbuf), "%s/%s/%s",
+		cur->root, cur->path, cur->name) >= sizeof(pbuf)) {
 			warnx("path %s too long", pbuf);
 			return -1;
 		}



CVS commit: src/usr.sbin/makefs

2024-02-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Feb 29 08:13:52 UTC 2024

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
makefs/msdos: Fix broken [extra-directory ...] case

"path + cur->name" is not same as "cur->root + cur->path + cur->name"
for extra-directory files, as extra-directory files are
in different location. Do what makefs ffs code does.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/makefs/msdos.c

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



  1   2   3   4   5   6   7   8   9   10   >