fs: Add proper volume and path validation.

This commit is contained in:
Harshavardhana
2016-04-13 11:32:47 -07:00
parent caa35f68fa
commit 8457af5708
8 changed files with 235 additions and 138 deletions
+6 -1
View File
@@ -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
}