summaryrefslogtreecommitdiffstats
path: root/debian/open-infrastructure-root-shell.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/open-infrastructure-root-shell.postinst')
-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