3 ms·
Race condition again. The file could be unlinked. fstat is the only safe way of getting stat information for an open file.
by cyphar 10y ago
Race condition again. The file could be unlinked. fstat is the only safe way of getting stat information for an open file.
- loeg 10y agoRight. The right thing to do is open() with NOFOLLOW, then fstat the resulting fd. Then check for S_ISLNK(st_mode).