mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: check for xl.meta as directory fallback (#13023)
Objects uploaded in this format for example ``` mc cp /etc/hosts alias/bucket/foo/bar/xl.meta mc ls -r alias/bucket/foo/bar ``` Won't list the object, handle this scenario.
This commit is contained in:
@@ -34,6 +34,7 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
@@ -405,6 +406,13 @@ func (s *xlStorage) readMetadata(itemPath string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if stat.IsDir() {
|
||||
return nil, &os.PathError{
|
||||
Op: "open",
|
||||
Path: itemPath,
|
||||
Err: syscall.EISDIR,
|
||||
}
|
||||
}
|
||||
return readXLMetaNoData(f, stat.Size())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user