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

fix: def mode

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