14eb35609SIngo Weinhold/*
24eb35609SIngo Weinhold * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
34eb35609SIngo Weinhold * Distributed under the terms of the MIT License.
44eb35609SIngo Weinhold */
54eb35609SIngo Weinhold#ifndef _KERNEL_USERGROUP_H
64eb35609SIngo Weinhold#define _KERNEL_USERGROUP_H
74eb35609SIngo Weinhold
84535495dSIngo Weinhold
94eb35609SIngo Weinhold#include <unistd.h>
104eb35609SIngo Weinhold
114eb35609SIngo Weinhold#include <SupportDefs.h>
124eb35609SIngo Weinhold
134eb35609SIngo Weinhold
144535495dSIngo Weinholdnamespace BKernel {
154535495dSIngo Weinhold	struct Team;
164535495dSIngo Weinhold}
174535495dSIngo Weinhold
184535495dSIngo Weinholdusing BKernel::Team;
194eb35609SIngo Weinhold
204eb35609SIngo Weinhold
214eb35609SIngo Weinhold#ifdef __cplusplus
224eb35609SIngo Weinholdextern "C" {
234eb35609SIngo Weinhold#endif
244eb35609SIngo Weinhold
254eb35609SIngo Weinhold// kernel private functions
264eb35609SIngo Weinhold
274535495dSIngo Weinholdvoid		inherit_parent_user_and_group(Team* team, Team* parent);
284535495dSIngo Weinholdstatus_t	update_set_id_user_and_group(Team* team, const char* file);
294eb35609SIngo Weinhold
304eb35609SIngo Weinhold// syscalls
314eb35609SIngo Weinhold
324eb35609SIngo Weinholdgid_t		_user_getgid(bool effective);
334eb35609SIngo Weinholduid_t		_user_getuid(bool effective);
344eb35609SIngo Weinholdstatus_t	_user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged);
354eb35609SIngo Weinholdstatus_t	_user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged);
36290946ceSIngo Weinholdssize_t		_user_getgroups(int groupCount, gid_t* groupList);
37290946ceSIngo Weinholdssize_t		_user_setgroups(int groupCount, const gid_t* groupList);
384eb35609SIngo Weinhold
394eb35609SIngo Weinhold#ifdef __cplusplus
404eb35609SIngo Weinhold}	// extern "C"
414eb35609SIngo Weinhold#endif
424eb35609SIngo Weinhold
434eb35609SIngo Weinhold
444eb35609SIngo Weinhold#endif	// _KERNEL_USERGROUP_H
45