summaryrefslogtreecommitdiff
path: root/debian/openssh-client.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-client.postinst')
-rw-r--r--debian/openssh-client.postinst60
1 files changed, 0 insertions, 60 deletions
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst
index 2f884b7b7..d752d01c9 100644
--- a/debian/openssh-client.postinst
+++ b/debian/openssh-client.postinst
@@ -3,9 +3,6 @@
3action="$1" 3action="$1"
4oldversion="$2" 4oldversion="$2"
5 5
6. /usr/share/debconf/confmodule
7db_version 2.0
8
9umask 022 6umask 022
10 7
11if [ "$action" != configure ] 8if [ "$action" != configure ]
@@ -14,25 +11,6 @@ if [ "$action" != configure ]
14fi 11fi
15 12
16 13
17fix_rsh_diversion() {
18# get rid of mistaken rsh diversion (circa 1.2.27-1)
19
20 if [ -L /usr/bin/rsh ] &&
21 dpkg-divert --list '/usr/bin/rsh.real/rsh' | grep -q ' ssh$' ; then
22 for cmd in rlogin rsh rcp ; do
23 [ -L /usr/bin/$cmd ] && rm /usr/bin/$cmd
24 dpkg-divert --package ssh --remove --rename \
25 --divert /usr/bin/rsh.real/$cmd /usr/bin/$cmd
26
27 [ -L /usr/man/man1/$cmd.1.gz ] && rm /usr/man/man1/$$cmd.1.gz
28 dpkg-divert --package ssh --remove --rename \
29 --divert /usr/man/man1/$cmd.real.1.gz /usr/man/man1/$cmd.1.gz
30 done
31
32 rmdir /usr/bin/rsh.real
33 fi
34}
35
36create_alternatives() { 14create_alternatives() {
37# Create alternatives for the various r* tools. 15# Create alternatives for the various r* tools.
38# Make sure we don't change existing alternatives that a user might have 16# Make sure we don't change existing alternatives that a user might have
@@ -50,39 +28,6 @@ create_alternatives() {
50 done 28 done
51} 29}
52 30
53set_ssh_permissions() {
54 if dpkg --compare-versions "$oldversion" lt-nl 1:3.4p1-1 ; then
55 if [ -x /usr/sbin/dpkg-statoverride ] ; then
56 if dpkg-statoverride --list /usr/bin/ssh >/dev/null; then
57 dpkg-statoverride --remove /usr/bin/ssh >/dev/null
58 fi
59 fi
60 fi
61
62 # libexecdir changed, so migrate old statoverrides.
63 if [ -x /usr/sbin/dpkg-statoverride ] &&
64 override="$(dpkg-statoverride --list /usr/lib/ssh-keysign)"; then
65 override_user="${override%% *}"
66 override="${override#* }"
67 override_group="${override%% *}"
68 override="${override#* }"
69 override_mode="${override%% *}"
70 if dpkg-statoverride --update --add \
71 "$override_user" "$override_group" "$override_mode" \
72 /usr/lib/openssh/ssh-keysign; then
73 dpkg-statoverride --remove /usr/lib/ssh-keysign || true
74 fi
75 fi
76}
77
78fix_ssh_group() {
79 # Try to remove non-system group mistakenly created by 1:3.5p1-1.
80 # set_ssh_agent_permissions() below will re-create it properly.
81 if getent group ssh >/dev/null; then
82 delgroup --quiet ssh || true
83 fi
84}
85
86set_ssh_agent_permissions() { 31set_ssh_agent_permissions() {
87 if ! getent group ssh >/dev/null; then 32 if ! getent group ssh >/dev/null; then
88 addgroup --system --quiet ssh 33 addgroup --system --quiet ssh
@@ -95,12 +40,7 @@ set_ssh_agent_permissions() {
95} 40}
96 41
97 42
98fix_rsh_diversion
99create_alternatives 43create_alternatives
100set_ssh_permissions
101if [ "$2" = "1:3.5p1-1" ]; then
102 fix_ssh_group
103fi
104set_ssh_agent_permissions 44set_ssh_agent_permissions
105 45
106exit 0 46exit 0