If chdir is a problem, why not using a heavy weight approach (better safe
than sorry particularly if gnulib is used for a lot of project):
- fork and exec an helper for name resolution
- pass fd using a socket

It is really heavy but it is on the safe side

Bastien

Le 23 déc. 2010 03:12, "Paul Eggert" <egg...@cs.ucla.edu> a écrit :

On 12/22/2010 03:32 PM, Bruno Haible wrote:
> For example, if save_cwd called
> currdir_fd = open ...
Hmm, well, no, the fchdir could also fail if the directory is
on a remote file system and the network is down.  Or
if there is an I/O error (errno == EIO).  Or if search
permission is absent from the directory, assuming the
usual case where the directory was opened with O_RDONLY.
There are probably other reasons.

One workaround would be to wrap every system call
that resolves file names, so that all of these system calls
fail if given a relative file name after the fchdir failed.
But that sounds pretty drastic.

Reply via email to