#!/bin/sh

. ./test-functions

echo -n "/proc set as root test:		"
( # Sub-shell so as not to taint the test process.
	read -r subshellpid _ < /proc/self/stat
	echo 0 > /proc/$subshellpid/attr/current
	echo 1 > /proc/$subshellpid/attr/current
	if [ $? != 0 ]; then
		failmsg unable to set taint through /proc
		exit
	fi

	val=$(cat /proc/$subshellpid/attr/current)
	if [ x$val == x1 ]; then
		passmsg able to set taint through /proc
	else
		failmsg unable to set taint through /proc; set to $val
	fi
)
