xref: /linux/tools/testing/selftests/safesetid/safesetid-test.sh (revision c67e8ec03f3fd41c0b75f5596eee92460f4957c0)
1#!/bin/bash
2
3TCID="safesetid-test.sh"
4errcode=0
5
6# Kselftest framework requirement - SKIP code is 4.
7ksft_skip=4
8
9check_root()
10{
11	uid=$(id -u)
12	if [ $uid -ne 0 ]; then
13		echo $TCID: must be run as root >&2
14		exit $ksft_skip
15	fi
16}
17
18main_function()
19{
20  check_root
21  ./safesetid-test
22}
23
24main_function
25echo "$TCID: done"
26exit $errcode
27