debian/newpid.postinst
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | case $1 in |
| 6 | configure) |
| 7 | # Code cargo-culted from iputils-ping postinst: |
| 8 | if setcap "CAP_SYS_ADMIN,CAP_NET_ADMIN=pe" /usr/bin/newpid; then |
| 9 | chmod u-s /usr/bin/newpid |
| 10 | else |
| 11 | echo "Setcap failed on /usr/bin/newpid, falling back to setuid" >&2 |
| 12 | chmod u+s /usr/bin/newpid |
| 13 | fi |
| 14 | ;; |
| 15 | esac |
| 16 | |
| 17 | #DEBHELPER# |