Closed josephlr closed 5 years ago
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.
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.
Done, and let me know if you want to split this up. I've also revised the PR's description to be more accurate.
Thanks!
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-sys
is moved tokeyutils-raw
(and version is updated to matchkeyutils
)KEY_TYPE_KEYRING
andKEY_TYPE_BIG_KEY
(as they are in the kernel documentation).NonZeroI32
.Option<NonZeroI32>
, but this is FFI safe per https://github.com/rust-lang/rust/pull/60300keyutils
's minimal version.keyutils-raw
: changekey_serial_t
to just beKeyringSerial
, which is then just reexported bykeyutils
.keyutils-raw
: changekey_perm_t
to just beKeyPermissions
, which is then just reexported bykeyutils
.KEY_REQKEY_DEFL_*
constants. Instead,DefaultKeyring
inkeyutils-raw
just has enum values with these constants (it is also just reexported tokeyutils
).api.rs
to use the new types. I also simplified the internal*_impl
andcheck_
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>