140a8ac8fSEnji Cooper#!/bin/sh 2*3416500aSEnji Cooper# vim: filetype=sh noexpandtab ts=8 sw=8 340a8ac8fSEnji Cooper# $FreeBSD: head/tools/regression/pjdfstest/tests/truncate/06.t 211352 2010-08-15 21:24:17Z pjd $ 440a8ac8fSEnji Cooper 540a8ac8fSEnji Cooperdesc="truncate returns EACCES if the named file is not writable by the user" 640a8ac8fSEnji Cooper 740a8ac8fSEnji Cooperdir=`dirname $0` 840a8ac8fSEnji Cooper. ${dir}/../misc.sh 940a8ac8fSEnji Cooper 1040a8ac8fSEnji Cooperecho "1..8" 1140a8ac8fSEnji Cooper 1240a8ac8fSEnji Coopern0=`namegen` 1340a8ac8fSEnji Coopern1=`namegen` 1440a8ac8fSEnji Cooper 1540a8ac8fSEnji Cooperexpect 0 mkdir ${n0} 0755 1640a8ac8fSEnji Coopercdir=`pwd` 1740a8ac8fSEnji Coopercd ${n0} 1840a8ac8fSEnji Cooperexpect 0 create ${n1} 0644 1940a8ac8fSEnji Cooperexpect EACCES -u 65534 -g 65534 truncate ${n1} 123 2040a8ac8fSEnji Cooperexpect 0 chown ${n1} 65534 65534 2140a8ac8fSEnji Cooperexpect 0 chmod ${n1} 0444 2240a8ac8fSEnji Cooperexpect EACCES -u 65534 -g 65534 truncate ${n1} 123 2340a8ac8fSEnji Cooperexpect 0 unlink ${n1} 2440a8ac8fSEnji Coopercd ${cdir} 2540a8ac8fSEnji Cooperexpect 0 rmdir ${n0} 26