Fix: PATCH: Round 2: RH initscripts backward compatibility

Jim Knoble jmknoble at jmknoble.cx
Sun Feb 18 20:26:49 EST 2001


Circa 2001-Feb-18 03:26:03 -0500 dixit Jim Knoble:

: I've cleaned up Pekka Savola's newly revised sshd.init and additional
: sshd-functions and modified them to work they way i've been arguing
: they should work.
: 
: Compatibility functions are defined in ./contrib/redhat/sshd-functions,
: which should get installed no matter what release of Red Hat Linux
: OpenSSH is getting built for, to be consistent across releases.

There's a problem in the localized() function in
./contrib/redhat/sshd-functions (contained in the patch i submitted
earlier), where trailing whitespace disappears under bash-1.14.x.

The attached patch, applied after the earlier one, fixes the problem.

-- 
jim knoble | jmknoble at jmknoble.cx | http://www.jmknoble.cx/
-------------- next part --------------
--- ./openssh-SNAP-20010218/contrib/redhat/sshd-functions.orig-localfix	Sun Feb 18 02:58:32 2001
+++ ./openssh-SNAP-20010218/contrib/redhat/sshd-functions	Sun Feb 18 04:18:10 2001
@@ -3,16 +3,18 @@
 # Compability functions for sshd initscript
 # Parts of my_action() are derived from Red Hat Linux 6.x initscripts.
 
-# Handle arguments localized using $"..." construct, if that construct
+# Handle argument localized using $"..." construct, if that construct
 # is not available in this version of bash.
+# PARAMETERS:
+#  $1 => string possibly containing leading '$' to remove
 localized() {
 	case "${BASH_VERSION}" in
 		1.*)
 			# Remove leading '$' character.
-			echo "${@#$}"
+			echo "${1#$}"
 		;;
 		*)
-			echo "$@"
+			echo "$1"
 		;;
 	esac
 }


More information about the openssh-unix-dev mailing list