diff options
author | Colin Watson <cjwatson@debian.org> | 2008-02-08 00:29:23 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2008-02-08 00:29:23 +0000 |
commit | 0cf35bd0df53b4e540a8b8525b5519f55737c327 (patch) | |
tree | 7acacb094349ccaab2e79445c2f033b8ee6fe0e2 | |
parent | 74cc48e9516ec9b6fe9d77cc5cc833552d3a7e8d (diff) |
* Move /etc/pam.d/ssh to /etc/pam.d/sshd, allowing us to stop defining
SSHD_PAM_SERVICE (closes: #255870).
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/openssh-server.postinst | 14 | ||||
-rw-r--r-- | debian/openssh-server.postrm | 25 | ||||
-rw-r--r-- | debian/openssh-server.preinst | 17 | ||||
-rw-r--r-- | debian/openssh-server.sshd.pam (renamed from debian/openssh-server.ssh.pam) | 0 | ||||
-rwxr-xr-x | debian/rules | 3 |
6 files changed, 59 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 8b1f8d856..4a8c1798b 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -6,6 +6,8 @@ openssh (1:4.7p1-4) UNRELEASED; urgency=low | |||
6 | 6 | ||
7 | [ Colin Watson ] | 7 | [ Colin Watson ] |
8 | * Include the autogenerated debian/copyright in the source package. | 8 | * Include the autogenerated debian/copyright in the source package. |
9 | * Move /etc/pam.d/ssh to /etc/pam.d/sshd, allowing us to stop defining | ||
10 | SSHD_PAM_SERVICE (closes: #255870). | ||
9 | 11 | ||
10 | -- Colin Watson <cjwatson@debian.org> Mon, 04 Feb 2008 09:47:31 +0000 | 12 | -- Colin Watson <cjwatson@debian.org> Mon, 04 Feb 2008 09:47:31 +0000 |
11 | 13 | ||
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst index 61d34d281..ed7590c87 100644 --- a/debian/openssh-server.postinst +++ b/debian/openssh-server.postinst | |||
@@ -372,6 +372,19 @@ commit_transfer_conffile () { | |||
372 | fi | 372 | fi |
373 | } | 373 | } |
374 | 374 | ||
375 | commit_mv_conffile () { | ||
376 | OLDCONFFILE="$1" | ||
377 | NEWCONFFILE="$2" | ||
378 | |||
379 | if [ -e "$OLDCONFFILE.moving" ]; then | ||
380 | echo "Preserving user changes to $NEWCONFFILE ..." | ||
381 | mv -f "$NEWCONFFILE" "$NEWCONFFILE.dpkg-new" | ||
382 | mv -f "$OLDCONFFILE.moving" "$NEWCONFFILE" | ||
383 | elif [ -e "$OLDCONFFILE.dpkg-old" ]; then | ||
384 | rm -f "$OLDCONFFILE.dpkg-old" | ||
385 | fi | ||
386 | } | ||
387 | |||
375 | 388 | ||
376 | fix_doc_symlink | 389 | fix_doc_symlink |
377 | create_sshdconfig | 390 | create_sshdconfig |
@@ -392,6 +405,7 @@ setup_init | |||
392 | commit_transfer_conffile /etc/default/ssh | 405 | commit_transfer_conffile /etc/default/ssh |
393 | commit_transfer_conffile /etc/init.d/ssh | 406 | commit_transfer_conffile /etc/init.d/ssh |
394 | commit_transfer_conffile /etc/pam.d/ssh | 407 | commit_transfer_conffile /etc/pam.d/ssh |
408 | commit_mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd | ||
395 | # Renamed to /etc/ssh/moduli in 2.9.9 (!) | 409 | # Renamed to /etc/ssh/moduli in 2.9.9 (!) |
396 | if dpkg --compare-versions "$2" lt 1:4.7p1-1; then | 410 | if dpkg --compare-versions "$2" lt 1:4.7p1-1; then |
397 | rm -f /etc/ssh/primes | 411 | rm -f /etc/ssh/primes |
diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm index 32471c718..30682d6d0 100644 --- a/debian/openssh-server.postrm +++ b/debian/openssh-server.postrm | |||
@@ -2,6 +2,26 @@ | |||
2 | 2 | ||
3 | #DEBHELPER# | 3 | #DEBHELPER# |
4 | 4 | ||
5 | abort_mv_conffile () { | ||
6 | CONFFILE="$1" | ||
7 | |||
8 | if [ ! -e "$CONFFILE" ]; then | ||
9 | if [ -e "$CONFFILE.dpkg-old" ]; then | ||
10 | mv -f "$CONFFILE.dpkg-old" "$CONFFILE" | ||
11 | elif [ -e "$CONFFILE.moving" ]; then | ||
12 | mv -f "$CONFFILE.moving" "$CONFFILE" | ||
13 | fi | ||
14 | fi | ||
15 | } | ||
16 | |||
17 | finish_mv_conffile () { | ||
18 | CONFFILE="$1" | ||
19 | |||
20 | if [ -e "$CONFFILE.dpkg-old" ]; then | ||
21 | rm -f "$CONFFILE.dpkg-old" | ||
22 | fi | ||
23 | } | ||
24 | |||
5 | abort_transfer_conffile () { | 25 | abort_transfer_conffile () { |
6 | CONFFILE="$1" | 26 | CONFFILE="$1" |
7 | if [ -e "$CONFFILE.moved-by-preinst" ]; then | 27 | if [ -e "$CONFFILE.moved-by-preinst" ]; then |
@@ -13,6 +33,9 @@ abort_transfer_conffile () { | |||
13 | 33 | ||
14 | case $1 in | 34 | case $1 in |
15 | abort-install|abort-upgrade) | 35 | abort-install|abort-upgrade) |
36 | if dpkg --compare-versions "$2" lt 1:4.7p1-4; then | ||
37 | abort_mv_conffile /etc/pam.d/ssh | ||
38 | fi | ||
16 | abort_transfer_conffile /etc/default/ssh | 39 | abort_transfer_conffile /etc/default/ssh |
17 | abort_transfer_conffile /etc/init.d/ssh | 40 | abort_transfer_conffile /etc/init.d/ssh |
18 | abort_transfer_conffile /etc/pam.d/ssh | 41 | abort_transfer_conffile /etc/pam.d/ssh |
@@ -34,6 +57,8 @@ case $1 in | |||
34 | if type deluser >/dev/null 2>&1; then | 57 | if type deluser >/dev/null 2>&1; then |
35 | deluser --quiet sshd > /dev/null || true | 58 | deluser --quiet sshd > /dev/null || true |
36 | fi | 59 | fi |
60 | |||
61 | finish_mv_conffile /etc/pam.d/ssh | ||
37 | ;; | 62 | ;; |
38 | esac | 63 | esac |
39 | 64 | ||
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst index 87871bdaa..4ca7f2f6e 100644 --- a/debian/openssh-server.preinst +++ b/debian/openssh-server.preinst | |||
@@ -36,6 +36,19 @@ prepare_transfer_conffile () { | |||
36 | fi | 36 | fi |
37 | } | 37 | } |
38 | 38 | ||
39 | prepare_mv_conffile () { | ||
40 | CONFFILE="$1" | ||
41 | [ -e "$CONFFILE" ] || return 0 | ||
42 | |||
43 | md5sum="$(md5sum "$CONFFILE" | sed -e 's/ .*//')" | ||
44 | old_md5sum="$(dpkg-query -W -f '${Conffiles}\n' openssh-server 2>/dev/null | sed 's/^ *//' | awk '$1 == "'"$CONFFILE"'" { print $2 }')" | ||
45 | if [ "$md5sum" = "$old_md5sum" ]; then | ||
46 | mv -f "$CONFFILE" "$CONFFILE.dpkg-old" | ||
47 | else | ||
48 | mv -f "$CONFFILE" "$CONFFILE.moving" | ||
49 | fi | ||
50 | } | ||
51 | |||
39 | if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then | 52 | if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then |
40 | version=1.2.27 | 53 | version=1.2.27 |
41 | fi | 54 | fi |
@@ -117,6 +130,10 @@ EOF | |||
117 | prepare_transfer_conffile /etc/init.d/ssh "$ETC_INIT_D_SSH" 0755 | 130 | prepare_transfer_conffile /etc/init.d/ssh "$ETC_INIT_D_SSH" 0755 |
118 | prepare_transfer_conffile /etc/pam.d/ssh "$ETC_PAM_D_SSH" 0644 | 131 | prepare_transfer_conffile /etc/pam.d/ssh "$ETC_PAM_D_SSH" 0644 |
119 | fi | 132 | fi |
133 | |||
134 | if dpkg --compare-versions "$version" lt 1:4.7p1-4; then | ||
135 | prepare_mv_conffile /etc/pam.d/ssh | ||
136 | fi | ||
120 | fi | 137 | fi |
121 | 138 | ||
122 | #DEBHELPER# | 139 | #DEBHELPER# |
diff --git a/debian/openssh-server.ssh.pam b/debian/openssh-server.sshd.pam index 9b7695184..9b7695184 100644 --- a/debian/openssh-server.ssh.pam +++ b/debian/openssh-server.sshd.pam | |||
diff --git a/debian/rules b/debian/rules index 964f320cb..746624498 100755 --- a/debian/rules +++ b/debian/rules | |||
@@ -96,7 +96,6 @@ confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superu | |||
96 | # Compiler flags. | 96 | # Compiler flags. |
97 | cflags := $(OPTFLAGS) $(PIE_CFLAGS) | 97 | cflags := $(OPTFLAGS) $(PIE_CFLAGS) |
98 | cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT | 98 | cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT |
99 | cflags += -DSSHD_PAM_SERVICE=\"ssh\" | ||
100 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | 99 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" |
101 | cflags_udeb := -Os | 100 | cflags_udeb := -Os |
102 | cflags_udeb += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | 101 | cflags_udeb += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" |
@@ -241,7 +240,7 @@ binary-openssh-server: build install | |||
241 | dh_installdocs | 240 | dh_installdocs |
242 | mv debian/openssh-server/usr/share/doc/openssh-server debian/openssh-server/usr/share/doc/openssh-client | 241 | mv debian/openssh-server/usr/share/doc/openssh-server debian/openssh-server/usr/share/doc/openssh-client |
243 | rm -f debian/openssh-server/usr/share/doc/openssh-client/copyright | 242 | rm -f debian/openssh-server/usr/share/doc/openssh-client/copyright |
244 | dh_installpam --name ssh | 243 | dh_installpam --name sshd |
245 | dh_link | 244 | dh_link |
246 | dh_strip | 245 | dh_strip |
247 | dh_compress | 246 | dh_compress |