[PATCH] [BZ #18433] Check file access/existence before forking.
navid Rahimi
rahimi.nv@gmail.com
Thu Sep 10 21:38:00 GMT 2015
On Thu, Sep 10, 2015 at 7:32 PM, Zack Weinberg <zackw@panix.com> wrote:
> Why is a TOCTOU race acceptable and/or unavoidable? Also, why is a check using the real rather than the effective credentials correct here?
Because of nature of lock in unix (being advisory) I think there is no
way to lock file and prevent TOCTOU, even if we had lock mechanism ,
it is cumbersome (and almost impossible) to design in correctly.
Because for preventing TOCTOU we should keep lock until execve , and
after that point so many question will raise , "what will happen to
lock in execve ?" or "does child process has lock also ?"
About using real rather effective credentials , it was my mistake ,
euidaccess would be more appropriate .
More information about the Libc-alpha
mailing list