sched: implement effective uid and gid interfaces

Implement 'effective' setuid, getuid, setgid, and getgid interfaces.
These will be inheritance by all child task groups. These definitons
are explicitly specified here:
https://pubs.opengroup.org/onlinepubs/000095399/functions/geteuid.html
https://pubs.opengroup.org/onlinepubs/000095399/functions/getegid.html
https://pubs.opengroup.org/onlinepubs/000095399/functions/seteuid.html
https://pubs.opengroup.org/onlinepubs/000095399/functions/setegid.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
fangxinyong
2023-04-15 14:47:19 +08:00
committed by Xiang Xiao
parent 13f071baa8
commit 896f34fde9
14 changed files with 307 additions and 38 deletions
+4 -4
View File
@@ -36,9 +36,9 @@
"ftruncate","unistd.h","","int","int","off_t"
"futimens","sys/stat.h","","int","int","const struct timespec [2]|FAR const struct timespec *"
"get_environ_ptr","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char **"
"getegid","unistd.h","","gid_t"
"getegid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","gid_t"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *"
"geteuid","unistd.h","","uid_t"
"geteuid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","uid_t"
"getgid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","gid_t"
"gethostname","unistd.h","","int","FAR char *","size_t"
"getitimer","sys/time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","int","FAR struct itimerval *"
@@ -150,9 +150,9 @@
"sendfile","sys/sendfile.h","","ssize_t","int","int","FAR off_t *","size_t"
"sendmsg","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR struct msghdr *","int"
"sendto","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR const void *","size_t","int","FAR const struct sockaddr *","socklen_t"
"setegid","unistd.h","","int","gid_t"
"setegid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","int","gid_t"
"setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *","FAR const char *","int"
"seteuid","unistd.h","","int","uid_t"
"seteuid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","int","uid_t"
"setgid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","int","gid_t"
"sethostname","unistd.h","","int","FAR const char *","size_t"
"setitimer","sys/time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","int","FAR const struct itimerval *","FAR struct itimerval *"
1 _assert assert.h void FAR const char * int FAR const char * FAR void *
36 ftruncate unistd.h int int off_t
37 futimens sys/stat.h int int const struct timespec [2]|FAR const struct timespec *
38 get_environ_ptr stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char **
39 getegid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) gid_t
40 getenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char * FAR const char *
41 geteuid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) uid_t
42 getgid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) gid_t
43 gethostname unistd.h int FAR char * size_t
44 getitimer sys/time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int int FAR struct itimerval *
150 sendfile sys/sendfile.h ssize_t int int FAR off_t * size_t
151 sendmsg sys/socket.h defined(CONFIG_NET) ssize_t int FAR struct msghdr * int
152 sendto sys/socket.h defined(CONFIG_NET) ssize_t int FAR const void * size_t int
153 setegid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) int gid_t
154 setenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) int FAR const char * FAR const char * int
155 seteuid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) int uid_t
156 setgid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) int gid_t
157 sethostname unistd.h int FAR const char * size_t
158 setitimer sys/time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int int FAR const struct itimerval * FAR struct itimerval *