1
0
mirror of https://github.com/proot-me/proot.git synced 2024-11-23 18:16:18 +00:00
proot/test/test-a4d7ed70.sh
2019-12-19 15:37:02 -05:00

17 lines
414 B
Bash

if [ -z `which mcookie` ] || [ -z `which mkdir` ] || [ -z `which ln` ] || [ -z `which ls` ] || [ -z `which rm` ] || [ -z `which cat` ]; then
exit 125;
fi
TMP=/tmp/$(mcookie)
TMP2=/tmp/$(mcookie)
mkdir ${TMP}
ln -s /proc/self/fd ${TMP}/fd
ln -s ${TMP}/fd/0 ${TMP}/stdin
${PROOT} \ls ${TMP}/stdin | grep ^${TMP}/stdin$
echo OK > ${TMP2}
${PROOT} cat ${TMP}/stdin < ${TMP2} | grep ^OK$
rm -fr ${TMP} ${TMP2}