Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use F_KINFO on FreeBSD 13.1 #331

Open
asomers opened this issue Sep 18, 2023 · 0 comments
Open

Use F_KINFO on FreeBSD 13.1 #331

asomers opened this issue Sep 18, 2023 · 0 comments

Comments

@asomers
Copy link
Contributor

asomers commented Sep 18, 2023

FreeBSD 13.1 introduced an F_KINFO fcntl command, which looks up a file descriptor's path. It's exactly what cap-primitives/rustix/fs/file_path needs. It's much more efficient than file_path_by_searching, and isn't vulnerable to the #330 bug. However, it can fail in certain circumstances, so file_path_by_searching should still be used as a fallback.

https://man.freebsd.org/cgi/man.cgi?query=fcntl&sektion=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant