[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#258517: XSI:isms and bash:isms in openssh



Package: openssh
Version: 3.8.1p1-4
Severity: minor
Tags: patch

Several files in openssh contains use of the XSI:isms `-a' and `-o'
in tests.  Additionally, debian/postinst uses the bashism local.
The included patch fixes all of these.  Note that I have not included
fixes for the upstream bugs that does not affect Debian (scripts for
aix, caldera, etc...); if wanted, I can do so separately.

Rationale:
Policy 10.4
http://www.opengroup.org/onlinepubs/009695399/utilities/test.html


Regards: David Weinehall

diff -ur openssh-3.8.1p1-old/Makefile.in openssh-3.8.1p1/Makefile.in
--- openssh-3.8.1p1-old/Makefile.in	2004-02-18 05:35:11.000000000 +0200
+++ openssh-3.8.1p1/Makefile.in	2004-07-10 02:11:49.000000000 +0300
@@ -290,7 +290,7 @@
 	else \
 		echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
 	fi
-	@if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
+	@if [ -f ssh_prng_cmds ] && [ ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
 		if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \
 			$(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \
 		else \
@@ -404,6 +404,6 @@
 		$@
 
 regressclean:
-	if [ -f regress/Makefile -a -r regress/Makefile ]; then \
+	if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \
 		(cd regress && $(MAKE) clean) \
 	fi
diff -ur openssh-3.8.1p1-old/contrib/ssh-copy-id openssh-3.8.1p1/contrib/ssh-copy-id
--- openssh-3.8.1p1-old/contrib/ssh-copy-id	2004-01-04 23:16:34.000000000 +0200
+++ openssh-3.8.1p1/contrib/ssh-copy-id	2004-07-10 02:12:05.000000000 +0300
@@ -24,7 +24,7 @@
   fi
 fi
 
-if [ -z "`eval $GET_ID`" -a -r "${ID_FILE}" ] ; then
+if [ -z "`eval $GET_ID`" ] && [ -r "${ID_FILE}" ] ; then
   GET_ID="cat ${ID_FILE}"
 fi
 
diff -ur openssh-3.8.1p1-old/debian/config openssh-3.8.1p1/debian/config
--- openssh-3.8.1p1-old/debian/config	2004-06-24 12:55:35.000000000 +0300
+++ openssh-3.8.1p1/debian/config	2004-07-10 02:09:45.000000000 +0300
@@ -3,7 +3,7 @@
 action=$1
 version=$2
 
-if [ -d /etc/ssh-nonfree -a ! -d /etc/ssh ]; then
+if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
   version=1.2.27
   cp -a /etc/ssh-nonfree /etc/ssh
 fi
@@ -30,7 +30,7 @@
   db_fset ssh/use_old_init_script seen true
 fi
 
-if [ -z "$version" -a ! -e /etc/ssh/sshd_config ]
+if [ -z "$version" ] && [ ! -e /etc/ssh/sshd_config ]
 then
   db_input medium ssh/protocol2_only || true
 fi
diff -ur openssh-3.8.1p1-old/debian/postinst openssh-3.8.1p1/debian/postinst
--- openssh-3.8.1p1-old/debian/postinst	2004-06-24 12:55:35.000000000 +0300
+++ openssh-3.8.1p1/debian/postinst	2004-07-10 02:10:14.000000000 +0300
@@ -28,9 +28,9 @@
 
 
 create_key() {
-	local msg="$1"
+	msg="$1"
 	shift
-	local file="$1"
+	file="$1"
 	shift
 
 	if [ ! -f "$file" ] ; then
diff -ur openssh-3.8.1p1-old/debian/preinst openssh-3.8.1p1/debian/preinst
--- openssh-3.8.1p1-old/debian/preinst	2004-06-24 12:55:35.000000000 +0300
+++ openssh-3.8.1p1/debian/preinst	2004-07-10 02:10:40.000000000 +0300
@@ -3,11 +3,11 @@
 action=$1
 version=$2
 
-if [ -d /etc/ssh-nonfree -a ! -d /etc/ssh ]; then
+if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
   version=1.2.27
 fi
 
-if [ "$action" = upgrade -o "$action" = install ]
+if [ "$action" = upgrade ] || [ "$action" = install ]
 then
   # check if debconf is missing
   if ! test -f /usr/share/debconf/confmodule
@@ -39,7 +39,7 @@
     # work around for missing debconf
     db_get() { : ; }
     RET=true
-    if [ -d /etc/ssh-nonfree -a ! -d /etc/ssh ]; then
+    if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
       cp -a /etc/ssh-nonfree /etc/ssh
     fi
   else




Reply to: