Home
last modified time | relevance | path

Searched refs:dacData (Results 1 – 11 of 11) sorted by relevance

/base/startup/init/test/unittest/param/
Ddac_unittest.cpp83 int TestDacCheckParaPermission(const char *name, ParamDacData *dacData, int mode) in TestDacCheckParaPermission() argument
92 … ret = memcpy_s(&auditData.dacData, sizeof(auditData.dacData), dacData, sizeof(auditData.dacData)); in TestDacCheckParaPermission()
146 ParamDacData dacData; variable
147 dacData.gid = getegid();
148 dacData.uid = geteuid();
150 dacData.mode = 0400;
151 int ret = test.TestDacCheckParaPermission("test.permission.read.aaa", &dacData, DAC_READ);
153 dacData.mode = 0400;
154 ret = test.TestDacCheckParaPermission("test.permission.read.aaa", &dacData, DAC_WRITE);
156 dacData.mode = 0400;
[all …]
Dparam_stub.cpp205 auditData.dacData.gid = 202; // 202 test dac gid in TestSetParamCheckResult()
206 auditData.dacData.uid = 202; // 202 test dac uid in TestSetParamCheckResult()
207 auditData.dacData.mode = mode; in TestSetParamCheckResult()
465 std::string dacData = "ohos.servicectrl. = system:servicectrl:0775 \n"; in PrepareDacData() local
466 dacData += "startup.service.ctl. = system:servicectrl:0775:int\n"; in PrepareDacData()
467 dacData += "test.permission. = root:root:0770\n"; in PrepareDacData()
468 dacData += "test.permission.read. = root:root:0774\n"; in PrepareDacData()
469 dacData += "test.permission.write.= root:root:0772\n"; in PrepareDacData()
470 dacData += "test.permission.watcher. = root:root:0771\n"; in PrepareDacData()
471 dacData += "test.test1. = system:test1:0771\n"; in PrepareDacData()
[all …]
Dparamservice_unittest.cpp109 auditData.dacData.gid = 202; // 202 test dac gid in TestAddSecurityLabel2()
110 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel2()
111 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel2()
122 EXPECT_EQ(node->gid, auditData.dacData.gid); in TestAddSecurityLabel2()
134 auditData.dacData.gid = 203; // 203 test gid in TestAddSecurityLabel3()
135 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel3()
136 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel3()
141 auditData.dacData.gid = 202; // 202 test dac gid in TestAddSecurityLabel3()
142 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel3()
143 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel3()
[all …]
Dparam_unittest.cpp108 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()
121 EXPECT_EQ(node->gid, auditData.dacData.gid); in TestAddSecurityLabel2()
133 auditData.dacData.gid = 203; // 203 test gid in TestAddSecurityLabel3()
134 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel3()
135 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel3()
140 auditData.dacData.gid = 202; // 202 test dac gid in TestAddSecurityLabel3()
141 auditData.dacData.uid = geteuid(); in TestAddSecurityLabel3()
142 auditData.dacData.mode = 0666; // 0666 test mode in TestAddSecurityLabel3()
[all …]
/base/startup/init/services/param/adapter/
Dparam_dac.c66 static int GetParamDacData(ParamDacData *dacData, const char *value) in GetParamDacData() argument
89 GetUserIdByName(&dacData->uid, name); in GetParamDacData()
93 GetGroupIdByName(&dacData->gid, name); in GetParamDacData()
95 dacData->paramType = PARAM_TYPE_STRING; in GetParamDacData()
102 dacData->paramType = paramTypes[i].value; in GetParamDacData()
106 dacData->mode = (uint16_t)strtol(mode + 1, NULL, OCT_BASE); in GetParamDacData()
130 auditData.dacData.gid = -1; in LoadOneParam_()
131 auditData.dacData.uid = -1; in LoadOneParam_()
133 int ret = GetParamDacData(&auditData.dacData, value); in LoadOneParam_()
135 if (INVALID_UID(auditData.dacData.gid) || INVALID_UID(auditData.dacData.uid)) { in LoadOneParam_()
[all …]
Dparam_selinux.c231 auditData.dacData.gid = node->gid; in HandleSelinuxLabelForPermission()
232 auditData.dacData.uid = node->uid; in HandleSelinuxLabelForPermission()
233 auditData.dacData.mode = node->mode; in HandleSelinuxLabelForPermission()
234 auditData.dacData.paramType = node->type; in HandleSelinuxLabelForPermission()
/base/startup/init/services/param/base/
Dparam_trie.c245 node->uid = auditData->dacData.uid; in AddParamSecurityNode()
246 node->gid = auditData->dacData.gid; in AddParamSecurityNode()
247 node->mode = auditData->dacData.mode; in AddParamSecurityNode()
248 node->type = auditData->dacData.paramType & PARAM_TYPE_MASK; in AddParamSecurityNode()
389 label->mode = auditData->dacData.mode; in AddSecurityLabel()
390 label->uid = auditData->dacData.uid; in AddSecurityLabel()
391 label->gid = auditData->dacData.gid; in AddSecurityLabel()
392 label->type = auditData->dacData.paramType & PARAM_TYPE_MASK; in AddSecurityLabel()
398 auditData->dacData.gid, auditData->dacData.uid, auditData->dacData.mode, in AddSecurityLabel()
399 auditData->dacData.paramType, auditData->name); in AddSecurityLabel()
Dparam_base.c160 auditData.dacData.gid = DAC_DEFAULT_GROUP; in InitParamWorkSpace()
161 auditData.dacData.uid = DAC_DEFAULT_USER; in InitParamWorkSpace()
162 auditData.dacData.mode = DAC_DEFAULT_MODE; // 0774 default mode in InitParamWorkSpace()
163 auditData.dacData.paramType = PARAM_TYPE_STRING; in InitParamWorkSpace()
/base/startup/init/services/begetctl/
Dparam_cmd.c175 struct passwd *user = getpwuid(auditData.dacData.uid); in ShowParam()
176 struct group *group = getgrgid(auditData.dacData.gid); in ShowParam()
180 GetPermissionString(auditData.dacData.mode, 0, permissionStr[0], MASK_LENGTH_MAX), in ShowParam()
182 … GetPermissionString(auditData.dacData.mode,DAC_GROUP_START, permissionStr[1], MASK_LENGTH_MAX), in ShowParam()
184 … GetPermissionString(auditData.dacData.mode, DAC_OTHER_START, permissionStr[2], MASK_LENGTH_MAX)); in ShowParam()
/base/startup/init/services/param/include/
Dparam_security.h85 ParamDacData dacData; member
/base/startup/init/services/param/manager/
Dparam_manager.c255 auditData->dacData.uid = node->uid; in GetParamSecurityAuditData()
256 auditData->dacData.gid = node->gid; in GetParamSecurityAuditData()
257 auditData->dacData.mode = node->mode; in GetParamSecurityAuditData()