File: newpid.postinst

package info (click to toggle)
newpid 14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 84 kB
  • sloc: ansic: 210; makefile: 44; sh: 12; perl: 12
file content (17 lines) | stat: -rw-r--r-- 323 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

case $1 in
	configure)
		# Code cargo-culted from iputils-ping postinst:
		if setcap "CAP_SYS_ADMIN,CAP_NET_ADMIN=pe" /usr/bin/newpid; then
			chmod u-s /usr/bin/newpid
		else
			echo "Setcap failed on /usr/bin/newpid, falling back to setuid" >&2
			chmod u+s /usr/bin/newpid
		fi
		;;
esac

#DEBHELPER#