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

rights.4: various corrections on capability rights #1207

Closed
wants to merge 1 commit into from

Conversation

CismonX
Copy link
Contributor

@CismonX CismonX commented Apr 27, 2024

  • A file descriptor obtained from accept(2), accept4(2) and openat(2) is not always assigned all capability rights. Instead, it inherits capability rights from the "parent" socket/dir file descriptor.
  • getdents(2) and getdirentries(2) requires CAP_READ.
  • openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK. See 943c3bb.

- A file descriptor obtained from accept(2), accept4(2) and openat(2)
  is not always assigned all capability rights.  Instead, it inherits
  capability rights from the "parent" socket/dir file descriptor.
- getdents(2) and getdirentries(2) requires CAP_READ.
- openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK.
@bsdimp
Copy link
Member

bsdimp commented Apr 29, 2024

Quick checks of the kernel match the manual, as well as common sense...
Landing this Thanks!

@bsdimp bsdimp closed this Apr 29, 2024
@bsdimp bsdimp added the merged label Apr 29, 2024
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
- A file descriptor obtained from accept(2), accept4(2) and openat(2)
  is not always assigned all capability rights.  Instead, it inherits
  capability rights from the "parent" socket/dir file descriptor.
- getdents(2) and getdirentries(2) requires CAP_READ.
- openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK.

Reviewed by: imp
Pull Request: #1207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants