Core uses php's file_exists which does a case sensitive determination for if a file already exists and a new file thus needs a numerical suffix when adding a new file.
But filefield_file_download when querying the files table does a case insensitive query. (Same issue in upload's upload_file_download). As a result, I've got two files with case variation only in their filepath. I'm using content_permissions and private files (lol) to determine access to the files, but I get the wrong access for a file due to having another file with a different case and same path otherwise.
Patch is working for me. This may be an issue in HEAD as well, what do you think?