140a8ac8fSEnji Cooper#!/bin/sh 2*3416500aSEnji Cooper# vim: filetype=sh noexpandtab ts=8 sw=8 340a8ac8fSEnji Cooper# $FreeBSD: head/tools/regression/pjdfstest/tests/chflags/05.t 211352 2010-08-15 21:24:17Z pjd $ 440a8ac8fSEnji Cooper 540a8ac8fSEnji Cooperdesc="chflags returns EACCES when search permission is denied for a component of the path prefix" 640a8ac8fSEnji Cooper 740a8ac8fSEnji Cooperdir=`dirname $0` 840a8ac8fSEnji Cooper. ${dir}/../misc.sh 940a8ac8fSEnji Cooper 1040a8ac8fSEnji Cooperrequire chflags 1140a8ac8fSEnji Cooper 1240a8ac8fSEnji Cooperecho "1..16" 1340a8ac8fSEnji Cooper 1440a8ac8fSEnji Coopern0=`namegen` 1540a8ac8fSEnji Coopern1=`namegen` 1640a8ac8fSEnji Coopern2=`namegen` 1740a8ac8fSEnji Cooper 1840a8ac8fSEnji Cooperexpect 0 mkdir ${n0} 0755 1940a8ac8fSEnji Coopercdir=`pwd` 2040a8ac8fSEnji Coopercd ${n0} 2140a8ac8fSEnji Cooperexpect 0 mkdir ${n1} 0755 2240a8ac8fSEnji Cooperexpect 0 chown ${n1} 65534 65534 2340a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 2440a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 chflags ${n1}/${n2} UF_NODUMP 2540a8ac8fSEnji Cooperexpect UF_NODUMP -u 65534 -g 65534 stat ${n1}/${n2} flags 2640a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 chflags ${n1}/${n2} none 2740a8ac8fSEnji Cooperexpect 0 chmod ${n1} 0644 2840a8ac8fSEnji Cooperexpect EACCES -u 65534 -g 65534 chflags ${n1}/${n2} UF_NODUMP 2940a8ac8fSEnji Cooperexpect 0 chmod ${n1} 0755 3040a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 chflags ${n1}/${n2} UF_NODUMP 3140a8ac8fSEnji Cooperexpect UF_NODUMP -u 65534 -g 65534 stat ${n1}/${n2} flags 3240a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 chflags ${n1}/${n2} none 3340a8ac8fSEnji Cooperexpect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 3440a8ac8fSEnji Cooperexpect 0 rmdir ${n1} 3540a8ac8fSEnji Coopercd ${cdir} 3640a8ac8fSEnji Cooperexpect 0 rmdir ${n0} 37