0
1
mirror of https://github.com/termux/proot.git synced 2024-11-11 13:49:26 +00:00
proot/tests/test-e940896f.sh
2016-08-21 07:42:00 -04:00

23 lines
578 B
Bash

if [ ! -x ${ROOTFS}/bin/readdir ] || [ -z `which mcookie` ] || [ -z `which rm` ] || [ -z `which mkdir` ] || [ -z `which chmod` ] || [ -z `which rm` ]; then
exit 125;
fi
TMP1=/tmp/$(mcookie)
TMP2=${TMP1}/$(mcookie)/$(mcookie)
rm -fr ${TMP1}
rm -fr ${ROOTFS}/${TMP1}
mkdir -p ${TMP2}
mkdir -p ${ROOTFS}/${TMP1}
chmod -w ${ROOTFS}/${TMP1}
cd ${TMP2}
${PROOT} -r ${ROOTFS} -b . readdir ${TMP1}
${PROOT} -r ${ROOTFS} -b . readdir ${TMP2}
${PROOT} -r ${ROOTFS} -b . readdir ${TMP2}/..
${PROOT} -r ${ROOTFS} -b . readdir ${TMP2}/../..
rm -fr ${TMP1}
rm -fr ${ROOTFS}/${TMP1}