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

View File

@ -69,6 +69,10 @@ func parseDirents(dirPath string, buf []byte) (entries []string, err error) {
if name == "." || name == ".." {
continue
}
// Skip special files.
if hasReservedPrefix(name) || hasReservedSuffix(name) {
continue
}
switch dirent.Type {
case syscall.DT_DIR:

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)

View File

@ -123,9 +123,6 @@ func treeWalk(layer ObjectLayer, bucket, prefixDir, entryPrefixMatch, marker str
if !strings.HasPrefix(entry, entryPrefixMatch) {
entries[i] = ""
}
if hasReservedPrefix(entry) || hasReservedSuffix(entry) {
entries[i] = ""
}
}
}
// For XL multipart files strip the trailing "/" and append ".minio.multipart" to the entry so that