From 6021f24bbf526d34fead6120e9d3961358cb68fb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 Dec 2021 17:46:01 +0100 Subject: Adding debian version 20211204-1. Signed-off-by: Daniel Baumann --- debian/open-infrastructure-root-shell.postinst | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 debian/open-infrastructure-root-shell.postinst (limited to 'debian/open-infrastructure-root-shell.postinst') diff --git a/debian/open-infrastructure-root-shell.postinst b/debian/open-infrastructure-root-shell.postinst new file mode 100755 index 0000000..0d83f5f --- /dev/null +++ b/debian/open-infrastructure-root-shell.postinst @@ -0,0 +1,49 @@ +#!/bin/sh + +set -e + +case "${1}" in + configure) + . /usr/share/debconf/confmodule + + db_get open-infrastructure-root-shell/setuid-root + SETUID_ROOT="${RET}" # boolean + + db_stop + + case "${SETUID_ROOT}" in + true) + echo -n "Adding setuid bit on /bin/root-shell..." + + # don't stop on errors for robustness reasons + chown root:root /bin/root-shell || true + chmod 4755 /bin/root-shell || true + + echo " done." + ;; + + false) + echo -n "Removing setuid bit on /bin/root-shell..." + + # don't stop on errors for robustness reasons + chown root:root /bin/root-shell || true + chmod 0755 /bin/root-shell || true + + echo " done." + ;; + esac + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 -- cgit v1.2.3