Date: 03/16/00
- Next message: Bug Database: "[PHP-DEV] Bug #3840 Updated: 'Missing Post reply data' error under Netscape"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- In reply to: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Reply: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Mar 16, 2000 at 07:21:33PM +0200, Andi Gutmans wrote:
> On Thu, 16 Mar 2000, Sascha Schumann wrote:
>
> > 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?
>
> I prefer to use the PHP #define's. I don't think Windows has an strtok_r.
Hm, even win32/registry.c uses strtok_r. If Windows supports POSIX,
then it should have strtok_r.
http://www.opengroup.org/onlinepubs/007908799/xsh/strtok.html
> > 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.
>
> Don't know this issue. Can you please expand on it? Does chdir() in
> Win16/32 do something special? Should we emulate that something special?
AFAIC "\.{2,}" is treated like "..". Perhaps some Windows guru can
verify (or falsify) that.
Additionally, "\foo\bar" is not an absolute path name on Windows.
It's still relative to the current drive.
> > g) what about other O/S?
>
> Like what? This covers UNIX and Windows. Does PHP support other machines?
There is an OS/2 port. I'm currently abstracting your code a little bit
and will post an improved version in some minutes.
- Sascha
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] Bug #3840 Updated: 'Missing Post reply data' error under Netscape"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- In reply to: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Reply: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

