drftpd-ng / drftpd

Distributed Daemon FTP Server (aka DrFTPD)
GNU General Public License v2.0
54 stars 21 forks source link

Unify remerge handling of I/O errors #374

Closed 17ggy6tf5d closed 3 months ago

17ggy6tf5d commented 3 months ago

The non-concurrent (serialized) code path in RootCollection getLocalInodes throw a null pointer exception on directories without read permissions.

The concurrent code path compares the result of File.list() to null to check for errors. The non-concurrent (serialized) code path does not check the return value, instead it calls File.exists() on the returned object.

File.list() returns an empty array when the directory is empty, and null on errors. Use the same logic in the non-concurrent code path, so the behaviour of the two code paths are the same.