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.postinst45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst
new file mode 100644
index 000000000..ec0ad2b2b
--- /dev/null
+++ b/debian/openssh-client.postinst
@@ -0,0 +1,45 @@
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 ! dpkg-statoverride --list /usr/bin/ssh-agent >/dev/null; then
32 chgrp ssh /usr/bin/ssh-agent
33 chmod 2755 /usr/bin/ssh-agent
34 fi
35}
36
37
38if [ "$action" = configure ]; then
39 create_alternatives
40 set_ssh_agent_permissions
41fi
42
43#DEBHELPER#
44
45exit 0