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