File: wireshark-common.postinst

package info (click to toggle)
wireshark 1.12.1%2Bg01b65bf-4%2Bdeb8u14
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 234,068 kB
  • sloc: ansic: 1,912,971; xml: 84,598; cpp: 41,923; python: 30,175; perl: 25,286; lex: 6,416; sh: 6,406; pascal: 6,120; makefile: 3,968; yacc: 297; asm: 156; awk: 58; tcl: 35
file content (40 lines) | stat: -rw-r--r-- 1,247 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

set -e

. /usr/share/debconf/confmodule
PROGRAM=/usr/bin/dumpcap
GROUP=wireshark

if ! dpkg-statoverride --list $PROGRAM > /dev/null; then
    db_get wireshark-common/install-setuid
    if [ -e "$PROGRAM" ]; then
	if [ "$RET" = "false" ] ; then
	    chown root:root $PROGRAM
	    chmod u=rwx,go=rx $PROGRAM
	else
	    if ! addgroup --quiet --system $GROUP; then
		echo "Executing \"addgroup --quiet --system $GROUP\" failed."
		echo "Most probably the $GROUP group exists, but is not a system group."
		echo "Please delete the existing group or re-create it as a system group and try configuring wireshark-common again."
		exit 1
	    fi
	    chown root:$GROUP $PROGRAM
	    if which setcap > /dev/null ; then
                chmod u=rwx,g=rx,o=r $PROGRAM
                if ! setcap cap_net_raw,cap_net_admin=eip $PROGRAM; then
		    echo "Setting capabilities for dumpcap using Linux Capabilities failed."
		    echo "Falling back to setting set-user-id bit."
		    chmod u=rwxs,g=rx,o=r $PROGRAM
                fi
	    else
                chmod u=rwxs,g=rx,o=r $PROGRAM
	    fi
        fi
    fi
else
    echo "Preserving owner and mode for $PROGRAM set by dpkg-statoverride:"
    dpkg-statoverride --list $PROGRAM
fi

#DEBHELPER#