Niels M�ller wrote:

>If I understood the issue correctly, rm -r will do
>things like
>
>  chdir("foo");
>  delete stuff
>  chdir("..");
>  delete more stuff
>
>That's bad if directories are moved around between the two chdir
>calls. The right way to recurse is something like
>
>  old = open(".");
>  chdir("foo);
>  delete stuff
>  fchdir(old);
>  delete more stuff
>
Isn't this potentially racey as well?  I can see that fchdir(old); will 
definately take you back to the parent of "foo" but how can you be sure 
that the directories aren't moved around between step 1 and 2?  You 
could end up in a different "foo" to what you intended, I guess this is 
a different issue - but it is still an issue isn't it?

Regards,
Craig.



_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to