safe_rename() and verifying the result of link(2)

Vincent Lefevre vincent at vinc17.org
Tue Aug 21 23:02:29 UTC 2018


On 2018-08-21 07:07:15 -0700, Kevin J. McCarthy wrote:
> I don't like removing 20-year old safety checks, but I think it's okay
> to do so for the case where link() returns 0.

I was also hesitant, but after thinking more about it:

* That's an unusual "safety check" (I doubt other software does
  the same kind of check after link() with return value 0).

* It is not clear whether this has ever been usuful (nothing in
  comment or in the commit log).

* It might even have been a mistake. I suspect that the goal was
  for NFS, but then the test should have been for non-zero return
  values instead of zero.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Mutt-dev mailing list