Lines Matching defs:root
34 #define SANDBOX_ROOT_TAG "sandbox-root"
287 static int GetSandboxInfo(sandbox_t *sandbox, cJSON *root, const char *itemName)
289 BEGET_ERROR_CHECK(!(sandbox == NULL || root == NULL || itemName == NULL), return -1,
291 cJSON *obj = cJSON_GetObjectItem(root, itemName);
316 static int ParseSandboxConfig(cJSON *root, sandbox_t *sandbox)
318 BEGET_ERROR_CHECK(!(root == NULL || sandbox == NULL), return -1, "Invalid parameter.");
321 cJSON *sandboxRoot = cJSON_GetObjectItem(root, SANDBOX_ROOT_TAG);
329 "Get sandbox root path out of memory");
332 BEGET_ERROR_CHECK(GetSandboxInfo(sandbox, root, SANDBOX_MOUNT_PATH_TAG) == 0, return -1,
334 BEGET_ERROR_CHECK(GetSandboxInfo(sandbox, root, SANDBOX_MOUNT_FILE_TAG) == 0, return -1,
336 BEGET_ERROR_CHECK(GetSandboxInfo(sandbox, root, SANDBOX_SYMLINK_TAG) == 0, return -1,
359 cJSON *root = cJSON_Parse(contents);
361 BEGET_ERROR_CHECK(root != NULL, return -1, "Parse sandbox config \' %s \' failed", sandboxConfigFile);
362 int ret = ParseSandboxConfig(root, sandbox);
363 cJSON_Delete(root);
537 BEGET_ERROR_CHECK(getuid() == 0, return -1, "Current process uid is not root, exit.");
545 BEGET_ERROR_CHECK(CheckAndMakeDir(sandbox->rootPath, mode) == 0, return -1, "Failed root %s.", sandbox->rootPath);
564 "Failed system call pivot root, err=%d", errno);
694 printf("Sandbox root path is %s. \n", map->sandbox->rootPath);