summaryrefslogtreecommitdiffstats
path: root/debian/openssh-client.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:26:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:26:58 +0000
commit4722d4b7980d6fd8145e2e9f08492d951ea261d1 (patch)
tree7ab498b39f5bdce46b1bbc41ef5201322df4e2d4 /debian/openssh-client.postinst
parentAdding upstream version 1:7.9p1. (diff)
downloadopenssh-4722d4b7980d6fd8145e2e9f08492d951ea261d1.tar.xz
openssh-4722d4b7980d6fd8145e2e9f08492d951ea261d1.zip
Adding debian version 1:7.9p1-10+deb10u2.debian/1%7.9p1-10+deb10u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 0000000..ec0ad2b
--- /dev/null
+++ b/debian/openssh-client.postinst
@@ -0,0 +1,45 @@
+#!/bin/sh
+set -e
+
+action="$1"
+oldversion="$2"
+
+umask 022
+
+
+create_alternatives() {
+# Create alternatives for the various r* tools.
+# Make sure we don't change existing alternatives that a user might have
+# changed, but clean up after some old alternatives that mistakenly pointed
+# rlogin and rcp to ssh.
+ update-alternatives --quiet --remove rlogin /usr/bin/ssh
+ update-alternatives --quiet --remove rcp /usr/bin/ssh
+ for cmd in rsh rlogin rcp; do
+ scmd="s${cmd#r}"
+ if ! update-alternatives --display "$cmd" 2>/dev/null | \
+ grep -q "$scmd"; then
+ update-alternatives --quiet --install "/usr/bin/$cmd" "$cmd" "/usr/bin/$scmd" 20 \
+ --slave "/usr/share/man/man1/$cmd.1.gz" "$cmd.1.gz" "/usr/share/man/man1/$scmd.1.gz"
+ fi
+ done
+}
+
+set_ssh_agent_permissions() {
+ if ! getent group ssh >/dev/null; then
+ addgroup --system --quiet ssh
+ fi
+ if ! dpkg-statoverride --list /usr/bin/ssh-agent >/dev/null; then
+ chgrp ssh /usr/bin/ssh-agent
+ chmod 2755 /usr/bin/ssh-agent
+ fi
+}
+
+
+if [ "$action" = configure ]; then
+ create_alternatives
+ set_ssh_agent_permissions
+fi
+
+#DEBHELPER#
+
+exit 0