Lines Matching refs:path

70 APPSPAWN_STATIC bool CheckDirRecursive(const char *path)
74 const char *p = path;
75 char *curPos = strchr(path, slash);
83 int ret = memcpy_s(buffer, PATH_MAX, path, p - path - 1);
84 APPSPAWN_CHECK(ret == 0, return false, "Failed to copy path");
89 int ret = access(path, F_OK);
133 APPSPAWN_CHECK(ret == 0, return ret, "Failed to copy root path %{public}s", sandbox->rootPath);
143 "Failed to format root path %{public}s", sandbox->rootPath);
226 // root path
301 // umount fuse path, make sure that sandbox path is not a mount point
306 "open /dev/fuse failed, errno: %{public}d sandbox path %{public}s", errno, args->destinationPath);
458 return APPSPAWN_ARG_INVALID, "Invalid path %{public}s %{public}s", args.originPath, args.destinationPath);
553 char *path = (char *)malloc(sizeof(char) * allPathSize);
554 APPSPAWN_CHECK(path != NULL, return true, "Failed to malloc path");
555 int len = sprintf_s(path, allPathSize, "%s%u%s%s", rootPath, uid, basePath, bundleName);
556 APPSPAWN_CHECK(len > 0 && ((size_t)len < allPathSize), free(path); return true, "Failed to get base path");
558 if (access(path, F_OK) == 0) {
560 free(path);
563 free(path);
577 char *path = (char *)malloc(sizeof(char) * (allPathSize));
578 APPSPAWN_CHECK(path != NULL, return, "Failed to malloc path");
579 int len = sprintf_s(path, allPathSize, "%s%u/%s%s", rootPath, info->uid / userIdBase, bundleName, targetPath);
580 APPSPAWN_CHECK(len > 0 && ((size_t)len < allPathSize), free(path);
581 return, "Failed to get sandbox path");
583 if (access(path, F_OK) == 0) {
584 free(path);
588 MakeDirRec(path, DIR_MODE, 1);
589 if (mount(path, path, NULL, MS_BIND | MS_REC, NULL) != 0) {
590 APPSPAWN_LOGI("bind mount %{public}s failed, error %{public}d", path, errno);
591 free(path);
594 if (mount(NULL, path, NULL, MS_SHARED, NULL) != 0) {
595 APPSPAWN_LOGI("mount path %{public}s to shared failed, errno %{public}d", path, errno);
596 free(path);
599 APPSPAWN_LOGI("mount path %{public}s to shared success", path);
600 free(path);
651 APPSPAWN_LOGE("snprintf_s lock sandbox path stamp failed");
664 APPSPAWN_LOGE("Failed to get real path %{public}s ", groupNode->section.name);
672 APPSPAWN_LOGE("Failed to get real path %{public}s ", groupNode->section.name);
700 APPSPAWN_LOGV("Src path %{public}s exist, do not mount", srcPath);
849 "chdir failed, app: %{public}s, path: %{public}s errno: %{public}d",
855 "chroot failed, path: %{public}s errno: %{public}d", context->rootPath, errno);
860 "pivot root failed, path: %{public}s errno: %{public}d", context->rootPath, errno);
863 "MNT_DETACH failed, path: %{public}s errno: %{public}d", context->rootPath, errno);
879 "mount path failed, app: %{public}s errno: %{public}d", context->rootPath, ret);
893 // bind mount "/" to /mnt/sandbox/<packageName> path
907 char path[PATH_MAX] = {};
908 int len = sprintf_s(path, sizeof(path), "%s%s", rootPath, SANDBOX_STAMP_FILE_SUFFIX);
909 APPSPAWN_CHECK(len > 0, return false, "Failed to format path");
911 FILE *f = fopen(path, "rb");
924 char path[PATH_MAX] = {};
925 int len = sprintf_s(path, sizeof(path), "%s%s", rootPath, SANDBOX_STAMP_FILE_SUFFIX);
926 APPSPAWN_CHECK(len > 0, return 0, "Failed to format path");
928 FILE *f = fopen(path, "wb");
941 APPSPAWN_LOGV("Unmount sandbox config sandbox path %{public}s ", rootPath);
951 char path[PATH_MAX] = {};
952 int ret = BuildRootPath(path, sizeof(path), sandbox, uid / UID_BASE);
954 uint32_t rootLen = strlen(path);
961 UnmountPath(path, sizeof(path), &groupNode->depNode->sandboxNode);
962 path[rootLen] = '\0';
971 char path[PATH_MAX] = {};
972 int ret = BuildRootPath(path, sizeof(path), sandbox, uid / UID_BASE);
974 uint32_t rootLen = strlen(path);
975 APPSPAWN_LOGI("Unmount sandbox %{public}s root: %{public}s", name, path);
977 if (!IsSandboxMounted(sandbox, name, path)) {
988 UnmountPath(path, sizeof(path), sandboxNode);
989 path[rootLen] = '\0';
995 ret = strcat_s(path, sizeof(path), SANDBOX_STAMP_FILE_SUFFIX);
997 APPSPAWN_LOGI("Unmount sandbox %{public}s ", path);
998 unlink(path);
1022 * 遍历system-const, 处理mount path -- 可以清除配置
1023 * src = mount-path.src-path
1024 * dst = root-dir + mount-path.sandbox-path
1026 * 遍历name-groups,处理mount path
1029 * src = mount-path.src-path
1030 * dst = mount-path.sandbox-path --> 存在依赖时,配置<deps-path>、<deps-sandbox-path>、<deps-src-path>
1032 * src = mount-path.src-path
1033 * dst = root-dir + mount-path.sandbox-path
1065 * 是not-exist则判断mount-paths.src-path是否存在,若不存在则创建并挂载mount-paths-deps中的目录
1077 APPSPAWN_CHECK(ret == 0, return ret, "Failed to updata deps path name groups %{public}s", groupNode->section.name);
1248 * app-variabl, 处理mount path
1249 * src = mount-path.src-path
1250 * dst = root-dir + mount-path.src-path
1251 * 遍历name-groups,处理mount path
1253 * dst = mount-path.sandbox-path --> 存在依赖时,配置<deps-path>、<deps-sandbox-path>、<deps-src-path>
1255 * src = mount-path.src-path
1256 * dst = root-dir + mount-path.sandbox-path