Patch to update contrib/solaris package builder

ninjaz at webexpress.com ninjaz at webexpress.com
Tue May 8 11:54:16 EST 2001


I've attached a patch for contrib/solaris package builder to bring it up
to date with OpenSSH 2.9p1.

The changes are:

build-pkg - 
  add libexec/ directory creation (to house sftp-server)
  cp sftp-server to libexec/
  cp sftp.1 to man/man1
  cp sftp to bin/
 
postinstall.in -
  add RSA key generation and installation/update

prototype -
  add sftp, sftp.1 and sftp-server

Btw, 2.9p1 is looking quite nice here. :)  I was having some problems with
connections being dropped while logged onto some legacy SSH2 servers with 
2.5.2p2.  That is no longer happening with 2.9p1.

				-pete
-------------- next part --------------
diff -u solaris.virgin/build-pkg solaris/build-pkg
--- solaris.virgin/build-pkg	Fri Nov 10 14:36:39 2000
+++ solaris/build-pkg	Mon Apr 16 17:33:57 2001
@@ -145,6 +145,7 @@
 mkdir -p ${BUILDDIR}/man/man8
 mkdir -p ${BUILDDIR}/etc
 mkdir -p ${BUILDDIR}/bin
+mkdir -p ${BUILDDIR}/libexec
 mkdir -p ${BUILDDIR}/sbin
 
 echo "Populating build directories..."
@@ -155,6 +156,9 @@
 cp -p ../../../ssh-agent bin
 cp -p ../../../scp bin
 cp -p ../../../scp.1 man/man1/scp.1
+cp -p ../../../sftp bin
+cp -p ../../../sftp.1 man/man1/sftp.1
+cp -p ../../../sftp-server libexec/sftp-server
 cp -p ../../../ssh-add.1 man/man1/ssh-add.1
 cp -p ../../../ssh-agent.1 man/man1/ssh-agent.1
 cp -p ../../../ssh-keygen.1 man/man1/ssh-keygen.1
diff -u solaris.virgin/postinstall.in solaris/postinstall.in
--- solaris.virgin/postinstall.in	Mon Apr 23 17:03:58 2001
+++ solaris/postinstall.in	Mon May  7 17:51:35 2001
@@ -89,6 +89,26 @@
     else
         echo "Using existing DSA public/private host key pair for SSH-2."
     fi
+    if [ ! -f "${CONFDIR}/ssh_host_rsa_key" ]; then
+        echo "Creating new RSA public/private host key pair for SSH-2."
+        $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key
+        $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key.pub
+        ### If there is *anything* there then leave it, otherwise look
+        ### in some reasonable alternate locations before giving up.
+        ### It's worth spending some extra time looking for the old one
+        ### to avoid a bunch of "host identification has changed" warnings.
+        ### Note that some old keys from the commercial SSH2 might not
+        ### be compatible, but we don't test for that.
+        if [ -f "${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key" ]; then
+           mv ${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key ${CONFDIR}
+        elif [ -f "${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key" ]; then
+           mv ${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key ${CONFDIR}
+        else
+           ${DESTBIN}/ssh-keygen -t rsa -f ${CONFDIR}/ssh_host_rsa_key -N ''
+        fi
+    else
+        echo "Using existing RSA public/private host key pair for SSH-2."
+    fi
 else
     echo "Performing an \"update\" installation of OpenSSH."
     ### Okay, this part *is* an update install...so we need to ensure
@@ -177,6 +197,26 @@
         fi
     else
         echo "Using existing DSA public/private host key pair for SSH-2."
+    fi
+    if [ ! -f "${CONFDIR}/ssh_host_rsa_key" ]; then
+        echo "Creating new RSA public/private host key pair for SSH-2."
+        $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key
+        $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key.pub
+        ### If there is *anything* there then leave it, otherwise look
+        ### in some reasonable alternate locations before giving up.
+        ### It's worth spending some extra time looking for the old one
+        ### to avoid a bunch of "host identification has changed" warnings.
+        ### Note that some old keys from the commercial SSH2 might not
+        ### be compatible, but we don't test for that.
+        if [ -f "${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key" ]; then
+           mv ${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key ${CONFDIR}
+        elif [ -f "${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key" ]; then
+           mv ${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key ${CONFDIR}
+        else
+           ${DESTBIN}/ssh-keygen -d -f ${CONFDIR}/ssh_host_rsa_key -N ''
+        fi
+    else
+        echo "Using existing RSA public/private host key pair for SSH-2."
     fi
 fi
 
diff -u solaris.virgin/prototype solaris/prototype
--- solaris.virgin/prototype	Fri Nov 10 14:36:39 2000
+++ solaris/prototype	Mon Apr 16 17:32:25 2001
@@ -5,6 +5,7 @@
 d none man 0755 root sys 
 d none man/man1 0755 root sys
 f none man/man1/scp.1 0644 root sys
+f none man/man1/sftp.1 0644 root sys
 f none man/man1/ssh-add.1 0644 root sys
 f none man/man1/ssh-agent.1 0644 root sys
 f none man/man1/ssh-keygen.1 0644 root sys
@@ -23,5 +24,7 @@
 f none bin/ssh-add 0755 root sys
 f none bin/ssh-agent 0755 root sys
 f none bin/scp 0755 root sys
+f none bin/sftp 0755 root sys
+f none libexec/sftp-server 0755 root sys
 d none sbin 0755 root sys
 f none sbin/sshd 0755 root sys


More information about the openssh-unix-dev mailing list