Subject: Re: PR/36464 CVS commit: src/lib/libc/gen
To: None <gnats-bugs@NetBSD.org>
From: Ed Ravin <eravin@panix.com>
List: netbsd-bugs
Date: 06/09/2007 21:00:20
Christos - thanks for the quick fix, I will test it out later this
week.

The man page for stat(2) also needs updating, in particular this part:

>     The size-related fields of the struct stat are as follows:
>
>     st_size        The size of the file in bytes.  A directory will be a mul-
>                    tiple of the size of the dirent(5) structure.

Should be changed to say that the meaning of st_size for a directory is
filesystem-dependent (the ZFS behavior of "number of entries in the
directory" is intentional).


On Sun, Jun 10, 2007 at 12:00:06AM +0000, Christos Zoulas wrote:
...
> 
>  Modified Files:
>  	src/lib/libc/gen: scandir.c
>  
>  Log Message:
>  PR/36464: scandir(3) corrupts heap when run on ZFS directories because ZFS
>  returns the number of entries as the directory size.
>  Use a new, more conservative entries estimator.