[arch-commits] Commit in openssh/trunk (PKGBUILD sshd.close-sessions)

Gaetan Bisson bisson at archlinux.org
Mon Mar 19 15:12:06 EDT 2012


    Date: Monday, March 19, 2012 @ 15:12:05
  Author: bisson
Revision: 153821

fix FS#17389

Added:
  openssh/trunk/sshd.close-sessions
Modified:
  openssh/trunk/PKGBUILD

---------------------+
 PKGBUILD            |    7 ++++---
 sshd.close-sessions |   14 ++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-03-19 19:10:52 UTC (rev 153820)
+++ PKGBUILD	2012-03-19 19:12:05 UTC (rev 153821)
@@ -5,7 +5,7 @@
 
 pkgname=openssh
 pkgver=5.9p1
-pkgrel=6
+pkgrel=7
 pkgdesc='Free version of the SSH connectivity tools'
 arch=('i686' 'x86_64')
 license=('custom:BSD')
@@ -14,10 +14,12 @@
 depends=('krb5' 'openssl' 'libedit')
 optdepends=('x11-ssh-askpass: input passphrase in X without a terminal')
 source=("ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname}-${pkgver}.tar.gz"
+        'sshd.close-sessions'
         'sshd.confd'
         'sshd.pam'
         'sshd')
 sha1sums=('ac4e0055421e9543f0af5da607a72cf5922dcc56'
+          '3e8efad4578bbeb8f9788432758c69dc2b303c1c'
           'ec102deb69cad7d14f406289d2fc11fee6eddbdd'
           '3413909fd45a28701c92e6e5b59c6b65346ddb0f'
           '21fa88de6cc1c7912e71655f50896ba17991a1c2')
@@ -50,16 +52,15 @@
 	install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd
 	install -Dm644 ../sshd.confd "${pkgdir}"/etc/conf.d/sshd
 	install -Dm644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENCE"
+	install -Dm755 ../sshd.close-sessions "${pkgdir}/etc/rc.d/functions.d/sshd-close-sessions" # FS#17389
 
 	rm "${pkgdir}"/usr/share/man/man1/slogin.1
 	ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz
 
-	# additional contrib scripts that we like
 	install -Dm755 contrib/findssl.sh "${pkgdir}"/usr/bin/findssl.sh
 	install -Dm755 contrib/ssh-copy-id "${pkgdir}"/usr/bin/ssh-copy-id
 	install -Dm644 contrib/ssh-copy-id.1 "${pkgdir}"/usr/share/man/man1/ssh-copy-id.1
 
-	# PAM is a common, standard feature to have
 	sed \
 		-e '/^#ChallengeResponseAuthentication yes$/c ChallengeResponseAuthentication no' \
 		-e '/^#UsePAM no$/c UsePAM yes' \

Added: sshd.close-sessions
===================================================================
--- sshd.close-sessions	                        (rev 0)
+++ sshd.close-sessions	2012-03-19 19:12:05 UTC (rev 153821)
@@ -0,0 +1,14 @@
+# Close sshd sessions before shutting down the network; see FS#17389.
+
+sshd_close_sessions () {
+	/etc/rc.d/sshd stop
+	stat_busy "Stopping Secure Shell Sessions"
+	for i in $(pgrep sshd); do
+		if readlink -q /proc/$i/exe &>/dev/null | grep -q '^/usr/sbin/sshd'; then
+			kill $i &>/dev/null
+		fi
+	done
+	stat_done
+}
+
+add_hook shutdown_start sshd_close_sessions



More information about the arch-commits mailing list