Re: [PATCH v3 2/9] rust: cred: add Rust abstraction for `struct cred`

From: Benno Lossin
Date: Wed Jan 24 2024 - 04:51:40 EST


On 19.01.24 10:52, Alice Ryhl wrote:
> On Fri, Jan 19, 2024 at 10:37 AM Benno Lossin <benno.lossin@xxxxxxxxx> 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