mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
fs: Add proper volume and path validation.
This commit is contained in:
+6
-1
@@ -80,10 +80,15 @@ func (o objectAPI) ListBuckets() ([]BucketInfo, *probe.Error) {
|
||||
return nil, probe.NewError(e)
|
||||
}
|
||||
for _, vol := range vols {
|
||||
// StorageAPI can send volume names which are incompatible
|
||||
// with buckets, handle it and skip them.
|
||||
if !IsValidBucketName(vol.Name) {
|
||||
continue
|
||||
}
|
||||
bucketInfos = append(bucketInfos, BucketInfo{vol.Name, vol.Created})
|
||||
bucketInfos = append(bucketInfos, BucketInfo{
|
||||
Name: vol.Name,
|
||||
Created: vol.Created,
|
||||
})
|
||||
}
|
||||
return bucketInfos, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user