builtin: uid and gid configuration for builtin app

File uid and gid configuration for builtin fs, if set-user-ID bit is set
in the file permissions, then the euid of process set as file uid. Use
the confiuration to emulate builtin app set.

MODE must octal number and use similar with linux chmod OCTAL-MODE FILE
UID  = 2000
GID  = 3000
MODE = 06555

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
fangxinyong 2023-04-15 15:01:04 +08:00 committed by Xiang Xiao
parent 75f04dd775
commit b0933fe431
3 changed files with 35 additions and 0 deletions

View file

@ -26,6 +26,8 @@
#include <nuttx/lib/builtin.h>
#include <sys/stat.h>
/****************************************************************************
* Private Types
****************************************************************************/
@ -43,7 +45,11 @@
const struct builtin_s g_builtins[] =
{
# include "builtin_list.h"
#ifdef CONFIG_SCHED_USER_IDENTITY
{ NULL, 0, 0, 0, 0, 0, 0 }
#else
{ NULL, 0, 0, 0 }
#endif
};
const int g_builtin_count = sizeof(g_builtins) / sizeof(g_builtins[0]);