1 /* 2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _KERNEL_USERGROUP_H 6 #define _KERNEL_USERGROUP_H 7 8 #include <unistd.h> 9 10 #include <SupportDefs.h> 11 12 13 struct team; 14 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 // kernel private functions 21 22 void inherit_parent_user_and_group(struct team* team, 23 struct team* parent); 24 void inherit_parent_user_and_group_locked(struct team* team, 25 struct team* parent); 26 status_t update_set_id_user_and_group(struct team* team, const char* file); 27 28 // syscalls 29 30 gid_t _user_getgid(bool effective); 31 uid_t _user_getuid(bool effective); 32 status_t _user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged); 33 status_t _user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged); 34 ssize_t _user_getgroups(int groupCount, gid_t* groupList); 35 ssize_t _user_setgroups(int groupCount, const gid_t* groupList); 36 37 #ifdef __cplusplus 38 } // extern "C" 39 #endif 40 41 42 #endif // _KERNEL_USERGROUP_H 43