tools/testing/selftests/safesetid/safesetid-test.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/safesetid/safesetid-test.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/safesetid/safesetid-test.sh
Extension
.sh
Size
331 bytes
Lines
27
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash

TCID="safesetid-test.sh"
errcode=0

# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

check_root()
{
	uid=$(id -u)
	if [ $uid -ne 0 ]; then
		echo $TCID: must be run as root >&2
		exit $ksft_skip
	fi
}

main_function()
{
  check_root
  ./safesetid-test
}

main_function
echo "$TCID: done"
exit $errcode

Annotation

Implementation Notes