Follow links safely during directory discovery
This commit is contained in:
@@ -30,21 +30,3 @@ func visitBoundedImportDirectory(access *filesystemAccess, directory string, lim
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func importDirectoryEntryIsDirectory(entry fs.DirEntry) (bool, error) {
|
||||
mode := entry.Type()
|
||||
if mode&fs.ModeSymlink != 0 {
|
||||
return false, nil
|
||||
}
|
||||
if mode.IsDir() {
|
||||
return true, nil
|
||||
}
|
||||
if mode != 0 {
|
||||
return false, nil
|
||||
}
|
||||
info, err := entry.Info()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return info.IsDir(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user