Lines Matching defs:config
122 APPSPAWN_STATIC unsigned long GetMountModeFromConfig(const cJSON *config, const char *key, unsigned long def)
124 char *value = cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(config, key));
135 static uint32_t GetNameGroupTypeFromConfig(const cJSON *config, const char *key, unsigned long def)
137 char *value = cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(config, key));
173 static mode_t GetChmodFromJson(const cJSON *config)
176 char *modeStrs = GetStringFromJsonObj(config, "dest-mode");
184 APPSPAWN_STATIC uint32_t GetFlagIndexFromJson(const cJSON *config)
186 char *flagStr = GetStringFromJsonObj(config, "name");
197 static void FillPathDemandInfo(const cJSON *config, PathMountNode *sandboxNode)
199 APPSPAWN_CHECK_ONLY_EXPER(config != NULL, return);
200 sandboxNode->demandInfo->uid = GetIntValueFromJsonObj(config, "uid", -1);
201 sandboxNode->demandInfo->gid = GetIntValueFromJsonObj(config, "gid", -1);
202 sandboxNode->demandInfo->mode = GetIntValueFromJsonObj(config, "ugo", -1);
205 static PathMountNode *DecodeMountPathConfig(const SandboxSection *section, const cJSON *config, uint32_t type)
207 char *srcPath = GetStringFromJsonObj(config, "src-path");
208 char *dstPath = GetStringFromJsonObj(config, "sandbox-path");
216 APPSPAWN_LOGW("path %{public}s %{public}s repeat config, delete old", srcPath, dstPath);
219 cJSON *demandInfo = cJSON_GetObjectItemCaseSensitive(config, "create-on-demand");
226 sandboxNode->destMode = GetChmodFromJson(config);
227 sandboxNode->mountSharedFlag = GetBoolValueFromJsonObj(config, "mount-shared-flag", false);
228 sandboxNode->checkErrorFlag = GetBoolValueFromJsonObj(config, "check-action-status", false);
230 sandboxNode->category = GetMountCategory(GetStringFromJsonObj(config, "category"));
231 const char *value = GetStringFromJsonObj(config, "app-apl-name");
263 static SymbolLinkNode *DecodeSymbolLinksConfig(const SandboxSection *section, const cJSON *config)
265 const char *target = GetStringFromJsonObj(config, "target-name");
266 const char *linkName = GetStringFromJsonObj(config, "link-name");
274 APPSPAWN_LOGW("SymbolLink %{public}s %{public}s repeat config, delete old", target, linkName);
279 node->destMode = GetChmodFromJson(config);
280 node->checkErrorFlag = GetBoolValueFromJsonObj(config, "check-action-status", false);
344 return APPSPAWN_SANDBOX_INVALID, "Invalid mount-groups config %{public}s", section->name);
404 return APPSPAWN_SANDBOX_INVALID, "Invalid config %{public}s", section->name);
447 APPSPAWN_LOGV("Parse package-name config %{public}s", name);
467 APPSPAWN_LOGV("Parse spawn-flags config %{public}s flagIndex %{public}u", name, flagIndex);
487 APPSPAWN_LOGV("Parse permission config %{public}s", name);
507 APPSPAWN_CHECK(name != NULL, return NULL, "No name in name group config");
508 APPSPAWN_LOGV("Parse name-group config %{public}s", name);
545 APPSPAWN_CHECK(root != NULL, return APPSPAWN_SANDBOX_INVALID, "Invalid config ");
548 APPSPAWN_CHECK(cJSON_IsArray(configs), return APPSPAWN_SANDBOX_INVALID, "Invalid config ");
573 return APPSPAWN_SANDBOX_INVALID, "Invalid config %{public}s", configName);
598 APPSPAWN_CHECK(rootPath != NULL, return APPSPAWN_SYSTEM_ERROR, "No root path in config");
626 cJSON *config = NULL;
627 cJSON_ArrayForEach(config, required)
629 APPSPAWN_LOGI("Sandbox required config: %{public}s", config->string);
630 SandboxSection *section = GetSandboxSection(&sandbox->requiredQueue, config->string);
632 section = CreateSandboxSection(config->string, sizeof(SandboxSection), SANDBOX_TAG_REQUIRED);
636 ret = ParseBaseConfig(sandbox, section, config);
650 cJSON *config = cJSON_GetObjectItemCaseSensitive(json, "permission");
651 ret = ParseConditionalConfig(sandbox, config, "permission", ParsePermissionConfig);
654 config = cJSON_GetObjectItemCaseSensitive(json, "spawn-flag");
655 ret = ParseConditionalConfig(sandbox, config, "spawn-flag", ParseSpawnFlagsConfig);
658 config = cJSON_GetObjectItemCaseSensitive(json, "package-name");
659 ret = ParseConditionalConfig(sandbox, config, "package-name", ParsePackageNameConfig);
688 APPSPAWN_LOGW("No sandbox config");