2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/chmod/05.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="chmod returns EACCES when search permission is denied for a component of the path prefix"
10 if supported lchmod; then
20 expect 0 mkdir ${n0} 0755
23 expect 0 mkdir ${n1} 0755
24 expect 0 chown ${n1} 65534 65534
25 expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644
26 expect 0 -u 65534 -g 65534 chmod ${n1}/${n2} 0642
27 expect 0642 -u 65534 -g 65534 stat ${n1}/${n2} mode
28 expect 0 chmod ${n1} 0644
29 expect EACCES -u 65534 -g 65534 chmod ${n1}/${n2} 0620
30 expect 0 chmod ${n1} 0755
31 expect 0 -u 65534 -g 65534 chmod ${n1}/${n2} 0420
32 expect 0420 -u 65534 -g 65534 stat ${n1}/${n2} mode
33 if supported lchmod; then
34 expect 0 chmod ${n1} 0644
35 expect EACCES -u 65534 -g 65534 lchmod ${n1}/${n2} 0410
36 expect 0 chmod ${n1} 0755
37 expect 0 -u 65534 -g 65534 lchmod ${n1}/${n2} 0710
38 expect 0710 -u 65534 -g 65534 stat ${n1}/${n2} mode
40 expect 0 -u 65534 -g 65534 unlink ${n1}/${n2}