1 #!/bin/bash 1 #!/bin/bash 2 2 3 TCID="safesetid-test.sh" 3 TCID="safesetid-test.sh" 4 errcode=0 4 errcode=0 5 5 6 # Kselftest framework requirement - SKIP code 6 # Kselftest framework requirement - SKIP code is 4. 7 ksft_skip=4 7 ksft_skip=4 8 8 9 check_root() 9 check_root() 10 { 10 { 11 uid=$(id -u) 11 uid=$(id -u) 12 if [ $uid -ne 0 ]; then 12 if [ $uid -ne 0 ]; then 13 echo $TCID: must be run as roo 13 echo $TCID: must be run as root >&2 14 exit $ksft_skip 14 exit $ksft_skip 15 fi 15 fi 16 } 16 } 17 17 18 main_function() 18 main_function() 19 { 19 { 20 check_root 20 check_root 21 ./safesetid-test 21 ./safesetid-test 22 } 22 } 23 23 24 main_function 24 main_function 25 echo "$TCID: done" 25 echo "$TCID: done" 26 exit $errcode 26 exit $errcode
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.