My Kernel v0.1.0
user.h
Go to the documentation of this file.
1
13#ifndef KERNEL_USER_H
14#define KERNEL_USER_H
15
16#include <kernel/error.h>
17#include <kernel/types.h>
18
20struct user_creds {
21 uid_t ruid;
22 uid_t rgid;
23 uid_t euid;
24 uid_t egid;
25 uid_t suid;
26 uid_t sgid;
27};
28
29#define UID_ROOT 0
30
31static inline bool creds_is_root(const struct user_creds *creds)
32{
33 return creds->ruid == UID_ROOT;
34}
35
37void creds_copy(struct user_creds *dst, const struct user_creds *src);
38
39#endif /* KERNEL_USER_H */
40
41/* @} */
uid_t egid
Definition: user.h:24
void creds_copy(struct user_creds *dst, const struct user_creds *src)
Copy the credentials from src into dst.
Definition: user.c:12
uid_t sgid
Definition: user.h:26
uid_t ruid
Definition: user.h:21
uid_t suid
Definition: user.h:25
uid_t rgid
Definition: user.h:22
uid_t euid
Definition: user.h:23
User credentials.
Definition: user.h:20