Lines Matching refs:rootPath

320     if (sandbox->rootPath == NULL) {  in ParseSandboxConfig()
327 sandbox->rootPath = strdup(rootdir); in ParseSandboxConfig()
328 BEGET_ERROR_CHECK(sandbox->rootPath != NULL, return -1, in ParseSandboxConfig()
469 if (sandbox->rootPath == NULL) { in IsValidSandbox()
481 const char *rootPath = (const char *)data; in MountSandboxNode() local
484 … BEGET_ERROR_CHECK(snprintf_s(target, PATH_MAX, PATH_MAX - 1, "%s%s", rootPath, info->target) > 0, in MountSandboxNode()
496 static int MountSandboxInfo(struct ListNode *head, const char *rootPath, SandboxTag tag) in MountSandboxInfo() argument
498 if ((head == NULL) || (rootPath == NULL)) { in MountSandboxInfo()
501 int ret = OH_ListTraversal(head, (void *)rootPath, MountSandboxNode, 1); in MountSandboxInfo()
510 const char *rootPath = (const char *)data; in LinkSandboxNode() local
513 …BEGET_ERROR_CHECK(!(snprintf_s(linkName, PATH_MAX, PATH_MAX - 1, "%s%s", rootPath, info->linkName)… in LinkSandboxNode()
527 static int LinkSandboxInfo(struct ListNode *head, const char *rootPath) in LinkSandboxInfo() argument
529 if ((head == NULL) || (rootPath == NULL)) { in LinkSandboxInfo()
532 int ret = OH_ListTraversal(head, (void *)rootPath, LinkSandboxNode, 1); in LinkSandboxInfo()
545 BEGET_CHECK(sandbox->rootPath != NULL, return -1); in PrepareSandbox()
547 …EGET_ERROR_CHECK(CheckAndMakeDir(sandbox->rootPath, mode) == 0, return -1, "Failed root %s.", sand… in PrepareSandbox()
550 rc = BindMount(sandbox->rootPath, sandbox->rootPath, MS_BIND | MS_REC, SANDBOX_TAG_MOUNT_PATH); in PrepareSandbox()
554 rc = MountSandboxInfo(&sandbox->pathMountsHead, sandbox->rootPath, SANDBOX_TAG_MOUNT_PATH); in PrepareSandbox()
557 rc = MountSandboxInfo(&sandbox->fileMountsHead, sandbox->rootPath, SANDBOX_TAG_MOUNT_FILE); in PrepareSandbox()
561 rc = LinkSandboxInfo(&sandbox->linksHead, sandbox->rootPath); in PrepareSandbox()
564 …BEGET_ERROR_CHECK(chdir(sandbox->rootPath) == 0, return -1, "Change to %s, err = %d", sandbox->roo… in PrepareSandbox()
565 BEGET_ERROR_CHECK(syscall(SYS_pivot_root, sandbox->rootPath, sandbox->rootPath) == 0, return -1, in PrepareSandbox()
606 if (sandbox->rootPath != NULL) { in DestroySandbox()
607 free(sandbox->rootPath); in DestroySandbox()
608 sandbox->rootPath = NULL; in DestroySandbox()
696 printf("Sandbox root path is %s. \n", map->sandbox->rootPath); in DumpSandboxByName()