summaryrefslogtreecommitdiffstats
path: root/debian/open-infrastructure-root-shell.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-12-04 16:46:01 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-12-08 05:02:58 +0000
commit6021f24bbf526d34fead6120e9d3961358cb68fb (patch)
tree2be7357675b97d3b72ec13c6b64b865067dad704 /debian/open-infrastructure-root-shell.postinst
parentAdding VERSION.txt. (diff)
downloadroot-shell-6021f24bbf526d34fead6120e9d3961358cb68fb.tar.xz
root-shell-6021f24bbf526d34fead6120e9d3961358cb68fb.zip
Adding debian version 20211204-1.HEADmain
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xdebian/open-infrastructure-root-shell.postinst49
1 files changed, 49 insertions, 0 deletions
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