Mail Archives: djgpp-workers/2001/09/24/02:20:27
At this point I don't see any way to make deep directory chdir()s work on
NT+LFN, Win 2000 (normal or LFN). This means no sophisticated builds which
insist on chdir()ing deep. Better would be to fix apps to avoid chdir()ing.
The only thing I can suggest is the following:
1) Change chdir() to check for bad directories. Prevent setting directory
if not OK (just in case failure ignored), return error code.
2) chdir() currently calls fixpath. If the return from fixpath is not the
root directory then getcwd() shouldn't be either.
3) call getcwd before starting, save it. do chdir. call getcwd again.
if getcwd is root directory and fixpath result wasn't, chdir to original,
set error flag, return.
This would be two extra system calls. Given the observation this can fail
with lfn=n on other Win systems I think all systems should have it. If we
trust everyone to check return codes, we could avoid the first getcwd and
only set the failure code if getcwd is root and shouldn't be.
Given that rm -rf / is about the worse thing you can do to a system, I don't
think we should fool around on this one. Let's do it for all platforms.
- Raw text -