Messages in this thread | | | Date | Wed, 24 Jan 2024 09:51:11 +0000 | From | Benno Lossin <> | Subject | Re: [PATCH v3 2/9] rust: cred: add Rust abstraction for `struct cred` |
| |
On 19.01.24 10:52, Alice Ryhl wrote: > On Fri, Jan 19, 2024 at 10:37 AM Benno Lossin <benno.lossin@proton.me> wrote: >> On 1/18/24 15:36, Alice Ryhl wrote: >>> + /// Returns the effective UID of the given credential. >>> + pub fn euid(&self) -> bindings::kuid_t { >>> + // SAFETY: By the type invariant, we know that `self.0` is valid. >> >> Is `euid` an immutable property, or why does this memory access not race >> with something? > > Yes. These properties are changed by replacing the credential, so the > credentials themselves are immutable.
I see that's good to know, I think that should be mentioned on the docs of `Credential`.
-- Cheers, Benno
| |