1
0
mirror of https://github.com/golang/go synced 2024-11-25 04:27:56 -07:00

Change Stat to Lstat in Readdir so we don't recur when someone symlinks "."

R=rsc
CC=go-dev
http://go/go-review/1018003
This commit is contained in:
Rob Pike 2009-10-29 10:53:37 -07:00
parent b89d630977
commit 449086eec9

View File

@ -315,7 +315,7 @@ func (file *File) Readdir(count int) (dirs []Dir, err Error) {
}
dirs = make([]Dir, len(names));
for i, filename := range names {
dirp, err := Stat(dirname+filename);
dirp, err := Lstat(dirname+filename);
if dirp == nil || err != nil {
dirs[i].Name = filename; // rest is already zeroed out
} else {