1#!/bin/sh 2. ./defs || exit 1 3 4# Skip the test if we can't find getcap 5PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin 6getcap 2>/dev/null 7res=$? 8test "$res" -le 1 || exit 77 9 10mkdir $tmp 11touch $tmp/foo 12# fakeroot mangles spaces unless the getopt utility is the GNU version 13echo "setcap cap_net_raw+ep $tmp/foo; getcap $tmp/foo" >$tmp/sh 14run_fakeroot -- \ 15 ${posixshell} $tmp/sh >$tmp/out 16cat $tmp/out 17grep "^$tmp/foo = cap_net_raw+ep" $tmp/out 18