On Friday, August 8, 2003, at 01:08 am, Stas Bekman wrote:
I need to revive any safecwd code and make it work, there are essentially two options.
option a)
store the cwd per thread
munge parameters to correct all relative parts into absolute parts based on the cwd
(in open, system, -x, and soo on)
option b)
store the cwd per thread
reset the global cwd before any operation that needs it, this will change the cwd constantly for different threads
What is your take on these options?
Before I make my pick, what happens if the running code involves some C code
that operates/relies on cwd?
It will break :(, I don't think there is a way to globally override the C level cwd.
How is apache doing this, could there be some overriding in the APR that deals with this?
I don't think Apache has to deal with that, since its mod_cgi spawns processes. However I'm not sure about windows implementation, does windows have the same problem, or does it have a cwd entry per thread?
Perhaps Bill can tell us whether mod_cgi on windows does something special to handle apps that chdir() (in case that windows is similar to unix and has only one cwd per all threads, which I doubt).
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
