提交 03e1b9c8 编写于 作者: M Mupceet

fix: def mode

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 b675c17f
......@@ -53,6 +53,8 @@ extern "C" {
#endif
#define PARAM_WORKSPACE_SMALL PARAM_WORKSPACE_MAX
#define PARAM_WORKSPACE_DEF PARAM_WORKSPACE_MAX
#define DAC_DEFAULT_GROUP 0
#define DAC_DEFAULT_USER 0
#else
#define PARAM_WORKSPACE_MAX (80 * 1024)
#define PARAM_WORKSPACE_SMALL (1024 * 10)
......@@ -63,6 +65,8 @@ extern "C" {
#define DAC_DEFAULT_MODE 0774
#define PARAM_WORKSPACE_DEF (1024 * 30)
#endif
#define DAC_DEFAULT_GROUP 2000
#define DAC_DEFAULT_USER 0
#endif
// support futex
......
......@@ -155,8 +155,8 @@ int InitParamWorkSpace(int onlyRead)
// add default dac policy
ParamAuditData auditData = {};
auditData.name = "#";
auditData.dacData.gid = 2000; // 2000 for shell
auditData.dacData.uid = 0; // for root
auditData.dacData.gid = DAC_DEFAULT_GROUP; // 2000 for shell
auditData.dacData.uid = DAC_DEFAULT_USER; // for root
auditData.dacData.mode = DAC_DEFAULT_MODE; // 0774 default mode
ret = AddSecurityLabel(&auditData);
PARAM_CHECK(ret == 0, return ret, "Failed to add default dac label");
......
......@@ -78,7 +78,7 @@ public:
const char *value = "2001";
uint32_t labelIndex = 0;
SystemWriteParam(name, value);
// 获取到跟属性
// get root
WorkSpace *workspace = GetWorkSpace(WORKSPACE_NAME_DAC);
(void)FindTrieNode(workspace, name, strlen(name), &labelIndex);
ParamSecruityNode *node = (ParamSecruityNode *)GetTrieNode(workspace, labelIndex);
......@@ -86,7 +86,7 @@ public:
EXPECT_EQ(1, 0);
return 0;
}
EXPECT_EQ(node->gid, 0);
EXPECT_EQ(node->gid, DAC_DEFAULT_GROUP);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册