mirror of
https://github.com/apache/nuttx.git
synced 2026-09-25 01:07:40 +08:00
sched/group: implement POSIX saved-set-UID/GID semantics
Adds tg_suid and tg_sgid fields to task_group_s to complete the POSIX three-field identity model (real, effective, saved-set). Updates group_inherit_identity() to propagate the new fields from parent to child task group on task creation. Fixes setuid(), setgid(), seteuid(), and setegid() to implement correct POSIX privilege transition logic: - Root (euid==0): may set any value; all three IDs updated by setuid/setgid - Non-root: may only set effective ID to real or saved value; else EPERM Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
d33e20fa1c
commit
370d89a012
@@ -462,6 +462,8 @@ struct task_group_s
|
||||
gid_t tg_gid; /* User group identity */
|
||||
uid_t tg_euid; /* Effective user identity */
|
||||
gid_t tg_egid; /* Effective user group identity */
|
||||
uid_t tg_suid; /* Saved set-user identity */
|
||||
gid_t tg_sgid; /* Saved set-group identity */
|
||||
#endif
|
||||
|
||||
/* Group membership *******************************************************/
|
||||
|
||||
Reference in New Issue
Block a user