]> git.deb.at Git - pkg/beep.git/blob - debian/postinst
Imported Debian patch 1.2.2-22
[pkg/beep.git] / debian / postinst
1 #!/bin/sh -e
2 # postinst for beep
3
4 # Source debconf library.
5 if [ -e /usr/share/debconf/confmodule ]; then
6         . /usr/share/debconf/confmodule
7 fi
8
9 if [ "$1" != configure ]; then
10         exit 0
11 fi
12
13 suid=false
14 if [ -e /usr/share/debconf/confmodule ]; then
15         db_get beep/suid_option
16         suid="$RET"
17 fi
18
19 # repair typo in option (see #135866)
20 if [ "$suid" = "suid root with only group audio executeable" ] ; then
21         db_set beep/suid_option "suid root with only group audio executable"
22         suid="suid root with only group audio executable"
23 fi
24
25 # option changes as suggested by #492724
26 if [ "$suid" = "suid root for all" ] ; then
27         db_set beep/suid_option "usable for all"
28         suid="usable for all"
29 fi
30 if [ "$suid" = "suid root with only group audio executable" ] ; then
31         db_set beep/suid_option "usable for group audio"
32         suid="usable for group audio"
33 fi
34 if [ "$suid" = "not suid at all" ] ; then
35         db_set beep/suid_option "usable only for root"
36         suid="usable only for root"
37 fi
38
39
40 if [ -x /usr/sbin/dpkg-statoverride ] ; then
41         if ! dpkg-statoverride --list /usr/bin/beep >/dev/null ; then
42                 if [ "$suid" = "usable for all" ] ; then
43                         chmod 4755 /usr/bin/beep
44                 elif [ "$suid" = "usable for group audio" ] ; then
45                         chmod 4754 /usr/bin/beep
46                 elif [ "$suid" = "usable only for root" ] ; then
47                         chmod 0755 /usr/bin/beep
48                 fi
49         fi
50 else
51         if [ "$suid" = "usable for all" ] ; then
52                 chmod 4755 /usr/bin/beep
53         elif [ "$suid" = "usable for group audio" ] ; then
54                 chmod 4754 /usr/bin/beep
55         elif [ "$suid" = "usable only for root" ] ; then
56                 chmod 0755 /usr/bin/beep
57         fi
58 fi