#! /bin/sh # postinst script for ax25-apps # # see: dh_installdeb(1) set -e # Source the debconf library. . /usr/share/debconf/confmodule # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. config_ax25_apps(){ # Check result of tools being setuid db_get ax25-apps/suid_listen if [ "$RET" = "true" ]; then { # Try registering with dpkg-statoverride first hash dpkg-statoverride 2>&- if [ $? -eq 0 ]; then dpkg-statoverride --update --add --force root root 4755 /usr/bin/axlisten # change program directly else chmod 4755 /usr/bin/axlisten fi } else { # set permission on /usr/bin/axlisten to know state not suid chmod 0755 /usr/bin/axlisten #if dpkg-statoverride is installed, remove axlisten from overrides hash dpkg-statoverride 2>&- if [ $? -eq 0 ]; then dpkg-statoverride --remove --force /usr/bin/axlisten fi } fi } convert_to_statoverride(){ #try to import suidmanager setting for axlisten dpkg-statoverride --add --force root root 0755 /usr/bin/axlisten } case "$1" in install) config_ax25_apps ;; upgrade) convert_to_statoverride config_ax25_apps ;; configure) config_ax25_apps ;; abort-upgrade) ;; *) echo "postinst called with unknown argument $1" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installmenu/13.14.1 if [ "$1" = "configure" ] && [ -x "`command -v update-menus`" ] && [ -x "$DPKG_ROOT`command -v update-menus`" ]; then update-menus fi # End automatically added section exit 0