| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # postinst script for ax25-apps |
| 3 | # |
| 4 | # see: dh_installdeb(1) |
| 5 | |
| 6 | set -e |
| 7 | |
| 8 | # Source the debconf library. |
| 9 | . /usr/share/debconf/confmodulescip-shell source . . `/usr/share/debconf/confmodule`. |
| 10 | |
| 11 | # summary of how this script can be called: |
| 12 | # * <postinst> `configure' <most-recently-configured-version> |
| 13 | # * <old-postinst> `abort-upgrade' <new version> |
| 14 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
| 15 | # <new-version> |
| 16 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
| 17 | # <failed-install-package> <version> `removing' |
| 18 | # <conflicting-package> <version> |
| 19 | # for details, see /usr/doc/packaging-manual/ |
| 20 | # |
| 21 | # quoting from the policy: |
| 22 | # Any necessary prompting should almost always be confined to the |
| 23 | # post-installation script, and should be protected with a conditional |
| 24 | # so that unnecessary prompting doesn't happen if a package's |
| 25 | # installation fails and the `postinst' is called with `abort-upgrade', |
| 26 | # `abort-remove' or `abort-deconfigure'. |
| 27 | |
| 28 | config_ax25_appsscip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 config_ax25_apps().(){ |
| 29 | # Check result of tools being setuid |
| 30 | db_get ax25-apps/suid_listen |
| 31 | if [scip-shell system . . `[`. "$RET" = "true" ]; then |
| 32 | { |
| 33 | # Try registering with dpkg-statoverride first |
| 34 | if ! dpkg-statoverridescip-shell system . . dpkg-statoverride. --list /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 35 | dpkg-statoverridescip-shell system . . dpkg-statoverride. --update --add root root 4755 /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. |
| 36 | # change program directly |
| 37 | else |
| 38 | chmodscip-shell system . . chmod. 4755 /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. |
| 39 | fi |
| 40 | } |
| 41 | else |
| 42 | { |
| 43 | # set permission on /usr/bin/axlisten to know state not suid |
| 44 | chmodscip-shell system . . chmod. 0755 /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. |
| 45 | #if dpkg-statoverride is installed, remove axlisten from overrides |
| 46 | if dpkg-statoverridescip-shell system . . dpkg-statoverride. --list /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 47 | dpkg-statoverridescip-shell system . . dpkg-statoverride. --remove /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. |
| 48 | fi |
| 49 | } |
| 50 | fi |
| 51 | } |
| 52 | |
| 53 | convert_to_statoverridescip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 convert_to_statoverride().(){ |
| 54 | #try to import suidmanager setting for axlisten |
| 55 | if ! dpkg-statoverridescip-shell system . . dpkg-statoverride. --list /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 56 | dpkg-statoverridescip-shell system . . dpkg-statoverride. --add root root 0755 /usr/bin/axlistenscip-shell filesystem . . `/usr/bin/axlisten`. |
| 57 | fi |
| 58 | } |
| 59 | |
| 60 | case "$1" in |
| 61 | install) |
| 62 | config_ax25_appsscip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 config_ax25_apps(). |
| 63 | ;; |
| 64 | |
| 65 | upgrade) |
| 66 | convert_to_statoverridescip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 convert_to_statoverride(). |
| 67 | config_ax25_appsscip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 config_ax25_apps(). |
| 68 | ;; |
| 69 | |
| 70 | configure) |
| 71 | config_ax25_appsscip-shell shell ax25-apps 0.0.8-rc5+git20230513+afc4a5f-4 config_ax25_apps(). |
| 72 | ;; |
| 73 | |
| 74 | abort-upgrade) |
| 75 | ;; |
| 76 | |
| 77 | *) |
| 78 | echoscip-shell system . . echo. "postinst called with unknown argument $1" >&2 |
| 79 | exit 0 |
| 80 | ;; |
| 81 | esac |
| 82 | |
| 83 | # dh_installdeb will replace this with shell code automatically |
| 84 | # generated by other debhelper scripts. |
| 85 | |
| 86 | #DEBHELPER# |
| 87 | exit 0 |
| 88 |