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

Make it not an error to open a directory without O_DIRECTORY or O_STAT #32

Merged
merged 3 commits into from Aug 12, 2017
Merged

Make it not an error to open a directory without O_DIRECTORY or O_STAT #32

merged 3 commits into from Aug 12, 2017

Conversation

@ids1024
Copy link
Member

@ids1024 ids1024 commented Aug 12, 2017

POSIX says this should work, and some software seems to rely on that.

POSIX says this should work, and some software seems to rely on that.
@jackpot51
Copy link
Member

@jackpot51 jackpot51 commented Aug 12, 2017

Weird. How do you keep programs from opening directories as files?

@ids1024
Copy link
Member Author

@ids1024 ids1024 commented Aug 12, 2017

Opening a directory with O_RDONLY or O_WRONLY is supposed to be an error, so that should handle it (although I made it successfully open with O_DIRECTORY | O_RDONLY, since we're using that).

@ids1024
Copy link
Member Author

@ids1024 ids1024 commented Aug 12, 2017

[EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR, or includes O_CREAT without O_DIRECTORY.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

ids1024 added 2 commits Aug 12, 2017
@jackpot51 jackpot51 merged commit fc0af50 into redox-os:master Aug 12, 2017
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@ids1024 ids1024 deleted the ids1024:directoryperm branch Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants