Re: Re: Current working directory and multi-threaded environments
| From: | Sascha Schumann | Date: | Thu, 16 Mar 2000 17:11:17 +0000 |
| Subject: | Re: Re: Current working directory and multi-threaded environments | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16894@lists.php.net to get a copy of this message | ||
On Thu, Mar 16, 2000 at 06:57:22PM +0200, Andi Gutmans wrote:
> Guys,
>
> I just commited a file php_virtual_chdir.c to our CVS. It has a main() in
> it so you can compile it and run it.
> I want to base the new virtual current working directory on this code,
> which seems to work pretty well and normalizes the names of the
> directories. Look at the main and see that it deals very nicely with all
> sorts of scenarios.
> There are two main issues with this code:
> a) It doesn't *really* check if the directory exists.
> b) strtok() isn't thread-safe in all machine's. I think we have the
> necessary #define's to strtok_r for most platforms though. In any case, we
> can either use something small we write ourselves.
Why not use strtok_r directly?
> c) Doesn't expand ~ yet.
> d) No error handling yet.
> e) no virtual_expand_filepath() yet, which is exactly the same as
> the existing virtual_chdir. I think the real virtual_chdir() will probably
> wrap this function and maybe do some other checks which chdir() requires.
f) does not handle COMMAND.COM special cases (i.e. "..."). This has been
a nasty security problem for many programs handling paths on Win16/32,
so we should try to cover this.
g) what about other O/S?
- Sascha