X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=44c01f1a3c449c5207c354a18384c9d6b874ad6d;hb=d858fa441d75da1e93c99d2ac068786cdcba8c08;hp=0000000000000000000000000000000000000000;hpb=05e67326bf208399329240c1c5ab5513d15b0505;p=pkg%2Fbeep.git diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..44c01f1 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,48 @@ +#!/bin/sh -e + +action="$1" + +# Source debconf library. +if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +if [ "$action" != configure ]; then + exit 0 +fi + +if [ -d /usr/doc -a ! -e /usr/doc/beep -a -d /usr/share/doc/beep ]; then + ln -sf ../share/doc/beep /usr/doc/beep +fi + +suid=false +if [ -e /usr/share/debconf/confmodule ]; then + db_get beep/suid_option + suid="$RET" +fi + +# repair typo in option (see #135866) +if [ "$suid" = "suid root with only group audio executeable" ] ; then + db_set beep/suid_option "suid root with only group audio executable" + suid="suid root with only group audio executable" +fi + +if [ -x /usr/sbin/dpkg-statoverride ] ; then + if ! dpkg-statoverride --list /usr/bin/beep >/dev/null ; then + if [ "$suid" = "suid root for all" ] ; then + chmod 4755 /usr/bin/beep + elif [ "$suid" = "suid root with only group audio executable" ] ; then + chmod 4754 /usr/bin/beep + elif [ "$suid" = "not suid at all" ] ; then + chmod 0755 /usr/bin/beep + fi + fi +else + if [ "$suid" = "suid root for all" ] ; then + chmod 4755 /usr/bin/beep + elif [ "$suid" = "suid root with only group audio executable" ] ; then + chmod 4754 /usr/bin/beep + elif [ "$suid" = "not suid at all" ] ; then + chmod 0755 /usr/bin/beep + fi +fi