mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
web: Validate if bucket names are reserved (#3841)
Both '.minio.sys' and 'minio' should be never allowed to be created from web-ui and then fail to list it by filtering them out. Fixes #3840
This commit is contained in:
@@ -194,7 +194,17 @@ func isReservedOrInvalidBucket(bucketEntry string) bool {
|
||||
if !IsValidBucketName(bucketEntry) {
|
||||
return true
|
||||
}
|
||||
return bucketEntry == minioMetaBucket || bucketEntry == minioReservedBucket
|
||||
return isMinioMetaBucket(bucketEntry) || isMinioReservedBucket(bucketEntry)
|
||||
}
|
||||
|
||||
// Returns true if input bucket is a reserved minio meta bucket '.minio.sys'.
|
||||
func isMinioMetaBucket(bucketName string) bool {
|
||||
return bucketName == minioMetaBucket
|
||||
}
|
||||
|
||||
// Returns true if input bucket is a reserved minio bucket 'minio'.
|
||||
func isMinioReservedBucket(bucketName string) bool {
|
||||
return bucketName == minioReservedBucket
|
||||
}
|
||||
|
||||
// byBucketName is a collection satisfying sort.Interface.
|
||||
|
||||
Reference in New Issue
Block a user