When executed by the root user, skip tests that assume no privileges.

Reported-by: Rémi Duraffort <remi.duraffort@st.com>
This commit is contained in:
Cédric VINCENT 2014-07-07 10:32:50 +02:00
parent 437b4880cc
commit cef734a482
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,10 @@ if [ ! -x /bin/true ] [ -z `which id` ] || [ -z `which grep` ] || [ -z `which en
exit 125;
fi
if [ `id -u` -eq 0 ]; then
exit 125;
fi
${PROOT} -i 123:456 id -u | grep ^123$
${PROOT} -i 123:456 id -g | grep ^456$

View File

@ -2,6 +2,10 @@ if [ -z `which mcookie` ] || [ -z `which cp` ] || [ -z `which true` ] || [ -z `w
exit 125;
fi
if [ `id -u` -eq 0 ]; then
exit 125;
fi
TMP=/tmp/$(mcookie)
cp $(which true) ${TMP}