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

2022-01-16 Thread rudolf

On 1/9/22 4:33 AM, Luke Mewburn wrote:

Module Name:src
Committed By:   lukem
Date:   Sun Jan  9 03:33:26 UTC 2022

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

Log Message:
etcupdate: add -? for help. improve option errors

Support -? to show help.
Implemented using getopts "leading colon optstring" feature.
Improve error messages for unknown options and missing arguments.
Change usage-related errors from stdout to stderr.
Keep all other errors to stdout for now.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/etcupdate/etcupdate
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/etcupdate/etcupdate.8



Hi,

there is a copy/pasto in etcupdate 1.64, the getopts variable name is 
"i", not "ch" (as in postinstall).


r.
Index: usr.sbin/etcupdate/etcupdate
===
RCS file: /cvsroot/src/usr.sbin/etcupdate/etcupdate,v
retrieving revision 1.64
diff -u -r1.64 etcupdate
--- usr.sbin/etcupdate/etcupdate	9 Jan 2022 03:33:26 -	1.64
+++ usr.sbin/etcupdate/etcupdate	16 Jan 2022 11:04:56 -
@@ -554,7 +554,7 @@
 		;;
 
 	*)
-		echo 1>&2 "${PROG}: Unimplemented option -${ch}"
+		echo 1>&2 "${PROG}: Unimplemented option -${i}"
 		exit 3
 		;;
 	esac


Re: CVS commit: src/etc/rc.d

2019-10-23 Thread rudolf

Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Mon Apr  9 15:02:39 UTC 2018

Modified Files:
src/etc/rc.d: sshd

Log Message:
Simplify so we don't have to hard-code the key filenames in two places.



There are some leftovers in the script after the simplification, the 
"version" and "name" input arguments are unused now. Please see the 
attached diff.


Kind regards,

r.
diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd
index 038f817ebe43..dfc4d0b91077 100755
--- a/etc/rc.d/sshd
+++ b/etc/rc.d/sshd
@@ -20,7 +20,7 @@ sshd_keygen()
 (
 	keygen="/usr/bin/ssh-keygen"
 	umask 022
-	while read type bits filename version name;  do
+	while read type bits filename;  do
 		f="/etc/ssh/$filename"
 		if [ -f "$f" ]; then
 			continue
@@ -33,10 +33,10 @@ sshd_keygen()
 		"${keygen}" -t "${type}" ${bitarg} -f "${f}" -N '' -q && \
 		printf "ssh-keygen: " && "${keygen}" -f "${f}" -l
 	done << _EOF
-dsa	1024	ssh_host_dsa_key	2	DSA
-ecdsa	521	ssh_host_ecdsa_key	1	ECDSA
-ed25519	-1	ssh_host_ed25519_key	1	ED25519
-rsa	0	ssh_host_rsa_key	2	RSA
+dsa	1024	ssh_host_dsa_key
+ecdsa	521	ssh_host_ecdsa_key
+ed25519	-1	ssh_host_ed25519_key
+rsa	0	ssh_host_rsa_key
 _EOF
 )
 }