I checked. It fopen's the file and then fstat's it. So it isn't vulnerable to TOCTOU.
However the TOCTOU is completely benign here. It's just an extra check before Rust opens the file so if you were to try to "exploit" it the only thing that would happen is you get a different error message.
IshKebab|11 months ago
However the TOCTOU is completely benign here. It's just an extra check before Rust opens the file so if you were to try to "exploit" it the only thing that would happen is you get a different error message.
oguz-ismail|11 months ago
Can't reproduce this. If I do
on one terminal and on another, I can see the contents of /etc/passwd on the first one.