Lines Matching refs:path

132 int create_pkg_path(char path[PKG_PATH_MAX], const char *pkgname,  in create_pkg_path()
135 path[0] = '\0'; in create_pkg_path()
142 path[0] = '\0'; in create_pkg_path()
145 strcpy(path, tmp); in create_pkg_path()
215 return StringPrintf("%s/cur/%u", android_profiles_dir.path, userid); in create_primary_cur_profile_dir_path()
226 return StringPrintf("%s/ref", android_profiles_dir.path); in create_primary_ref_profile_dir_path()
231 return StringPrintf("%s/ref/%s", android_profiles_dir.path, package_name.c_str()); in create_primary_reference_profile_package_dir_path()
278 std::string path(create_data_path(volume_uuid) + "/" + SECONDARY_USER_PREFIX); in get_known_users() local
279 DIR* dir = opendir(path.c_str()); in get_known_users()
282 PLOG(ERROR) << "Failed to opendir " << path; in get_known_users()
304 int calculate_tree_size(const std::string& path, int64_t* size, in calculate_tree_size() argument
309 char *argv[] = { (char*) path.c_str(), nullptr }; in calculate_tree_size()
312 PLOG(ERROR) << "Failed to fts_open " << path; in calculate_tree_size()
347 LOG(DEBUG) << "Measured " << path << " size " << matchedSize; in calculate_tree_size()
349 LOG(DEBUG) << "Measured " << path << " size " << matchedSize << "; include " << include_gid in calculate_tree_size()
357 int create_move_path(char path[PKG_PATH_MAX], in create_move_path()
367 sprintf(path, "%s%s%s/%s", android_data_dir.path, PRIMARY_USER_PREFIX, pkgname, leaf); in create_move_path()
642 int get_path_inode(const std::string& path, ino_t *inode) { in get_path_inode() argument
645 if (stat(path.c_str(), &buf) != 0) { in get_path_inode()
646 PLOG(WARNING) << "Failed to stat " << path; in get_path_inode()
662 auto path = StringPrintf("%s/%s", parent.c_str(), name); in write_path_inode() local
664 if (get_path_inode(path, &inode) != 0) { in write_path_inode()
740 static int validate_path(const dir_rec_t* dir, const char* path, int maxSubdirs) { in validate_path() argument
742 const char* subdir = strchr(path + dir_len, '/'); in validate_path()
748 ALOGE("invalid apk path '%s' (subdir?)\n", path); in validate_path()
754 if ((path[dir_len] == '.') || ((subdir != NULL) && (*subdir == '.'))) { in validate_path()
755 ALOGE("invalid apk path '%s' (trickery)\n", path); in validate_path()
766 int validate_system_app_path(const char* path) { in validate_system_app_path() argument
771 if (!strncmp(path, android_system_dirs.dirs[i].path, dir_len)) { in validate_system_app_path()
772 return validate_path(android_system_dirs.dirs + i, path, 1); in validate_system_app_path()
806 const char* path = getenv(var); in get_path_from_env() local
807 int ret = get_path_from_string(rec, path); in get_path_from_env()
821 int get_path_from_string(dir_rec_t* rec, const char* path) { in get_path_from_string() argument
822 if (path == NULL) { in get_path_from_string()
825 const size_t path_len = strlen(path); in get_path_from_string()
831 if (path[0] != '/') { in get_path_from_string()
835 if (path[path_len - 1] == '/') { in get_path_from_string()
838 rec->path = strdup(path); in get_path_from_string()
839 if (rec->path == NULL) { in get_path_from_string()
851 rec->path = (char*) malloc(dst_size); in get_path_from_string()
852 if (rec->path == NULL) { in get_path_from_string()
856 dst = rec->path; in get_path_from_string()
858 if (append_and_increment(&dst, path, &dst_size) < 0 in get_path_from_string()
864 rec->len = dst - rec->path; in get_path_from_string()
873 dst->path = (char*) malloc(dstSize); in copy_and_append()
875 if (dst->path == NULL in copy_and_append()
876 || snprintf(dst->path, dstSize, "%s%s", src->path, suffix) in copy_and_append()
891 static int validate_apk_path_internal(const char *path, int maxSubdirs) { in validate_apk_path_internal() argument
893 if (!strncmp(path, android_app_dir.path, android_app_dir.len)) { in validate_apk_path_internal()
895 } else if (!strncmp(path, android_app_private_dir.path, android_app_private_dir.len)) { in validate_apk_path_internal()
897 } else if (!strncmp(path, android_app_ephemeral_dir.path, android_app_ephemeral_dir.len)) { in validate_apk_path_internal()
899 } else if (!strncmp(path, android_asec_dir.path, android_asec_dir.len)) { in validate_apk_path_internal()
901 } else if (!strncmp(path, android_mnt_expand_dir.path, android_mnt_expand_dir.len)) { in validate_apk_path_internal()
910 return validate_path(dir, path, maxSubdirs); in validate_apk_path_internal()
913 int validate_apk_path(const char* path) { in validate_apk_path() argument
914 return validate_apk_path_internal(path, 1 /* maxSubdirs */); in validate_apk_path()
917 int validate_apk_path_subdirs(const char* path) { in validate_apk_path_subdirs() argument
918 return validate_apk_path_internal(path, 3 /* maxSubdirs */); in validate_apk_path_subdirs()
969 auto path = create_data_misc_legacy_path(userid); in ensure_config_user_dirs() local
970 return fs_prepare_dir(path.c_str(), 0750, uid, gid); in ensure_config_user_dirs()
1006 auto path = StringPrintf("%s/%s", parent.c_str(), name); in prepare_app_cache_dir() local
1008 if (stat(path.c_str(), &st) != 0) { in prepare_app_cache_dir()
1011 if (fs_prepare_dir_strict(path.c_str(), target_mode, uid, gid) != 0) { in prepare_app_cache_dir()
1012 PLOG(ERROR) << "Failed to prepare " << path; in prepare_app_cache_dir()
1018 PLOG(ERROR) << "Failed to stat " << path; in prepare_app_cache_dir()
1026 LOG(ERROR) << "Mismatched UID at " << path << ": found " << st.st_uid in prepare_app_cache_dir()
1034 LOG(DEBUG) << "Mismatched cache GID/mode at " << path << ": found " << st.st_gid in prepare_app_cache_dir()
1042 char *argv[] = { (char*) path.c_str(), nullptr }; in prepare_app_cache_dir()
1044 PLOG(ERROR) << "Failed to fts_open " << path; in prepare_app_cache_dir()