Home | History | Annotate | Download | only in vold

Lines Matching refs:directory_path

105 static std::vector<std::string> get_ce_key_paths(const std::string& directory_path) {
106 auto dirp = std::unique_ptr<DIR, int (*)(DIR*)>(opendir(directory_path.c_str()), closedir);
108 PLOG(ERROR) << "Unable to open ce key directory: " + directory_path;
117 PLOG(ERROR) << "Unable to read ce key directory: " + directory_path;
126 result.emplace_back(directory_path + "/" + entry->d_name);
133 static std::string get_ce_key_current_path(const std::string& directory_path) {
134 return directory_path + "/current";
137 static bool get_ce_key_new_path(const std::string& directory_path,
141 *ce_key_path = get_ce_key_current_path(directory_path);
145 auto const candidate = StringPrintf("%s/cx%010u", directory_path.c_str(), i);
156 static void fixate_user_ce_key(const std::string& directory_path, const std::string &to_fix,
163 auto const current_path = get_ce_key_current_path(directory_path);
175 auto const directory_path = get_ce_key_directory_path(user_id);
176 auto const paths = get_ce_key_paths(directory_path);
181 fixate_user_ce_key(directory_path, ce_key_path, paths);
230 auto const directory_path = get_ce_key_directory_path(user_id);
231 if (!prepare_dir(directory_path, 0700, AID_ROOT, AID_ROOT)) return false;
232 auto const paths = get_ce_key_paths(directory_path);
234 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false;
237 fixate_user_ce_key(directory_path, ce_key_path, paths);
514 auto const directory_path = get_ce_key_directory_path(user_id);
515 auto const paths = get_ce_key_paths(directory_path);
517 if (!get_ce_key_new_path(directory_path, paths, &ce_key_path)) return false;
526 auto const directory_path = get_ce_key_directory_path(user_id);
527 auto const paths = get_ce_key_paths(directory_path);
532 fixate_user_ce_key(directory_path, paths[0], paths);