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 9 #include <unistd.h> 10 11 #include <SupportDefs.h> 12 13 14 namespace BKernel { 15 struct Team; 16 } 17 18 using BKernel::Team; 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 // kernel private functions 26 27 void inherit_parent_user_and_group(Team* team, Team* parent); 28 void inherit_parent_user_and_group_locked(Team* team, Team* parent); 29 status_t update_set_id_user_and_group(Team* team, const char* file); 30 31 // syscalls 32 33 gid_t _user_getgid(bool effective); 34 uid_t _user_getuid(bool effective); 35 status_t _user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged); 36 status_t _user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged); 37 ssize_t _user_getgroups(int groupCount, gid_t* groupList); 38 ssize_t _user_setgroups(int groupCount, const gid_t* groupList); 39 40 #ifdef __cplusplus 41 } // extern "C" 42 #endif 43 44 45 #endif // _KERNEL_USERGROUP_H 46