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.postinst46
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst
new file mode 100644
index 000000000..978b04a9b
--- /dev/null
+++ b/debian/openssh-client.postinst
@@ -0,0 +1,46 @@
1#!/bin/sh
2set -e
3
4action="$1"
5oldversion="$2"
6
7umask 022
8
9
10create_alternatives() {
11# Create alternatives for the various r* tools.
12# Make sure we don't change existing alternatives that a user might have
13# changed, but clean up after some old alternatives that mistakenly pointed
14# rlogin and rcp to ssh.
15 update-alternatives --quiet --remove rlogin /usr/bin/ssh
16 update-alternatives --quiet --remove rcp /usr/bin/ssh
17 for cmd in rsh rlogin rcp; do
18 scmd="s${cmd#r}"
19 if ! update-alternatives --display "$cmd" 2>/dev/null | \
20 grep -q "$scmd"; then
21 update-alternatives --quiet --install "/usr/bin/$cmd" "$cmd" "/usr/bin/$scmd" 20 \
22 --slave "/usr/share/man/man1/$cmd.1.gz" "$cmd.1.gz" "/usr/share/man/man1/$scmd.1.gz"
23 fi
24 done
25}
26
27set_ssh_agent_permissions() {
28 if ! getent group ssh >/dev/null; then
29 addgroup --system --quiet ssh
30 fi
31 if ! [ -x /usr/sbin/dpkg-statoverride ] || \
32 ! dpkg-statoverride --list /usr/bin/ssh-agent >/dev/null ; then
33 chgrp ssh /usr/bin/ssh-agent
34 chmod 2755 /usr/bin/ssh-agent
35 fi
36}
37
38
39if [ "$action" = configure ]; then
40 create_alternatives
41 set_ssh_agent_permissions
42fi
43
44#DEBHELPER#
45
46exit 0