Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
adrianratnapala
on July 22, 2016
|
parent
|
context
|
favorite
| on:
Spawn your shell like it's the 90s again
Can you not do an ordinary open without O_NOFOLLOW and then lstat the filename?
cyphar
on July 22, 2016
[–]
Race condition again. The file could be unlinked. fstat is the only safe way of getting stat information for an open file.
loeg
on July 23, 2016
|
parent
[–]
Right. The right thing to do is open() with NOFOLLOW, then fstat the resulting fd. Then check for S_ISLNK(st_mode).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: