Home
last modified time | relevance | path

Searched refs:caps (Results 1 – 25 of 29) sorted by relevance

12

/base/startup/init/services/init/
Dinit_capability.c102 if (service->servPerm.caps != NULL) { in GetServiceCaps()
103 free(service->servPerm.caps); in GetServiceCaps()
104 service->servPerm.caps = NULL; in GetServiceCaps()
106 service->servPerm.caps = (unsigned int *)calloc(1, sizeof(unsigned int) * capsCnt); in GetServiceCaps()
107 INIT_ERROR_CHECK(service->servPerm.caps != NULL, return SERVICE_FAILURE, in GetServiceCaps()
109 unsigned int caps = FULL_CAP; in GetServiceCaps() local
114 caps = (unsigned int)cJSON_GetNumberValue(capJson); in GetServiceCaps()
121 caps = GetCapByString(capStr); in GetServiceCaps()
123 if ((caps > CAP_LAST_CAP) && (caps != (unsigned int)FULL_CAP)) { in GetServiceCaps()
124 INIT_LOGE("service=%s not support caps = %s caps %d", service->name, capStr, caps); in GetServiceCaps()
[all …]
Dinit_common_service.c153 if (service->servPerm.caps[i] == FULL_CAP) { in SetPerms()
161 …capData[CAP_TO_INDEX(service->servPerm.caps[i])].effective |= CAP_TO_MASK(service->servPerm.caps[i… in SetPerms()
162 …capData[CAP_TO_INDEX(service->servPerm.caps[i])].permitted |= CAP_TO_MASK(service->servPerm.caps[i… in SetPerms()
163 …capData[CAP_TO_INDEX(service->servPerm.caps[i])].inheritable |= CAP_TO_MASK(service->servPerm.caps in SetPerms()
169 if (service->servPerm.caps[i] == FULL_CAP) { in SetPerms()
172 … INIT_ERROR_CHECK(SetAmbientCapability(service->servPerm.caps[i]) == 0, return SERVICE_FAILURE, in SetPerms()
/base/startup/appspawn_lite/services/src/
Dappspawn_process.c47 static int SetCapability(unsigned int capsCnt, const unsigned int* caps) in SetCapability() argument
56 capData[CAP_TO_INDEX(caps[i])].effective |= CAP_TO_MASK(caps[i]); in SetCapability()
57 capData[CAP_TO_INDEX(caps[i])].permitted |= CAP_TO_MASK(caps[i]); in SetCapability()
58 capData[CAP_TO_INDEX(caps[i])].inheritable |= CAP_TO_MASK(caps[i]); in SetCapability()
66 if (SetAmbientCapability(caps[i]) != 0) { in SetCapability()
74 static int SetPerms(uid_t uID, gid_t gID, unsigned int capsCnt, const unsigned int* caps) in SetPerms() argument
126 if (SetCapability(capsCnt, caps) != 0) { in SetPerms()
153 if (SetPerms(msgSt->uID, msgSt->gID, msgSt->capsCnt, msgSt->caps) != 0) { in CreateProcess()
Dappspawn_message.c51 if (targetSt->caps != NULL) { in FreeMessageSt()
52 free(targetSt->caps); in FreeMessageSt()
53 targetSt->caps = NULL; in FreeMessageSt()
106 msgSt->caps = NULL; in GetCaps()
125 msgSt->caps = (unsigned int*)malloc(sizeof(unsigned int) * capsCnt); in GetCaps()
126 if (msgSt->caps == NULL) { in GetCaps()
135 free(msgSt->caps); in GetCaps()
136 msgSt->caps = NULL; in GetCaps()
139 msgSt->caps[i] = (unsigned int)cJSON_GetNumberValue(capJ); in GetCaps()
140 if (msgSt->caps[i] > CAP_LAST_CAP) { in GetCaps()
[all …]
/base/startup/appspawn/lite/
Dappspawn_message.c52 if (targetSt->caps != NULL) { in FreeMessageSt()
53 free(targetSt->caps); in FreeMessageSt()
54 targetSt->caps = NULL; in FreeMessageSt()
107 msgSt->caps = NULL; in GetCaps()
126 msgSt->caps = (unsigned int *)malloc(sizeof(unsigned int) * capsCnt); in GetCaps()
127 if (msgSt->caps == NULL) { in GetCaps()
136 free(msgSt->caps); in GetCaps()
137 msgSt->caps = NULL; in GetCaps()
140 msgSt->caps[i] = (unsigned int)cJSON_GetNumberValue(capJ); in GetCaps()
141 if (msgSt->caps[i] > CAP_LAST_CAP) { in GetCaps()
[all …]
Dappspawn_process.c56 static int SetCapability(unsigned int capsCnt, const unsigned int *caps) in SetCapability() argument
65 capData[CAP_TO_INDEX(caps[i])].effective |= CAP_TO_MASK(caps[i]); in SetCapability()
66 capData[CAP_TO_INDEX(caps[i])].permitted |= CAP_TO_MASK(caps[i]); in SetCapability()
67 capData[CAP_TO_INDEX(caps[i])].inheritable |= CAP_TO_MASK(caps[i]); in SetCapability()
75 if (SetAmbientCapability(caps[i]) != 0) { in SetCapability()
155 if (SetCapability(appProperty->message.capsCnt, appProperty->message.caps) != 0) { in SetCapabilities()
Dappspawn_message.h34 unsigned int *caps; member
/base/startup/appspawn_lite/services/test/unittest/common/
Dmessage_func_test.cpp148 EXPECT_EQ(msgSt.caps, nullptr);
187 msgSt.caps = (unsigned int*)malloc(MALLOC_TEST_LENGTH * sizeof(unsigned int));
188 EXPECT_TRUE(msgSt.caps != nullptr);
190 EXPECT_EQ(msgSt.caps, nullptr);
195 msgSt.caps = (unsigned int*)malloc(MALLOC_TEST_LENGTH * sizeof(unsigned int));
198 EXPECT_TRUE(msgSt.caps != nullptr);
207 EXPECT_EQ(msgSt.caps, nullptr);
295 std::vector<unsigned int> caps; variable
296 caps.push_back(0); // 0, test capability
297 caps.push_back(1); // 1, test capability
[all …]
/base/startup/appspawn/test/unittest/app_spawn_lite_test/
Dapp_spawn_lite_test.cpp202 EXPECT_EQ(msgSt.caps, nullptr);
241 msgSt.caps = (unsigned int*)malloc(MALLOC_TEST_LENGTH * sizeof(unsigned int));
242 EXPECT_TRUE(msgSt.caps != nullptr);
244 EXPECT_EQ(msgSt.caps, nullptr);
249 msgSt.caps = (unsigned int*)malloc(MALLOC_TEST_LENGTH * sizeof(unsigned int));
252 EXPECT_TRUE(msgSt.caps != nullptr);
261 EXPECT_EQ(msgSt.caps, nullptr);
349 std::vector<unsigned int> caps; variable
350 caps.push_back(0); // 0, test capability
351 caps.push_back(1); // 1, test capability
[all …]
/base/startup/init/test/unittest/init/
Dservice_unittest.cpp229 service->servPerm.caps = (unsigned int *)malloc(sizeof(unsigned int));
230 ASSERT_NE(nullptr, service->servPerm.caps);
346 unsigned int *caps = (unsigned int *)calloc(1, sizeof(unsigned int) * 1); variable
347 ASSERT_NE(nullptr, caps);
348 caps[0] = FULL_CAP;
349 service->servPerm.caps = caps;
/base/startup/appspawn_lite/services/include/
Dappspawn_message.h29 unsigned int* caps; member
/base/inputmethod/imf/etc/init/
Dinputmethodservice.cfg15 "caps" : [],
/base/startup/init/services/etc/
Dueventd.cfg22 "caps" : ["DAC_OVERRIDE", "MKNOD", "CHOWN", "FOWNER"],
/base/hiviewdfx/hidumper/services/native/etc/
Dhidumper_service.cfg20 "caps" : ["CAP_DAC_READ_SEARCH", "CAP_SYS_PTRACE"],
/base/time/time_service/services/etc/init/
Dtimeservice.cfg16 "caps" : ["SYS_TIME", "WAKE_ALARM"],
/base/security/permission_lite/services/pms/include/
Dpms.h35 int QueryAppCapabilities(const char *identifier, unsigned int **caps, unsigned int *capNum);
/base/hiviewdfx/faultloggerd/services/config/
Dfaultloggerd.cfg35 "caps" : ["CAP_KILL"],
/base/hiviewdfx/faultloggerd/test/funchook/config/
Dfaultloggerd.cfg40 "caps" : ["CAP_KILL"],
/base/hiviewdfx/faultloggerd/services/config/bionic/
Dfaultloggerd.cfg40 "caps" : ["CAP_KILL"],
/base/update/updater/services/etc/
Dinit.cfg72 "caps" : [0, 1]
80 "caps" : [0, 1],
/base/hiviewdfx/faultloggerd/test/funchook/config/bionic/
Dfaultloggerd.cfg40 "caps" : ["CAP_KILL"],
/base/hiviewdfx/hiview/service/config/
Dhiview.cfg47 "caps" : ["SYSLOG"],
/base/security/permission_lite/services/pms/src/
Dpms_impl.c329 int QueryAppCapabilities(const char *identifier, unsigned int **caps, unsigned int *capNum) in QueryAppCapabilities() argument
331 if (caps == NULL || capNum == NULL) { in QueryAppCapabilities()
370 *caps = (unsigned int *)HalMalloc(allocSize); in QueryAppCapabilities()
371 if (*caps == NULL) { in QueryAppCapabilities()
376 *(*caps + k) = capsBinded[k]; in QueryAppCapabilities()
/base/startup/init/services/init/include/
Dinit_service.h111 unsigned int *caps; member
/base/startup/init/services/init/standard/
Dinit_control_fd_service.c112 printf("\t\tservice perms capability %u \n", service->servPerm.caps[i]); in DumpOneService()

12