]> git.deb.at Git - pkg/beep.git/blobdiff - debian/postinst
Imported Debian patch 1.2.2-2.woody1
[pkg/beep.git] / debian / postinst
diff --git a/debian/postinst b/debian/postinst
new file mode 100644 (file)
index 0000000..44c01f1
--- /dev/null
@@ -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