File: newrole.postinst

package info (click to toggle)
policycoreutils 2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,360 kB
  • ctags: 3,268
  • sloc: python: 15,254; ansic: 9,586; sh: 1,263; makefile: 885
file content (17 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e

PROGRAM=/usr/bin/newrole

if [ "$1" = configure ]; then
    if which setcap > /dev/null && [ -e $PROGRAM ]; then
        if ! setcap cap_dac_read_search,cap_setpcap,cap_audit_write,cap_sys_admin,cap_fowner,cap_chown,cap_dac_override=pe $PROGRAM >/dev/null 2>&1; then
            echo "Setting capabilities newrole using Linux Capabilities failed, falling back to setuid."
            chmod 4755 $PROGRAM
        fi
    fi
fi

#DEBHELPER#

exit 0