-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add SECBIT_ constants from securebits.h #4480
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
I don't believe that the FreeBSD failures are due to the changes in this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values look good to me, but in the interest of matching the source code would you mind adding a const fn issecure_mask
to do the shifts? Something like
const SECURE_NOROOT: c_int = 0;
pub const SECBIT_NOROOT: c_int = issecure_mask(SECURE_NOROOT);
// ...
const fn issecure_mask(x: c_int) -> c_int {
1 << x
}
Sure thing. Consistency with source is always great for debugging and verification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, didn't see the change. Thanks!
See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/securebits.h (backport <rust-lang#4480>) (cherry picked from commit f811577)
See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/securebits.h (backport <#4480>) (cherry picked from commit f811577)
Description
This PR adds the
SECBIT_
constants for use with thePR_GET_SECUREBITS
andPR_SET_SECUREBITS
prctl
operations.Sources
linux/securebits.h
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated