Lines Matching refs:directory_path
128 static std::vector<std::string> get_ce_key_paths(const std::string& directory_path) { in get_ce_key_paths() argument
129 auto dirp = std::unique_ptr<DIR, int (*)(DIR*)>(opendir(directory_path.c_str()), closedir); in get_ce_key_paths()
131 PLOG(ERROR) << "Unable to open ce key directory: " + directory_path; in get_ce_key_paths()
140 PLOG(ERROR) << "Unable to read ce key directory: " + directory_path; in get_ce_key_paths()
150 result.emplace_back(directory_path + "/" + entry->d_name); in get_ce_key_paths()
157 static std::string get_ce_key_current_path(const std::string& directory_path) { in get_ce_key_current_path() argument
158 return directory_path + "/current"; in get_ce_key_current_path()
161 static bool get_ce_key_new_path(const std::string& directory_path, in get_ce_key_new_path() argument
164 *ce_key_path = get_ce_key_current_path(directory_path); in get_ce_key_new_path()
168 auto const candidate = StringPrintf("%s/cx%010u", directory_path.c_str(), i); in get_ce_key_new_path()
179 static void fixate_user_ce_key(const std::string& directory_path, const std::string& to_fix, in fixate_user_ce_key() argument
186 auto const current_path = get_ce_key_current_path(directory_path); in fixate_user_ce_key()
191 android::vold::FsyncDirectory(directory_path); in fixate_user_ce_key()
197 auto const directory_path = get_ce_key_directory_path(user_id); in read_and_fixate_user_ce_key() local
198 auto const paths = get_ce_key_paths(directory_path); in read_and_fixate_user_ce_key()
203 fixate_user_ce_key(directory_path, ce_key_path, paths); in read_and_fixate_user_ce_key()
340 auto const directory_path = get_ce_key_directory_path(user_id); in create_and_install_user_keys() local
341 if (!prepare_dir(directory_path, 0700, AID_ROOT, AID_ROOT)) return false; in create_and_install_user_keys()
342 auto const paths = get_ce_key_paths(directory_path); in create_and_install_user_keys()
344 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false; in create_and_install_user_keys()
348 fixate_user_ce_key(directory_path, ce_key_path, paths); in create_and_install_user_keys()
691 auto const directory_path = get_ce_key_directory_path(user_id); in fscrypt_rewrap_user_key() local
693 std::string ce_key_current_path = get_ce_key_current_path(directory_path); in fscrypt_rewrap_user_key()
705 auto const paths = get_ce_key_paths(directory_path); in fscrypt_rewrap_user_key()
707 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false; in fscrypt_rewrap_user_key()
733 auto const directory_path = get_ce_key_directory_path(user_id); in fscrypt_fixate_newest_user_key_auth() local
734 auto const paths = get_ce_key_paths(directory_path); in fscrypt_fixate_newest_user_key_auth()
739 fixate_user_ce_key(directory_path, paths[0], paths); in fscrypt_fixate_newest_user_key_auth()
995 static bool destroy_volume_keys(const std::string& directory_path, const std::string& volume_uuid) { in destroy_volume_keys() argument
996 auto dirp = std::unique_ptr<DIR, int (*)(DIR*)>(opendir(directory_path.c_str()), closedir); in destroy_volume_keys()
998 PLOG(ERROR) << "Unable to open directory: " + directory_path; in destroy_volume_keys()
1007 PLOG(ERROR) << "Unable to read directory: " + directory_path; in destroy_volume_keys()
1017 res &= destroy_volkey(directory_path + "/" + entry->d_name, volume_uuid); in destroy_volume_keys()