Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Full Disclosure: Re: readdir_r considered harmful

Re: readdir_r considered harmful

From: <Casper.Dik_at_Sun.COM>
Date: Sat, 05 Nov 2005 19:45:20 +0100

>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
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
Received on Nov 05 2005

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]