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 status_t update_set_id_user_and_group(struct team* team, const char* file); 25 26 // syscalls 27 28 gid_t _user_getgid(bool effective); 29 uid_t _user_getuid(bool effective); 30 ssize_t _user_getgroups(int groupSize, gid_t* groupList); 31 status_t _user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged); 32 status_t _user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged); 33 34 #ifdef __cplusplus 35 } // extern "C" 36 #endif 37 38 39 #endif // _KERNEL_USERGROUP_H 40