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:
Harshavardhana
2017-03-03 03:01:42 -08:00
committed by GitHub
parent cddc684559
commit e5d4e7aa9d
5 changed files with 43 additions and 8 deletions

View File

@@ -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.