mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
posix: reserved files should be filtered out at posix not object layer. (#1554)
This commit is contained in:
parent
722abe2d0f
commit
9d41414fb5
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user