1166065Spjd#!/bin/sh 2166065Spjd# $FreeBSD: releng/10.3/tools/regression/pjdfstest/tests/truncate/05.t 166065 2007-01-17 01:42:12Z pjd $ 3166065Spjd 4166065Spjddesc="truncate returns EACCES when search permission is denied for a component of the path prefix" 5166065Spjd 6166065Spjddir=`dirname $0` 7166065Spjd. ${dir}/../misc.sh 8166065Spjd 9166065Spjdecho "1..15" 10166065Spjd 11166065Spjdn0=`namegen` 12166065Spjdn1=`namegen` 13166065Spjdn2=`namegen` 14166065Spjd 15166065Spjdexpect 0 mkdir ${n0} 0755 16166065Spjdcdir=`pwd` 17166065Spjdcd ${n0} 18166065Spjdexpect 0 mkdir ${n1} 0755 19166065Spjdexpect 0 chown ${n1} 65534 65534 20166065Spjdexpect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 21166065Spjdexpect 0 -u 65534 -g 65534 truncate ${n1}/${n2} 123 22166065Spjdexpect 123 -u 65534 -g 65534 stat ${n1}/${n2} size 23166065Spjdexpect 0 chmod ${n1} 0644 24166065Spjdexpect EACCES -u 65534 -g 65534 truncate ${n1}/${n2} 1234 25166065Spjdexpect 0 chmod ${n1} 0755 26166065Spjdexpect 123 -u 65534 -g 65534 stat ${n1}/${n2} size 27166065Spjdexpect 0 -u 65534 -g 65534 truncate ${n1}/${n2} 1234 28166065Spjdexpect 1234 -u 65534 -g 65534 stat ${n1}/${n2} size 29166065Spjdexpect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 30166065Spjdexpect 0 rmdir ${n1} 31166065Spjdcd ${cdir} 32166065Spjdexpect 0 rmdir ${n0} 33