/base/startup/init/test/unittest/param/ |
D | param_unittest.cpp | 106 ParamAuditData auditData = {}; in TestAddSecurityLabel2() local 107 auditData.name = "label2.test.aaa"; in TestAddSecurityLabel2() 108 auditData.dacData.gid = 202; // 202 test dac gid in TestAddSecurityLabel2() 109 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel2() 110 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel2() 113 AddSecurityLabel(&auditData); in TestAddSecurityLabel2() 121 EXPECT_EQ(node->gid, auditData.dacData.gid); in TestAddSecurityLabel2() 131 ParamAuditData auditData = {}; in TestAddSecurityLabel3() local 132 auditData.name = "label3.test.aaa"; in TestAddSecurityLabel3() 133 auditData.dacData.gid = 203; // 203 test gid in TestAddSecurityLabel3() [all …]
|
D | paramservice_unittest.cpp | 110 ParamAuditData auditData = {}; in TestAddSecurityLabel2() local 111 auditData.name = "label2.test.aaa"; in TestAddSecurityLabel2() 112 auditData.dacData.gid = 202; // 202 test dac gid in TestAddSecurityLabel2() 113 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel2() 114 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel2() 117 AddSecurityLabel(&auditData); in TestAddSecurityLabel2() 125 EXPECT_EQ(node->gid, auditData.dacData.gid); in TestAddSecurityLabel2() 135 ParamAuditData auditData = {}; in TestAddSecurityLabel3() local 136 auditData.name = "label3.test.aaa"; in TestAddSecurityLabel3() 137 auditData.dacData.gid = 203; // 203 test gid in TestAddSecurityLabel3() [all …]
|
D | dac_unittest.cpp | 76 ParamAuditData auditData = {}; in TestDacCheckParaPermission() local 77 auditData.name = name; in TestDacCheckParaPermission() 78 … ret = memcpy_s(&auditData.dacData, sizeof(auditData.dacData), dacData, sizeof(auditData.dacData)); in TestDacCheckParaPermission() 80 ret = AddSecurityLabel(&auditData); in TestDacCheckParaPermission()
|
D | param_stub.cpp | 144 ParamAuditData auditData = {}; in TestSetParamCheckResult() local 145 auditData.name = prefix; in TestSetParamCheckResult() 146 auditData.dacData.gid = 202; // 202 test dac gid in TestSetParamCheckResult() 147 auditData.dacData.uid = 202; // 202 test dac uid in TestSetParamCheckResult() 148 auditData.dacData.mode = mode; in TestSetParamCheckResult() 149 AddSecurityLabel(&auditData); in TestSetParamCheckResult()
|
/base/startup/init/services/param/adapter/ |
D | param_dac.c | 127 ParamAuditData auditData = {0}; in LoadOneParam_() local 128 auditData.dacData.gid = -1; in LoadOneParam_() 129 auditData.dacData.uid = -1; in LoadOneParam_() 130 auditData.name = name; in LoadOneParam_() 131 int ret = GetParamDacData(&auditData.dacData, value); in LoadOneParam_() 133 if (INVALID_UID(auditData.dacData.gid) || INVALID_UID(auditData.dacData.uid)) { in LoadOneParam_() 134 …PARAM_LOGW("Invalid dac for '%s' gid %d uid %d", name, auditData.dacData.gid, auditData.dacData.ui… in LoadOneParam_() 136 AddSecurityLabel(&auditData); in LoadOneParam_() 309 ParamAuditData auditData = {0}; in AddGroupUser() local 313 auditData.name = buffer; in AddGroupUser() [all …]
|
/base/startup/init/services/param/base/ |
D | param_comm.c | 350 INIT_LOCAL_API int AddSecurityLabel(const ParamAuditData *auditData) in AddSecurityLabel() argument 355 PARAM_CHECK(auditData != NULL && auditData->name != NULL, return -1, "Invalid auditData"); in AddSecurityLabel() 358 int ret = CheckParamName(auditData->name, 1); in AddSecurityLabel() 359 PARAM_CHECK(ret == 0, return ret, "Illegal param name \"%s\"", auditData->name); in AddSecurityLabel() 361 ParamTrieNode *node = FindTrieNode(workSpace, auditData->name, strlen(auditData->name), NULL); in AddSecurityLabel() 363 node = AddTrieNode(workSpace, auditData->name, strlen(auditData->name)); in AddSecurityLabel() 365 …PARAM_CHECK(node != NULL, return PARAM_CODE_REACHED_MAX, "Failed to add node %s", auditData->name); in AddSecurityLabel() 368 offset = AddParamSecurityNode(workSpace, auditData); in AddSecurityLabel() 375 label->mode = auditData->dacData.mode; in AddSecurityLabel() 376 label->uid = auditData->dacData.uid; in AddSecurityLabel() [all …]
|
D | param_base.c | 173 ParamAuditData auditData = {0}; in InitParamWorkSpace() local 174 auditData.name = "#"; in InitParamWorkSpace() 175 auditData.dacData.gid = DAC_DEFAULT_GROUP; // 2000 for shell in InitParamWorkSpace() 176 auditData.dacData.uid = DAC_DEFAULT_USER; // for root in InitParamWorkSpace() 177 auditData.dacData.mode = DAC_DEFAULT_MODE; // 0774 default mode in InitParamWorkSpace() 178 auditData.dacData.paramType = PARAM_TYPE_STRING; in InitParamWorkSpace() 179 ret = AddSecurityLabel(&auditData); in InitParamWorkSpace()
|
D | param_trie.c | 327 INIT_LOCAL_API uint32_t AddParamSecurityNode(WorkSpace *workSpace, const ParamAuditData *auditData) in AddParamSecurityNode() argument 330 PARAM_CHECK(auditData != NULL && auditData->name != NULL, return 0, "Invalid auditData"); in AddParamSecurityNode() 336 node->uid = auditData->dacData.uid; in AddParamSecurityNode() 337 node->gid = auditData->dacData.gid; in AddParamSecurityNode() 338 node->mode = auditData->dacData.mode; in AddParamSecurityNode() 339 node->type = auditData->dacData.paramType & PARAM_TYPE_MASK; in AddParamSecurityNode()
|
/base/startup/init/services/begetctl/ |
D | param_cmd.c | 154 ParamAuditData auditData = {}; in ShowParam() local 155 int ret = GetParamSecurityAuditData(name, 0, &auditData); in ShowParam() 159 BShellEnvOutput(shell, "selinux : %s \r\n", auditData.label); in ShowParam() 162 struct passwd *user = getpwuid(auditData.dacData.uid); in ShowParam() 163 struct group *group = getgrgid(auditData.dacData.gid); in ShowParam() 167 GetPermissionString(auditData.dacData.mode, 0, permissionStr[0], MASK_LENGTH_MAX), in ShowParam() 169 … GetPermissionString(auditData.dacData.mode,DAC_GROUP_START, permissionStr[1], MASK_LENGTH_MAX), in ShowParam() 171 … GetPermissionString(auditData.dacData.mode, DAC_OTHER_START, permissionStr[2], MASK_LENGTH_MAX)); in ShowParam()
|
/base/startup/init/services/param/manager/ |
D | param_manager.c | 233 INIT_INNER_API int GetParamSecurityAuditData(const char *name, int type, ParamAuditData *auditData) in GetParamSecurityAuditData() argument 247 auditData->name = name; in GetParamSecurityAuditData() 248 auditData->dacData.uid = node->uid; in GetParamSecurityAuditData() 249 auditData->dacData.gid = node->gid; in GetParamSecurityAuditData() 250 auditData->dacData.mode = node->mode; in GetParamSecurityAuditData() 255 int ret = strcpy_s(auditData->label, sizeof(auditData->label), tmpName); in GetParamSecurityAuditData()
|
/base/startup/init/services/param/include/ |
D | param_manager.h | 109 INIT_LOCAL_API int AddSecurityLabel(const ParamAuditData *auditData); 130 INIT_INNER_API int GetParamSecurityAuditData(const char *name, int type, ParamAuditData *auditData);
|
D | param_trie.h | 117 INIT_LOCAL_API uint32_t AddParamSecurityNode(WorkSpace *workSpace, const ParamAuditData *auditData);
|