1 #ifndef __LUNAIX_USRSCOPE_H
2 #define __LUNAIX_USRSCOPE_H
4 #include <lunaix/types.h>
20 struct ugroup_obj* grps;
24 Process ACL check result.
25 The encoding here is designed to be the mask for file ACL value
29 ACL_MATCH_U = 0b111000000, // (U)ser
30 ACL_MATCH_G = 0b000111000, // (G)roup
31 ACL_NO_MATCH = 0b000000111, // (O)ther
34 #define user_groups(uscope) ((uscope)->grps)
36 #define grp_list_end ((gid_t)-1)
39 uscope_setgroups(struct user_scope* proc_usr,
40 const gid_t* grps, unsigned int len);
43 uscope_copy(struct user_scope* from, struct user_scope* to);
46 uscope_membership(struct user_scope* proc_usr, gid_t gid);
49 check_current_acl(uid_t desired_u, gid_t desired_g);
52 uscope_with_capability(const struct user_scope* proc_usr, caps_t cap)
54 return !!(proc_usr->capabilities & (1UL << cap));
57 #endif /* __LUNAIX_USRSCOPE_H */