fs: Filter out valid paths and volnames. (#1321)

This commit is contained in:
Harshavardhana committed 2016-04-16 19:33:29 -07:00
1 parent b2ec7da9f9
commit 33633fd15d
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -143,7 +143,7 @@ func removeDuplicateVols(vols []VolInfo) []VolInfo {
func getAllUniqueVols(dirPath string) ([]VolInfo, error) {
volumeFn := func(dirent fsDirent) bool {
// Return all directories.
return dirent.IsDir()
return dirent.IsDir() && isValidVolname(dirent.name)
}
namesOnly := false // Returned dirent names are absolute.
dirents, err := scandir(dirPath, volumeFn, namesOnly)