mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
fs: Do not return reservedBucket names in ListBuckets() (#3754)
Make sure to skip reserved bucket names in `ListBuckets()` current code didn't skip this properly and also generalize this behavior for both XL and FS.
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"net"
|
||||
"net/url"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -59,7 +58,7 @@ func isRemoteDisk(disk StorageAPI) bool {
|
||||
// if size == 0 and object ends with slashSeparator then
|
||||
// returns true.
|
||||
func isObjectDir(object string, size int64) bool {
|
||||
return strings.HasSuffix(object, slashSeparator) && size == 0
|
||||
return hasSuffix(object, slashSeparator) && size == 0
|
||||
}
|
||||
|
||||
// Converts just bucket, object metadata into ObjectInfo datatype.
|
||||
@@ -284,7 +283,7 @@ func cleanupDir(storage StorageAPI, volume, dirPath string) error {
|
||||
var delFunc func(string) error
|
||||
// Function to delete entries recursively.
|
||||
delFunc = func(entryPath string) error {
|
||||
if !strings.HasSuffix(entryPath, slashSeparator) {
|
||||
if !hasSuffix(entryPath, slashSeparator) {
|
||||
// Delete the file entry.
|
||||
return traceError(storage.DeleteFile(volume, entryPath))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user