BugTraq
readdir_r considered harmful Nov 01 2005 03:57AM
Ben Hutchings (ben decadentplace org uk) (2 replies)
Re: readdir_r considered harmful Nov 05 2005 06:45PM
Casper Dik Sun COM (1 replies)

>The Austin Group should amend POSIX and the SUS in one or more of the
>following ways:
>
>1. Standardise the dirfd function from BSD and recommend its use in
> determining the buffer size for readdir_r.
>2. Specify a new variant of readdir in which the buffer size is explicit
> and the function returns an error code if the buffer is too small.
>3. Specify that NAME_MAX must be defined as the length of the longest
> name that can be used on any filesystem. (This seems to be what many
> or most implementations attempt to do at present, although POSIX
> currently specifies otherwise.)

Why not:

4. Require the readdir() implementation to use state local to dirp.

I've never understood the rationale behind readdir_r; it's like someone
went through the manual looking for "pointers to static locations"
and defined new functions with _r for each of them, suspending thinking.

But perhaps people can look at how their readdir() implementations
behave. The Solaris implementation appears to be "unshared dirp safe".

Casper

[ reply ]
Re: [Full-disclosure] Re: readdir_r considered harmful Nov 06 2005 01:53AM
Ulrich Drepper (drepper gmail com) (1 replies)
Re: [Full-disclosure] Re: readdir_r considered harmful Nov 06 2005 09:00AM
Casper Dik Sun COM (1 replies)
Re: [Full-disclosure] Re: readdir_r considered harmful Nov 06 2005 03:34PM
Ulrich Drepper (drepper gmail com) (1 replies)
Re: [Full-disclosure] Re: readdir_r considered harmful Nov 06 2005 07:19PM
Casper Dik Sun COM (1 replies)
Re: [Full-disclosure] Re: readdir_r considered harmful Nov 08 2005 01:47AM
Andrew Miller (andrew amxl com)
Re: readdir_r considered harmful Nov 01 2005 08:16PM
Ben Hutchings (ben decadentplace org uk)


 

Privacy Statement
Copyright 2010, SecurityFocus