Lines Matching refs:directory_path

186 static std::vector<std::string> get_ce_key_paths(const std::string& directory_path) {  in get_ce_key_paths()  argument
187 auto dirp = std::unique_ptr<DIR, int (*)(DIR*)>(opendir(directory_path.c_str()), closedir); in get_ce_key_paths()
189 PLOG(ERROR) << "Unable to open ce key directory: " + directory_path; in get_ce_key_paths()
198 PLOG(ERROR) << "Unable to read ce key directory: " + directory_path; in get_ce_key_paths()
207 result.emplace_back(directory_path + "/" + entry->d_name); in get_ce_key_paths()
214 static std::string get_ce_key_current_path(const std::string& directory_path) { in get_ce_key_current_path() argument
215 return directory_path + "/current"; in get_ce_key_current_path()
218 static bool get_ce_key_new_path(const std::string& directory_path, in get_ce_key_new_path() argument
222 *ce_key_path = get_ce_key_current_path(directory_path); in get_ce_key_new_path()
226 auto const candidate = StringPrintf("%s/cx%010u", directory_path.c_str(), i); in get_ce_key_new_path()
237 static void fixate_user_ce_key(const std::string& directory_path, const std::string &to_fix, in fixate_user_ce_key() argument
244 auto const current_path = get_ce_key_current_path(directory_path); in fixate_user_ce_key()
256 auto const directory_path = get_ce_key_directory_path(user_id); in read_and_fixate_user_ce_key() local
257 auto const paths = get_ce_key_paths(directory_path); in read_and_fixate_user_ce_key()
262 fixate_user_ce_key(directory_path, ce_key_path, paths); in read_and_fixate_user_ce_key()
342 auto const directory_path = get_ce_key_directory_path(user_id); in create_and_install_user_keys() local
343 if (!prepare_dir(directory_path, 0700, AID_ROOT, AID_ROOT)) return false; in create_and_install_user_keys()
344 auto const paths = get_ce_key_paths(directory_path); in create_and_install_user_keys()
346 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false; in create_and_install_user_keys()
349 fixate_user_ce_key(directory_path, ce_key_path, paths); in create_and_install_user_keys()
645 auto const directory_path = get_ce_key_directory_path(user_id); in e4crypt_add_user_key_auth() local
646 auto const paths = get_ce_key_paths(directory_path); in e4crypt_add_user_key_auth()
648 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false; in e4crypt_add_user_key_auth()
657 auto const directory_path = get_ce_key_directory_path(user_id); in e4crypt_fixate_newest_user_key_auth() local
658 auto const paths = get_ce_key_paths(directory_path); in e4crypt_fixate_newest_user_key_auth()
663 fixate_user_ce_key(directory_path, paths[0], paths); in e4crypt_fixate_newest_user_key_auth()