CVS commit: src/sbin/raidctl

2023-09-20 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Thu Sep 21 01:48:41 UTC 2023

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

Log Message:
Remove a couple of unneeded comments.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.80 src/sbin/raidctl/raidctl.c:1.81
--- src/sbin/raidctl/raidctl.c:1.80	Thu Sep 21 01:40:44 2023
+++ src/sbin/raidctl/raidctl.c	Thu Sep 21 01:48:41 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.80 2023/09/21 01:40:44 oster Exp $   */
+/*  $NetBSD: raidctl.c,v 1.81 2023/09/21 01:48:41 oster Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.80 2023/09/21 01:40:44 oster Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.81 2023/09/21 01:48:41 oster Exp $");
 #endif
 
 
@@ -144,7 +144,6 @@ main(int argc,char *argv[])
 	if (argc > 5) {
 		/* we have at least 5 args, so it might be a simplified config */
 		
-		/* XXX NEW CODE XXX */
 		strlcpy(name, argv[1], sizeof(name));
 		fd = opendisk(name, openmode, dev_name, sizeof(dev_name), 0);
 		if (fd != -1) {
@@ -159,7 +158,6 @@ main(int argc,char *argv[])
 rf_simple_create(fd,argc-3,[3]);
 
 /* set serial number, set autoconfig, init parity */
-/* XXX need to grok a random number for the serial number here */
 
 if (gettimeofday(,NULL) == -1) {
 	serial_number = 12345777;



CVS commit: src/sbin/raidctl

2023-09-20 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Thu Sep 21 01:48:41 UTC 2023

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

Log Message:
Remove a couple of unneeded comments.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sbin/raidctl/raidctl.c

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



CVS commit: src/sbin/raidctl

2023-09-20 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Thu Sep 21 01:40:44 UTC 2023

Modified Files:
src/sbin/raidctl: raidctl.8 raidctl.c

Log Message:
Implement command-line configuration of simple RAID sets with raidctl
based on the usage pattern:

raidctl  create...

For example,

raidctl raid0 create mirror absent /dev/wd1e

will create a RAID level 1 (mirror) set with an absent first component
and /dev/wd1e as the second component.  The resulting RAID device will
be marked as auto-configurable, will have a serial number set (based
on the current time), and parity will be initialized.  Reasonable
performance values are automatically used by default for other parameters
normally specified in the configuration file.

Also: Only print out Autoconfig status if being verbose.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.79 -r1.80 src/sbin/raidctl/raidctl.c

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



CVS commit: src/sbin/raidctl

2023-09-20 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Thu Sep 21 01:40:44 UTC 2023

Modified Files:
src/sbin/raidctl: raidctl.8 raidctl.c

Log Message:
Implement command-line configuration of simple RAID sets with raidctl
based on the usage pattern:

raidctl  create...

For example,

raidctl raid0 create mirror absent /dev/wd1e

will create a RAID level 1 (mirror) set with an absent first component
and /dev/wd1e as the second component.  The resulting RAID device will
be marked as auto-configurable, will have a serial number set (based
on the current time), and parity will be initialized.  Reasonable
performance values are automatically used by default for other parameters
normally specified in the configuration file.

Also: Only print out Autoconfig status if being verbose.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.79 -r1.80 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/raidctl.8
diff -u src/sbin/raidctl/raidctl.8:1.80 src/sbin/raidctl/raidctl.8:1.81
--- src/sbin/raidctl/raidctl.8:1.80	Sun Sep 17 20:07:39 2023
+++ src/sbin/raidctl/raidctl.8	Thu Sep 21 01:40:44 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: raidctl.8,v 1.80 2023/09/17 20:07:39 oster Exp $
+.\" $NetBSD: raidctl.8,v 1.81 2023/09/21 01:40:44 oster Exp $
 .\"
 .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\" any improvements or extensions that they make and grant Carnegie the
 .\" rights to redistribute these changes.
 .\"
-.Dd September 16, 2023
+.Dd September 20, 2023
 .Dt RAIDCTL 8
 .Os
 .Sh NAME
@@ -61,6 +61,10 @@
 .Nd configuration utility for the RAIDframe disk driver
 .Sh SYNOPSIS
 .Nm
+.Ar dev
+.Ar command
+.Op Ar arg Op ...
+.Nm
 .Op Fl v
 .Fl A Op yes | no | forceroot | softroot
 .Ar dev
@@ -148,7 +152,27 @@ For more information about the RAIDframe
 This document assumes the reader has at least rudimentary knowledge of
 RAID and RAID concepts.
 .Pp
-The command-line options for
+The simplified command-line options for
+.Nm
+are as follows:
+.Bl -tag -width indent
+.It Ic create Ar level Ar component1 Ar component2 Ar ...
+where
+.Ar level
+specifies the RAID level and is one of
+.Ar 0
+,
+.Ar 1 
+(or
+.Ar mirror
+), or
+.Ar 5
+and each of
+.Ar componentN
+specify the devices to be configured into the RAID set.
+.El
+.Pp
+The advanced command-line options for
 .Nm
 are as follows:
 .Bl -tag -width indent
@@ -370,6 +394,38 @@ for many others, or just simply
 .Pa /dev/rraid0[cd] ) .
 It is recommended that the partitions used to represent the
 RAID device are not used for file systems.
+.Ss Simple RAID configuration
+For simple RAID configurations using RAID levels 0 (simple striping),
+1 (mirroring), or 5 (striping with distributed parity)
+.Nm
+supports command-line configuration of RAID setups without
+the use of a configuration file.  For example,
+.Bd -literal -offset indent
+raidctl raid0 create 0 /dev/wd0e /dev/wd1e /dev/wd2e
+.Ed
+.Pp
+will create a RAID level 0 set on the device named
+.Pa raid0
+using the components
+.Pa /dev/wd0e ,
+.Pa /dev/wd1e ,
+and
+.Pa /dev/wd2e .
+Similarly,
+.Bd -literal -offset indent
+raidctl raid0 create mirror absent /dev/wd1e
+.Ed
+.Pp
+will create a RAID level 1 (mirror) set with an absent first component
+and
+.Pa /dev/wd1e
+as the second component.  In all cases the resulting RAID device will
+be marked as auto-configurable, will have a serial number set (based
+on the current time), and parity will be initialized (if the RAID level
+has parity and sufficent components are present).  Reasonable
+performance values are automatically used by default for other
+parameters normally specified in the configuration file.
+.Pp
 .Ss Configuration file
 The format of the configuration file is complex, and
 only an abbreviated treatment is given here.
@@ -540,6 +596,10 @@ for a more complete configuration file e
 device special files.
 .El
 .Sh EXAMPLES
+The examples given in this section are for more complex
+setups than can be configured with the simplified command-line
+configuration option described early.
+.Pp
 It is highly recommended that before using the RAID driver for real
 file systems that the system administrator(s) become quite familiar
 with the use of

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.79 src/sbin/raidctl/raidctl.c:1.80
--- src/sbin/raidctl/raidctl.c:1.79	Sun Sep 17 20:07:39 2023
+++ src/sbin/raidctl/raidctl.c	Thu Sep 21 01:40:44 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.79 2023/09/17 20:07:39 oster Exp $   */
+/*  $NetBSD: raidctl.c,v 1.80 2023/09/21 01:40:44 oster Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.79 2023/09/17 20:07:39 oster Exp $");

CVS commit: src/share/misc

2023-09-20 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Sep 20 15:22:41 UTC 2023

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+EPP extensible provisioning protocol (RFC5730)


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.366 src/share/misc/acronyms.comp:1.367
--- src/share/misc/acronyms.comp:1.366	Mon Sep 18 15:19:33 2023
+++ src/share/misc/acronyms.comp	Wed Sep 20 15:22:41 2023
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.366 2023/09/18 15:19:33 jschauma Exp $
+$NetBSD: acronyms.comp,v 1.367 2023/09/20 15:22:41 jschauma Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -563,6 +563,7 @@ EOL	end of line
 EOT	end of transmission
 EPIC	explicitly parallel instruction computing
 EPP	enhanced parallel port
+EPP	extensible provisioning protocol (RFC5730)
 EPRML	extended partial response, maximum likelihood
 EPROM	erasable programmable read only memory
 EPT	extended page tables



CVS commit: src/share/misc

2023-09-20 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Sep 20 15:22:41 UTC 2023

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+EPP extensible provisioning protocol (RFC5730)


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/share/misc/acronyms.comp

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



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 08:41:35 UTC 2023

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Removed unnecessary comment

Thanks leot@ for pointing this out


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.55 src/libexec/httpd/cgi-bozo.c:1.56
--- src/libexec/httpd/cgi-bozo.c:1.55	Wed Sep 20 07:09:14 2023
+++ src/libexec/httpd/cgi-bozo.c	Wed Sep 20 08:41:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.55 2023/09/20 07:09:14 shm Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.56 2023/09/20 08:41:35 shm Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -654,7 +654,6 @@ bozo_process_cgi(bozo_httpreq_t *request
 	/* CGI programs should perform their own timeouts */
 	while ((rbytes = bozo_read(httpd, STDIN_FILENO, buf, sizeof buf)) > 0) {
 		ssize_t wbytes;
-		/* char *bp = buf; */
 
 		while (rbytes) {
 			wbytes = write(sv[0], buf, (size_t)rbytes);



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 08:41:35 UTC 2023

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Removed unnecessary comment

Thanks leot@ for pointing this out


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/libexec/httpd/cgi-bozo.c

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



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 07:13:35 UTC 2023

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
Fix off-by-one in bozo_decode_url_percent

In case of strings that end with '%', debug function was reading past buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.144 src/libexec/httpd/bozohttpd.c:1.145
--- src/libexec/httpd/bozohttpd.c:1.144	Thu Sep  7 06:40:56 2023
+++ src/libexec/httpd/bozohttpd.c	Wed Sep 20 07:13:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.144 2023/09/07 06:40:56 shm Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.145 2023/09/20 07:13:35 shm Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -1564,9 +1564,14 @@ bozo_decode_url_percent(bozo_httpreq_t *
 *t++ = *s++;
 			break;
 		}
-		debug((httpd, DEBUG_EXPLODING,
-			"fu_%%: got s == %%, s[1]s[2] == %c%c",
-			s[1], s[2]));
+		if ([2] < end)
+			debug((httpd, DEBUG_EXPLODING,
+"fu_%%: got s == %%, s[1]s[2] == %c%c",
+s[1], s[2]));
+		else
+			debug((httpd, DEBUG_EXPLODING,
+			"fu_%%: got s == %%, s[1] == %c s[2] is not set",
+s[1]));
 		if (s[1] == '\0' || s[2] == '\0')
 			return bozo_http_error(httpd, 400, request,
 			"percent hack missing two chars afterwards");



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 07:13:35 UTC 2023

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
Fix off-by-one in bozo_decode_url_percent

In case of strings that end with '%', debug function was reading past buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/libexec/httpd/bozohttpd.c

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



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 07:09:14 UTC 2023

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Remove unused variable (bp)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/libexec/httpd/cgi-bozo.c

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



CVS commit: src/libexec/httpd

2023-09-20 Thread Mateusz Kocielski
Module Name:src
Committed By:   shm
Date:   Wed Sep 20 07:09:14 UTC 2023

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Remove unused variable (bp)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.54 src/libexec/httpd/cgi-bozo.c:1.55
--- src/libexec/httpd/cgi-bozo.c:1.54	Thu Apr  8 07:02:12 2021
+++ src/libexec/httpd/cgi-bozo.c	Wed Sep 20 07:09:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.54 2021/04/08 07:02:12 rillig Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.55 2023/09/20 07:09:14 shm Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -185,15 +185,13 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 	/* CGI programs should perform their own timeouts */
 	while ((rbytes = read(in, buf, sizeof buf)) > 0) {
 		ssize_t wbytes;
-		char *bp = buf;
 
 		while (rbytes) {
 			wbytes = bozo_write(httpd, STDOUT_FILENO, buf,
 	(size_t)rbytes);
-			if (wbytes > 0) {
+			if (wbytes > 0)
 rbytes -= wbytes;
-bp += wbytes;
-			} else
+			else
 bozoerr(httpd, 1,
 	"cgi output write failed: %s",
 	strerror(errno));
@@ -656,14 +654,13 @@ bozo_process_cgi(bozo_httpreq_t *request
 	/* CGI programs should perform their own timeouts */
 	while ((rbytes = bozo_read(httpd, STDIN_FILENO, buf, sizeof buf)) > 0) {
 		ssize_t wbytes;
-		char *bp = buf;
+		/* char *bp = buf; */
 
 		while (rbytes) {
 			wbytes = write(sv[0], buf, (size_t)rbytes);
-			if (wbytes > 0) {
+			if (wbytes > 0)
 rbytes -= wbytes;
-bp += wbytes;
-			} else
+			else
 bozoerr(httpd, 1, "write failed: %s",
 	strerror(errno));
 		}