-
Notifications
You must be signed in to change notification settings - Fork 92
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
way to prevent openDirStream from following symlinks #134
Labels
Comments
Seems there already is a PR: #110 |
Sorry, posted on the wrong thread. Moved to: haskell/directory#97 (comment) |
With #110 merged, can we close this? |
Are there plans to release #110 any time soon? |
Yes, we are likely to make a release soon (but not immediately). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
haskell/directory#97 needs a way to list the content of a directory that avoids following a symlink. The unix way to do that is
open
withO_NOFOLLOW
and then passing the fd tofdopendir
. This library does not provide a way to do that; could it?One way would be to add
But that is fairly low-level. The user needs to take care to avoid reusing the Fd after calling it. Also, while some of the OpenFileFlags may make sense for opening a directory, most of them probably don't. And the user would need to take care to set
O_CLOEXEC
to avoid a possible fd leak.This interface would avoid those problems (pass
O_CLOEXEC
always):Assuming this is exported from the same module as OpenFileFlags, the fields in OpenDirFlags need to be qualified to avoid name conflicts. Or OpenFileFlags could be used for openDirStream', but a number of those flags don't make sense for opening a directory.
Also openDirStream could be changed to take such an OpenDirFlags, if an API bump appeals.
I'd be happy to implement whichever of these you prefer.
The text was updated successfully, but these errors were encountered: