-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std.os: make access respect EPERM; make AccessError consistent #19193
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
Conversation
access and accessat family of functions: - recognize EPERM as AccessError.PermissionDenied - recognize EACCES as AccessError.AccessDenied, which is consistent with other functions in std.os
|
In the second commit I also found similar inconsistencies in handling ACCESS_DENIED in |
|
Related: #16782 |
|
I'm sorry, I didn't review this in time, and now it has bitrotted. Furthermore, so many pull requests have stacked up that I can't keep up and I am therefore declaring Pull Request Bankruptcy and closing old PRs that now have conflicts with master branch. If you want to reroll, you are by all means welcome to revisit this changeset with respect to the current state of master branch, and there's a decent chance your patch will be reviewed the second time around. Either way, I'm closing this now, otherwise the PR queue will continue to grow indefinitely. |
…ionDenied AccessDenied is returned if the file mode bit (user/group/other rwx bits) disallow access. PermissionDenied is returned if something else denies access (immutable bit, SELinux, capabilities, etc). This somewhat subtle distinction is a POSIX thing. This PR is effecitvely an update of PR ziglang#19193. See ziglang#16782 for the deeper problems with the AccessDenied/PermissionDenied duopoly. Tested locally with an immutable file. Fixes ziglang#22733 and ziglang#19162.
… PermissionDenied `EACCES` is returned if the file mode bit (i.e., user/group/other rwx bits) disallow access (mapped to `error.AccessDenied`). `EPERM` is returned if something else denies access (immutable bit, SELinux, capabilities, etc) and is mapped to `error.PermissionDenied`. This somewhat subtle no-access distinction is part of POSIX. This PR is effecitvely an update/simplification of PR ziglang#19193. See ziglang#16782 for the deeper problems with the AccessDenied/PermissionDenied duopoly. Tested locally with an immutable file. Fixes ziglang#22733 and ziglang#19162.
… PermissionDenied `EACCES` is returned if the file mode bit (i.e., user/group/other rwx bits) disallow access. `EPERM` is returned if something else denies access (immutable bit, SELinux, capabilities, etc). This somewhat subtle no-access distinction is part of POSIX. For now map both to `error.PermissionDenied` to keep the error signature unchanged. See duopoly. This PR is effecitvely an update/simplification of PR ziglang#19193. Tested locally with an immutable file. Fixes ziglang#22733 and ziglang#19162.
… PermissionDenied `EACCES` is returned if the file mode bit (i.e., user/group/other rwx bits) disallow access. `EPERM` is returned if something else denies access (immutable bit, SELinux, capabilities, etc). This somewhat subtle no-access distinction is part of POSIX. For now map both to `error.PermissionDenied` to keep the error signature unchanged. See duopoly. This PR is effecitvely an update/simplification of PR #19193. Tested locally with an immutable file. Fixes #22733 and #19162.
… PermissionDenied `EACCES` is returned if the file mode bit (i.e., user/group/other rwx bits) disallow access. `EPERM` is returned if something else denies access (immutable bit, SELinux, capabilities, etc). This somewhat subtle no-access distinction is part of POSIX. For now map both to `error.PermissionDenied` to keep the error signature unchanged. See duopoly. This PR is effecitvely an update/simplification of PR ziglang#19193. Tested locally with an immutable file. Fixes ziglang#22733 and ziglang#19162.
Resolves #19162
access and accessat family of functions: