Skip to content

Commit fa74690

Browse files
author
szaka
committed
new test: EACCES for opening a dir read-only with no read access
new test: EACCES for reading a dir with no execute access (Jean-Pierre Andre)
1 parent 398ef40 commit fa74690

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/open/06.t

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ desc="open returns EACCES when the required permissions (for reading and/or writ
66
dir=`dirname $0`
77
. ${dir}/../misc.sh
88

9-
echo "1..65"
9+
echo "1..72"
1010

1111
n0=`namegen`
1212
n1=`namegen`
@@ -82,7 +82,20 @@ expect 0 -u 65534 -g 65534 chmod ${n1} 0770
8282
expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY
8383
expect EACCES -u 65533 -g 65533 open ${n1} O_WRONLY
8484
expect EACCES -u 65533 -g 65533 open ${n1} O_RDWR
85+
#
86+
# EACCES for opening a directory read-only with no read access
87+
# EACCES for reading a directory with no execute access
88+
#
89+
cd ..
90+
expect 0 -u 65534 -g 65534 open ${n0} O_RDONLY
91+
expect 0 -u 65534 -g 65534 chmod ${n0} 0355
92+
expect EACCES -u 65534 -g 65534 open ${n0} O_RDONLY
93+
expect 0770 -u 65534 -g 65534 stat ${n0}/${n1} mode
94+
expect 0 -u 65534 -g 65534 chmod ${n0} 0655
95+
expect EACCES -u 65534 -g 65534 stat ${n0}/${n1} mode
8596

97+
expect 0 -u 65534 -g 65534 chmod ${n0} 0755
98+
cd ${n0}
8699
expect 0 -u 65534 -g 65534 unlink ${n1}
87100

88101
cd ${cdir}

0 commit comments

Comments
 (0)