Re: Re: Current working directory and multi-threaded environments

From: Date: Thu, 16 Mar 2000 13:56:17 +0000
Subject: Re: Re: Current working directory and multi-threaded environments
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-16884@lists.php.net to get a copy of this message
On Thu, Mar 16, 2000 at 08:27:41AM -0500, rubys@us.ibm.com wrote: > > > >> You are free to disagree with me, and I may have missed something or I > >> could very much be wrong. It just seems to me that unless more is done > >> than what you propose, examples such as the following will change > behavior: > >> > >> > >> http://www.php.net/manual/html/function.readdir.html > >> > >> And that's an easy one. dl, ftp_get and others can be passed relative > >> paths. Fortunately, this list is finite. What would concern me most is > >> the extensions that interface to external code. > > > >Why does it change behaviour? > > > >The functions (not readdir, but opendir) will create an absolute path > >from the relative path passed to them. > > I must be missing something very obvious. Excerpts from > ext/standard/dir.c: > > PHP_FUNCTION(opendir): > _do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); > > static void _php_do_opendir: > dirp->dir = opendir((*arg)->value.str.val); > > >From what I can see, a relative path coded in the web page passes directly > through to a system call. That system call will be entirely unaware of > PHP's notion of a virtual (per request and/or thread) current directory, > and will proceed to use the "real" (per process) current directory. We are speaking about _future_ changes to the current source base, not about how it works today. - Sascha

« previous php.dev (#16884) next »