summaryrefslogtreecommitdiffstats
path: root/debian/openssh-client.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:40:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:40:05 +0000
commite21fe8c3a4007c4a10f67e9e8107c3f083002f06 (patch)
tree926b3c2a4d3fd0decde08f6a4d22862ef03a7046 /debian/openssh-client.postinst
parentAdding upstream version 1:9.2p1. (diff)
downloadopenssh-e21fe8c3a4007c4a10f67e9e8107c3f083002f06.tar.xz
openssh-e21fe8c3a4007c4a10f67e9e8107c3f083002f06.zip
Adding debian version 1:9.2p1-2+deb12u2.debian/1%9.2p1-2+deb12u2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/openssh-client.postinst')
-rw-r--r--debian/openssh-client.postinst48
1 files changed, 48 insertions, 0 deletions
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst
new file mode 100644
index 0000000..dd4d95a
--- /dev/null
+++ b/debian/openssh-client.postinst
@@ -0,0 +1,48 @@
+#!/bin/sh
+set -e
+
+action="$1"
+
+umask 022
+
+
+update_ssh_group_name() {
+ # The _ssh group used to be called ssh, but that could clash with
+ # locally-created user accounts. Since this only exists as an
+ # otherwise-empty group to which ssh-agent is installed setgid, it's
+ # easy to rename.
+ if getent group ssh >/dev/null && ! getent group _ssh >/dev/null; then
+ groupmod -n _ssh ssh
+ fi
+}
+
+set_ssh_agent_permissions() {
+ if ! getent group _ssh >/dev/null; then
+ addgroup --system --quiet --force-badname _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
+}
+
+remove_obsolete_alternatives() {
+ update-alternatives --remove rcp /usr/bin/scp
+ update-alternatives --remove rlogin /usr/bin/slogin
+ update-alternatives --remove rsh /usr/bin/ssh
+}
+
+
+if [ "$action" = configure ]; then
+ if dpkg --compare-versions "$2" lt-nl 1:8.4p1-6~; then
+ update_ssh_group_name
+ fi
+ set_ssh_agent_permissions
+ if dpkg --compare-versions "$2" lt-nl 1:9.1p1-1~; then
+ remove_obsolete_alternatives
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0