Lines Matching refs:team

18 #include <team.h>
31 is_privileged(Team* team)
34 return team->effective_uid == 0;
41 Team* team = thread_get_current_thread()->team;
43 TeamLocker teamLocker(team);
45 bool privileged = kernel || is_privileged(team);
47 gid_t ssgid = team->saved_set_gid;
51 rgid = team->real_gid;
57 team->saved_set_gid = rgid;
58 team->real_gid = rgid;
59 team->effective_gid = rgid;
65 rgid = team->real_gid;
70 if (!privileged && rgid != team->real_gid
71 && rgid != team->effective_gid) {
77 if (rgid != team->real_gid)
84 egid = team->effective_gid;
86 if (!privileged && egid != team->effective_gid
87 && egid != team->real_gid && egid != team->saved_set_gid) {
93 team->real_gid = rgid;
94 team->effective_gid = egid;
95 team->saved_set_gid = ssgid;
104 Team* team = thread_get_current_thread()->team;
106 TeamLocker teamLocker(team);
108 bool privileged = kernel || is_privileged(team);
110 uid_t ssuid = team->saved_set_uid;
114 ruid = team->real_uid;
120 team->saved_set_uid = ruid;
121 team->real_uid = ruid;
122 team->effective_uid = ruid;
128 ruid = team->real_uid;
133 if (!privileged && ruid != team->real_uid
134 && ruid != team->effective_uid) {
140 if (ruid != team->real_uid)
147 euid = team->effective_uid;
149 if (!privileged && euid != team->effective_uid
150 && euid != team->real_uid && euid != team->saved_set_uid) {
156 team->real_uid = ruid;
157 team->effective_uid = euid;
158 team->saved_set_uid = ssuid;
167 Team* team = thread_get_current_thread()->team;
169 TeamLocker teamLocker(team);
171 const gid_t* groups = team->supplementary_groups;
172 int actualCount = team->supplementary_group_count;
176 groups = &team->effective_gid;
227 Team* team = thread_get_current_thread()->team;
229 TeamLocker teamLocker(team);
231 gid_t* toFree = team->supplementary_groups;
232 team->supplementary_groups = newGroups;
233 team->supplementary_group_count = groupCount;
246 /*! Copies the user and group information from \a parent to \a team.
247 The caller must hold the lock to both \a team and \a parent.
250 inherit_parent_user_and_group(Team* team, Team* parent)
252 team->saved_set_uid = parent->saved_set_uid;
253 team->real_uid = parent->real_uid;
254 team->effective_uid = parent->effective_uid;
255 team->saved_set_gid = parent->saved_set_gid;
256 team->real_gid = parent->real_gid;
257 team->effective_gid = parent->effective_gid;
260 team->supplementary_groups = parent->supplementary_groups;
261 team->supplementary_group_count = parent->supplementary_group_count;
266 update_set_id_user_and_group(Team* team, const char* file)
273 TeamLocker teamLocker(team);
276 team->saved_set_uid = st.st_uid;
277 team->effective_uid = st.st_uid;
281 team->saved_set_gid = st.st_gid;
282 team->effective_gid = st.st_gid;
292 Team* team = thread_get_current_thread()->team;
294 return effective ? team->effective_gid : team->real_gid;
301 Team* team = thread_get_current_thread()->team;
303 return effective ? team->effective_uid : team->real_uid;
341 Team* team = thread_get_current_thread()->team;
343 return effective ? team->effective_gid : team->real_gid;
350 Team* team = thread_get_current_thread()->team;
352 return effective ? team->effective_uid : team->real_uid;
381 Team* team = thread_get_current_thread()->team;
382 if (!is_privileged(team))