Make test for write access to the directory being moved a little more

specific.

Approved by:	rwatson (mentor)
This commit is contained in:
trasz 2008-11-07 14:46:46 +00:00
parent 0b784b3317
commit 906b63fd78

View File

@ -6,7 +6,7 @@ desc="write access to subdirectory is required to move it to another directory"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..12"
echo "1..13"
n0=`namegen`
n1=`namegen`
@ -17,13 +17,17 @@ expect 0 mkdir ${n2} 0777
expect 0 mkdir ${n3} 0777
cdir=`pwd`
# Check that write permission on containing directory (${n2}) is enough
# to rename subdirectory (${n0}).
expect 0 mkdir ${n2}/${n0} 0700
expect 0 -u 65534 -g 65534 rename ${n2}/${n0} ${n2}/${n1}
# Check that write permission on containing directory (${n2}) is not enough
# to move subdirectory (${n0}) from that directory.
expect 0 mkdir ${n2}/${n0} 0700
expect EACCES -u 65534 -g 65534 rename ${n2}/${n0} ${n3}/${n0}
expect EACCES -u 65534 -g 65534 rename ${n2}/${n1} ${n3}/${n0}
expect 0 rmdir ${n2}/${n0}
expect ENOENT rmdir ${n2}/${n0}
expect 0 rmdir ${n2}/${n1}
expect ENOENT rmdir ${n2}/${n1}
# Check that write permission on containing directory (${n2}) is enough
# to move file (${n0}) from that directory.