Skip to content

Commit 126f80f

Browse files
committed
Throw a better error message if attempting to access a directory without permission.
1 parent ccd7f65 commit 126f80f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ public FileStatus[] listStatus(Path f) throws IOException {
281281
return new FileStatus[] {
282282
new GlusterFileStatus(localf, getDefaultBlockSize(), this) };
283283
}
284+
285+
if(localf.isDirectory() && !localf.canRead()){
286+
throw new IOException("Access denied.");
287+
}
284288

285289
File[] names = localf.listFiles();
286290
if (names == null) {

0 commit comments

Comments
 (0)