Files
shadow/tests/su/02/run
nekral-guest 39beb1da3a 105_zn_CN was just applied to upstream repository.
Tag 104_man-sv, 101_ja, and 103_man-de as going to be fixed in 4.0.18.2.
2007-10-27 12:51:13 +00:00

45 lines
630 B
Bash
Executable File

#!/bin/sh
set -e
cd $(dirname $0)
# Rational:
# Test that su can be used to switch to root and to a normal account
# no testsuite password
# root password: rootF00barbaz
# myuser password: myuserF00barbaz
save()
{
[ ! -d tmp ] && mkdir tmp
for i in passwd group shadow gshadow
do
[ -f /etc/$i ] && cp /etc/$i tmp/$i
done
true
}
restore()
{
for i in passwd group shadow gshadow
do
[ -f tmp/$i ] && cp tmp/$i /etc/$i && rm tmp/$i
done
rmdir tmp
}
save
# restore the files on exit
trap 'restore' 0
cp data/{passwd,shadow,group,gshadow} /etc/
./run.exp
./run.exp "-c bash"
./run.exp2
./run.exp2 "-c bash"