Cleanup keyutils types and api.rs#29
Merged
mathstuf merged 5 commits intomathstuf:masterfrom Jun 28, 2019
Merged
Conversation
Owner
|
Thanks for all the work this past week! Once this is rebased, I'll take a closer look at it now that the other PRs have been merged. |
Contributor
Author
Done, and let me know if you want to split this up. I've also revised the PR's description to be more accurate. |
mathstuf
reviewed
Jun 27, 2019
Owner
mathstuf
left a comment
There was a problem hiding this comment.
Just worried about kernel upgrades sliding in panics without changing the code when a new default keyring value is added. Looks great otherwise.
mathstuf
requested changes
Jun 28, 2019
mathstuf
approved these changes
Jun 28, 2019
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patchset makes many changes in preparation for fixing issue #24 (to no longer need
libkeyutils). Doing everything in one PR would be very large, so this PR is just all of the internal cleanup that doesn't change the external API ofkeyutils.Specifically:
libkeyutils-sysis moved tokeyutils-raw(and version is updated to matchkeyutils)KEY_TYPE_KEYRINGandKEY_TYPE_BIG_KEY(as they are in the kernel documentation).NonZeroI32.Option<NonZeroI32>, but this is FFI safe per Allow null-pointer-optimized enums in FFI if their underlying representation is FFI safe rust-lang/rust#60300keyutils's minimal version.keyutils-raw: changekey_serial_tto just beKeyringSerial, which is then just reexported bykeyutils.keyutils-raw: changekey_perm_tto just beKeyPermissions, which is then just reexported bykeyutils.KEY_REQKEY_DEFL_*constants. Instead,DefaultKeyringinkeyutils-rawjust has enum values with these constants (it is also just reexported tokeyutils).api.rsto use the new types. I also simplified the internal*_implandcheck_methods. This is the largest part of the PR, but is mostly just a find/replace.Again, note that we continue linking libkeyutils, and this only ends up with a very tiny change to the external API:
DefaultKeyring:serial()methodTryFrom<libc::c_long>instead ofFrom<i32>