diff options
author | jlam <jlam@pkgsrc.org> | 2000-07-22 08:21:59 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2000-07-22 08:21:59 +0000 |
commit | 1693b89d3fb9f4289a2cd2bdc134c1fa0dddf0ec (patch) | |
tree | 9acc8356f93e5d33fca46802d382f0297452147d /security/openssh | |
parent | 806f8687596b9f4d1f505858315bfa4cbf352eb1 (diff) | |
download | pkgsrc-1693b89d3fb9f4289a2cd2bdc134c1fa0dddf0ec.tar.gz |
Update openssh to 2.1.1p4.
Package changes:
* Factor out common post-install code from PLIST and package Makefile
into files/INSTALL.
* Enhance files/sshd.sh to handle start/stop/restart/status.
* Check for usable installed version of OpenSSL. This bit possibly
closes the following PRs: 10404, 10501, 10593
Changes from 2.1.1p3:
* allow multiple whitespace but only one '=' between tokens
* close can fail on AFS
* allow leading whitespace in configuration files
* Always create ~/.ssh with mode 700
Diffstat (limited to 'security/openssh')
-rw-r--r-- | security/openssh/Makefile | 72 | ||||
-rw-r--r-- | security/openssh/files/md5 | 4 | ||||
-rw-r--r-- | security/openssh/files/patch-sum | 7 | ||||
-rw-r--r-- | security/openssh/files/sshd.sh | 54 | ||||
-rw-r--r-- | security/openssh/patches/patch-ae | 8 | ||||
-rw-r--r-- | security/openssh/patches/patch-ag | 15 | ||||
-rw-r--r-- | security/openssh/patches/patch-ah | 35 | ||||
-rw-r--r-- | security/openssh/pkg/PLIST | 13 |
8 files changed, 124 insertions, 84 deletions
diff --git a/security/openssh/Makefile b/security/openssh/Makefile index d424b144270..0fc55f78dc1 100644 --- a/security/openssh/Makefile +++ b/security/openssh/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.17 2000/07/15 03:53:46 itojun Exp $ +# $NetBSD: Makefile,v 1.18 2000/07/22 08:21:59 jlam Exp $ # -DISTNAME= openssh-2.1.1p3 +DISTNAME= openssh-2.1.1p4 CATEGORIES= security MASTER_SITES= http://the.wiretapped.net/security/cryptography/ssh/OpenSSH/files/ \ http://www.firedrake.org/openssh/files/ \ @@ -16,23 +16,39 @@ HOMEPAGE= http://www.openssh.com/ BUILD_DEPENDS+= ${LOCALBASE}/bin/perl:../../lang/perl5 BUILD_DEPENDS+= autoreconf:../../devel/autoconf -# src/crypto is still 0.9.4 at this moment. see NetBSD PR 10593. -#.if !exists(/usr/include/openssl/rsa.h) +# Check for a usable installed version of OpenSSL. Version must be greater +# than 0.9.5a. If a usable version isn't present, then use the pkgsrc +# OpenSSL package. +# +.if exists(/usr/include/openssl/rsa.h) +OPENSSLV_H= /usr/include/openssl/opensslv.h +OPENSSL_VERSION!= awk '/.*OPENSSL_VERSION_NUMBER.*/ { print $$3 }' \ + ${OPENSSLV_H} +OPENSSL_VERSION_095a= 0x0090581fL +.if (${OPENSSL_VERSION} != ${OPENSSL_VERSION_095a}) +DEPENDS+= openssl>=0.9.5:../../security/openssl +SSLBASE= ${LOCALBASE} +.else +SSLBASE= /usr +.endif +.else DEPENDS+= openssl>=0.9.5:../../security/openssl -#.endif +SSLBASE= ${LOCALBASE} +.endif CONFLICTS= ssh-[0-9]* ssh6-[0-9]* # retain the following line, for IPv6-ready pkgsrc webpage BUILD_DEFS+= USE_INET6 +BUILD_DEFS+= SSH_CONF_DIR # USE_PERL5= yes RESTRICTED= "Crypto; export-controlled" MIRROR_DISTFILE= no + DEINSTALL_FILE= ${WRKDIR}/DEINSTALL +INSTALL_FILE= ${WRKDIR}/INSTALL MESSAGE_FILE= ${WRKDIR}/MESSAGE -PLIST_SRC= ${WRKDIR}/PLIST -BUILD_DEFS+= SSH_CONF_DIR # matches what's in `Configure' (except sparc64) ONLY_FOR_PLATFORM= NetBSD-*-alpha NetBSD-*-arm32 NetBSD-*-i386 \ @@ -40,40 +56,32 @@ ONLY_FOR_PLATFORM= NetBSD-*-alpha NetBSD-*-arm32 NetBSD-*-i386 \ NetBSD-*-mipsel NetBSD-*-ns32k NetBSD-*-powerpc \ NetBSD-*-sparc NetBSD-*-vax -GNU_CONFIGURE= yes -CONFIGURE_ARGS+= openssl - .include "../../mk/bsd.prefs.mk" + SSH_CONF_DIR?= /etc -CONFIGURE_ARGS= --sysconfdir=${SSH_CONF_DIR} + +GNU_CONFIGURE= yes +CONFIGURE_ARGS+= --sysconfdir=${SSH_CONF_DIR} +CONFIGURE_ARGS+= --with-ssl-dir=${SSLBASE} pre-configure: - cd ${WRKSRC}; autoreconf + cd ${WRKSRC} && autoreconf post-build: - cd ${PKGDIR}; \ - for FILE in DEINSTALL MESSAGE PLIST ${FILESDIR}/sshd.sh; do \ - ${SED} -e 's#@SSH_CONF_DIR@#${SSH_CONF_DIR}#g' \ - -e 's#@PREFIX@#${PREFIX}#g' \ - <$${FILE} >${WRKDIR}/`basename $${FILE}`; \ + for FILE in \ + ${PKGDIR}/DEINSTALL \ + ${PKGDIR}/INSTALL \ + ${PKGDIR}/MESSAGE \ + ${FILESDIR}/sshd.sh; \ + do \ + ${SED} -e 's#@SSH_CONF_DIR@#${SSH_CONF_DIR}#g' \ + -e 's#@PREFIX@#${PREFIX}#g' \ + < $${FILE} > ${WRKDIR}/`basename $${FILE}`; \ done post-install: - for FILE in ssh_config sshd_config ; do \ - if [ ! -f ${SSH_CONF_DIR}/$${FILE} ]; then \ - ${INSTALL_DATA} ${PREFIX}/share/examples/ssh/$${FILE} ${SSH_CONF_DIR}/$${FILE} ; \ - fi ; \ - done - if [ ! -f ${SSH_CONF_DIR}/ssh_host_key ]; then \ - ${ECHO} "Generating a secret host key..."; \ - ${PREFIX}/bin/ssh-keygen \ - -f ${SSH_CONF_DIR}/ssh_host_key -N ""; \ - fi - if [ ! -f ${SSH_CONF_DIR}/ssh_host_dsa_key ]; then \ - ${ECHO} "Generating a DSA secret host key..."; \ - ${PREFIX}/bin/ssh-keygen \ - -d -f ${SSH_CONF_DIR}/ssh_host_dsa_key -N ""; \ - fi ${INSTALL_SCRIPT} ${WRKDIR}/sshd.sh ${PREFIX}/etc/rc.d/sshd.sh + PKG_PREFIX=${PREFIX} ${SH} ${REQ_FILE} ${PKGNAME} INSTALL + PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL .include "../../mk/bsd.pkg.mk" diff --git a/security/openssh/files/md5 b/security/openssh/files/md5 index 69d6c96f421..6999e123b9c 100644 --- a/security/openssh/files/md5 +++ b/security/openssh/files/md5 @@ -1,3 +1,3 @@ -$NetBSD: md5,v 1.7 2000/07/15 03:53:46 itojun Exp $ +$NetBSD: md5,v 1.8 2000/07/22 08:22:02 jlam Exp $ -MD5 (openssh-2.1.1p3.tar.gz) = a5febdb5d74fdc678bd3c4864f4cf825 +MD5 (openssh-2.1.1p4.tar.gz) = 9525a5a130470290b4adba1f58a7ca8b diff --git a/security/openssh/files/patch-sum b/security/openssh/files/patch-sum index 976e4519e9a..97de850956c 100644 --- a/security/openssh/files/patch-sum +++ b/security/openssh/files/patch-sum @@ -1,7 +1,6 @@ -$NetBSD: patch-sum,v 1.14 2000/07/15 03:53:46 itojun Exp $ +$NetBSD: patch-sum,v 1.15 2000/07/22 08:22:02 jlam Exp $ -MD5 (patch-ae) = 0076ca9d2343f21a304a3eee1a82c3cc -MD5 (patch-ag) = 037888228d97283b54d1232daf3945a2 -MD5 (patch-ah) = 0c144a44edc914f64ebf5bb5fb0ff401 +MD5 (patch-ae) = 62afcf06805bd3ae1337e4f9cf15fd93 +MD5 (patch-ah) = a3e7f9f636cf562a9312b45928ffe62d MD5 (patch-aj) = 5397d9fbfe54544fd186831cfe979329 MD5 (patch-an) = eccf8c19bcee913de49eb2b38999e609 diff --git a/security/openssh/files/sshd.sh b/security/openssh/files/sshd.sh index 6060959692c..8d23e616475 100644 --- a/security/openssh/files/sshd.sh +++ b/security/openssh/files/sshd.sh @@ -1,14 +1,48 @@ #!/bin/sh # -# $NetBSD: sshd.sh,v 1.1 2000/01/27 17:37:19 hubertf Exp $ +# $NetBSD: sshd.sh,v 1.2 2000/07/22 08:22:02 jlam Exp $ # -if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] -then - @PREFIX@/bin/ssh-keygen -f @SSH_CONF_DIR@/ssh_host_key -N '' -fi -if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] -then - @PREFIX@/sbin/sshd - echo -n ' sshd' -fi + +name="sshd" +pidfile="/var/run/${name}.pid" + +case $1 in +start) + if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] + then + @PREFIX@/bin/ssh-keygen -b 1024 -N "" -f /etc/ssh_host_key + fi + if [ ! -f @SSH_CONF_DIR@/ssh_host_dsa_key ] + then + /usr/pkg/bin/ssh-keygen -d -N "" -f /etc/ssh_host_dsa_key + fi + if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] + then + echo "Starting ${name}." + @PREFIX@/sbin/sshd + fi + ;; +stop) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "Stopping ${name}." + kill -TERM ${pid} + else + echo "${name} not running?" + fi + ;; +restart) + ( $0 stop ) + sleep 1 + $0 start + ;; +status) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "${name} is running as pid ${pid}." + else + echo "${name} is not running." + fi + ;; +esac exit 0 diff --git a/security/openssh/patches/patch-ae b/security/openssh/patches/patch-ae index 850725f9be0..b548b8809ec 100644 --- a/security/openssh/patches/patch-ae +++ b/security/openssh/patches/patch-ae @@ -1,7 +1,7 @@ -$NetBSD: patch-ae,v 1.3 2000/03/27 00:59:13 fredb Exp $ +$NetBSD: patch-ae,v 1.4 2000/07/22 08:22:02 jlam Exp $ ---- ssh-add.1.orig Sat Jan 22 02:57:40 2000 -+++ ssh-add.1 Sun Mar 26 18:39:34 2000 +--- ssh-add.1.orig Sat May 6 22:03:18 2000 ++++ ssh-add.1 Fri Jul 21 01:24:49 2000 @@ -64,6 +64,7 @@ .Nm when no other files have been specified. @@ -10,7 +10,7 @@ $NetBSD: patch-ae,v 1.3 2000/03/27 00:59:13 fredb Exp $ .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev "DISPLAY" and "SSH_ASKPASS" -@@ -87,6 +88,7 @@ +@@ -89,6 +90,7 @@ may be necessary to redirect the input from .Pa /dev/null to make this work.) diff --git a/security/openssh/patches/patch-ag b/security/openssh/patches/patch-ag deleted file mode 100644 index 13d45051b68..00000000000 --- a/security/openssh/patches/patch-ag +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-ag,v 1.2 2000/01/27 17:12:05 hubertf Exp $ - ---- uidswap.c.orig Thu Jan 20 14:18:16 2000 -+++ uidswap.c Thu Jan 27 17:04:38 2000 -@@ -26,8 +26,10 @@ - is not part of the posix specification. */ - #define SAVED_IDS_WORK_WITH_SETEUID - -+#ifdef SAVED_IDS_WORK_WITH_SETEUID - /* Saved effective uid. */ - static uid_t saved_euid = 0; -+#endif - - #endif /* _POSIX_SAVED_IDS */ - diff --git a/security/openssh/patches/patch-ah b/security/openssh/patches/patch-ah index f23fe12d35b..d939b58de0d 100644 --- a/security/openssh/patches/patch-ah +++ b/security/openssh/patches/patch-ah @@ -1,12 +1,27 @@ -$NetBSD: patch-ah,v 1.6 2000/07/02 22:07:56 itojun Exp $ +$NetBSD: patch-ah,v 1.7 2000/07/22 08:22:03 jlam Exp $ ---- Makefile.in.orig Tue Jun 27 15:24:49 2000 -+++ Makefile.in Sun Jul 2 14:30:43 2000 -@@ -8,2 +8,3 @@ +--- Makefile.in.orig Tue Jul 11 07:34:34 2000 ++++ Makefile.in Fri Jul 21 01:30:17 2000 +@@ -6,6 +6,7 @@ + mandir=@mandir@ + mansubdir=@mansubdir@ sysconfdir=@sysconfdir@ +examplesdir=@prefix@/share/examples/ssh piddir=@piddir@ -@@ -141,6 +142,6 @@ + srcdir=@srcdir@ + top_srcdir=@top_srcdir@ +@@ -115,7 +116,7 @@ + distprep: catman-do + autoreconf + +-install: manpages $(TARGETS) install-files host-key ++install: manpages $(TARGETS) install-files + + install-files: + ./mkinstalldirs $(DESTDIR)$(bindir) +@@ -139,14 +140,14 @@ + ln -s ssh $(DESTDIR)$(bindir)/slogin + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 - if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ - ./mkinstalldirs $(DESTDIR)$(sysconfdir); \ @@ -17,12 +32,16 @@ $NetBSD: patch-ah,v 1.6 2000/07/02 22:07:56 itojun Exp $ + $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(examplesdir)/ssh_config; \ + $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(examplesdir)/sshd_config; \ fi -@@ -148,3 +149,3 @@ + if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \ $(PERL) fixprogs ssh_prng_cmds $(ENT); \ - $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \ + $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(examplesdir)/ssh_prng_cmds; \ fi -@@ -168,6 +169,6 @@ + + host-key: ssh-keygen +@@ -168,10 +169,10 @@ + ./ssh-keygen -d -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" + uninstallall: uninstall - -rm -f $(DESTDIR)$(sysconfdir)/ssh_config - -rm -f $(DESTDIR)$(sysconfdir)/sshd_config @@ -33,3 +52,5 @@ $NetBSD: patch-ah,v 1.6 2000/07/02 22:07:56 itojun Exp $ + -rm -f $(DESTDIR)$(examplesdir)/ssh_prng_cmds + -rmdir $(DESTDIR)$(examplesdir) -rmdir $(DESTDIR)$(bindir) + -rmdir $(DESTDIR)$(sbindir) + -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 diff --git a/security/openssh/pkg/PLIST b/security/openssh/pkg/PLIST index 3a8a4dc21e7..64d2495fa08 100644 --- a/security/openssh/pkg/PLIST +++ b/security/openssh/pkg/PLIST @@ -1,11 +1,10 @@ -@comment $NetBSD: PLIST,v 1.3 2000/05/31 15:32:44 itojun Exp $ -bin/ssh +@comment $NetBSD: PLIST,v 1.4 2000/07/22 08:22:03 jlam Exp $ bin/scp bin/slogin +bin/ssh bin/ssh-add bin/ssh-agent bin/ssh-keygen -sbin/sshd etc/rc.d/sshd.sh man/man1/ssh.1 man/man1/scp.1 @@ -14,13 +13,7 @@ man/man1/ssh-add.1 man/man1/ssh-agent.1 man/man1/ssh-keygen.1 man/man8/sshd.8 +sbin/sshd share/examples/ssh/ssh_config -@comment share/examples/ssh/ssh_prng_cmds share/examples/ssh/sshd_config -@exec if [ ! -d @SSH_CONF_DIR@ ]; then echo "Creating directory @SSH_CONF_DIR@ for ssh config files.." ; mkdir -p @SSH_CONF_DIR@; fi -@exec if [ ! -f @SSH_CONF_DIR@/ssh_config ]; then echo "Installing example ssh_config in @SSH_CONF_DIR@.." ; /usr/bin/install -c -o root -g wheel -m 0644 %D/share/examples/ssh/ssh_config @SSH_CONF_DIR@; fi -@exec if [ ! -f @SSH_CONF_DIR@/sshd_config ]; then echo "Installing example sshd_config in @SSH_CONF_DIR@.." ; /usr/bin/install -c -o root -g wheel -m 0644 %D/share/examples/ssh/sshd_config @SSH_CONF_DIR@; fi -@comment @exec if [ ! -f @SSH_CONF_DIR@/ssh_prng_cmds ]; then echo "Installing example ssh_prng_cmds in @SSH_CONF_DIR@.." ; /usr/bin/install -c -o root -g wheel -m 0644 %D/share/examples/ssh/ssh_prng_cmds @SSH_CONF_DIR@; fi -@exec if [ ! -f @SSH_CONF_DIR@/ssh_host_key ]; then echo "Generating an RSA secret host key in @SSH_CONF_DIR@.." ; %D/bin/ssh-keygen -N "" -f @SSH_CONF_DIR@/ssh_host_key; fi -@exec if [ ! -f @SSH_CONF_DIR@/ssh_host_dsa_key ]; then echo "Generating a DSA secret host key in @SSH_CONF_DIR@.." ; %D/bin/ssh-keygen -d -N "" -f @SSH_CONF_DIR@/ssh_host_dsa_key; fi @dirrm share/examples/ssh |