mirror of
https://github.com/minio/minio.git
synced 2024-12-27 15:45:55 -05:00
Merge pull request #628 from harshavardhana/pr_out_skip_files_and_weird_directories_from_listbuckets_allowing_this_so_that_minio_fs_mode_can_be_used_as_ftp_service
Skip files and weird directories from listBuckets(), allowing this so that minio fs mode can be used as ftp service
This commit is contained in:
commit
bf36fcb6f7
@ -40,11 +40,19 @@ func (fs *fsDriver) ListBuckets() ([]drivers.BucketMetadata, error) {
|
|||||||
var metadataList []drivers.BucketMetadata
|
var metadataList []drivers.BucketMetadata
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if !file.IsDir() {
|
if !file.IsDir() {
|
||||||
return []drivers.BucketMetadata{}, iodine.New(drivers.BackendCorrupted{Path: fs.root}, nil)
|
// if files found ignore them
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
if file.IsDir() {
|
||||||
|
// if directories found with odd names, skip them too
|
||||||
|
if !drivers.IsValidBucket(file.Name()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
metadata := drivers.BucketMetadata{
|
metadata := drivers.BucketMetadata{
|
||||||
Name: file.Name(),
|
Name: file.Name(),
|
||||||
Created: file.ModTime(), // TODO - provide real created time
|
Created: file.ModTime(),
|
||||||
}
|
}
|
||||||
metadataList = append(metadataList, metadata)
|
metadataList = append(metadataList, metadata)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user