posix: reserved files should be filtered out at posix not object layer. (#1554)

This commit is contained in:
Harshavardhana
2016-05-09 02:53:08 -07:00
parent 722abe2d0f
commit 9d41414fb5
3 changed files with 8 additions and 3 deletions
+4
View File
@@ -56,6 +56,10 @@ func readDir(dirPath string) (entries []string, err error) {
return nil, err
}
for _, fi := range fis {
// Skip special files.
if hasReservedPrefix(fi.Name()) || hasReservedSuffix(fi.Name()) {
continue
}
if fi.Mode().IsDir() {
// append "/" instead of "\" so that sorting is done as expected.
entries = append(entries, fi.Name()+slashSeparator)