Christian Schneider wrote:
> Arnaud Le Blanc wrote:
>> The following may (no MacOS X to test) fix the problem by returning 0 from 
>> zend_stream_fsize() when the file descriptor is not a regular file:
>> http://arnaud.lb.s3.amazonaws.com/45928.patch
> 
> Your patch:
> +#ifdef S_ISREG
> +             if (!S_ISREG(buf.st_mode)) {
> +                     return 0;
> +             }
> +#endif
> might prevent mmap-ing symbolically linked files, I'll do a quick test
> when I'm at home.
> Not sure if we should also check for symbolic links (and what they point
> to) or if that's overkill because the performance penalty is small
> enough anyway.
> 
> Anyone from the core developers got an opinion here?
> 
> - Chris
> 

Check for symbolic links, it could potentially come up if you have a
common file.

The fsize code was written and tested on a Mac but I admit I was testing
with interactive mode and whole files. I can test this later on tonight
if I get time and if its good I'll commit it.

Scott

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to