diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-12-04 16:46:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-12-08 05:02:58 +0000 |
commit | 6021f24bbf526d34fead6120e9d3961358cb68fb (patch) | |
tree | 2be7357675b97d3b72ec13c6b64b865067dad704 /debian/open-infrastructure-root-shell.postinst | |
parent | Adding VERSION.txt. (diff) | |
download | root-shell-6021f24bbf526d34fead6120e9d3961358cb68fb.tar.xz root-shell-6021f24bbf526d34fead6120e9d3961358cb68fb.zip |
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'debian/open-infrastructure-root-shell.postinst')
-rwxr-xr-x | debian/open-infrastructure-root-shell.postinst | 49 |
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 |