mirror of
https://github.com/proot-me/proot.git
synced 2025-02-17 09:35:53 +00:00
25 lines
467 B
Bash
25 lines
467 B
Bash
if [ -z `which mcookie` ] || [ -z `which mkdir` ] || [ -z `which cp` ] || [ -z `which rm` ] || [ -z `which chmod` ] || [ -z `which env` ] || [ -z `which true` ]; then
|
|
exit 125
|
|
fi
|
|
|
|
TMP=/tmp/$(mcookie)
|
|
|
|
mkdir ${TMP}
|
|
|
|
cp $(which true) ${TMP}/
|
|
if [ ! -x ${TMP}/true ]; then
|
|
rm -fr ${TMP}
|
|
exit 125
|
|
fi
|
|
rm -f ${TMP}/true
|
|
|
|
chmod -w ${TMP}
|
|
|
|
! env PROOT_TMP_DIR=${TMP} ${PROOT} true
|
|
[ $? -eq 0 ]
|
|
|
|
chmod +w ${TMP}
|
|
env PROOT_TMP_DIR=${TMP} ${PROOT} true
|
|
|
|
rm -fr ${TMP}
|