Lines Matching refs:path
157 static bool load_keys(const std::string& path, bool allow_dir = true) { in load_keys() argument
158 LOG(INFO) << "load_keys '" << path << "'..."; in load_keys()
161 if (stat(path.c_str(), &st) != 0) { in load_keys()
162 PLOG(ERROR) << "load_keys: failed to stat '" << path << "'"; in load_keys()
167 return load_key(path); in load_keys()
174 LOG(WARNING) << "load_keys: refusing to recurse into directory '" << path << "'"; in load_keys()
178 std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(path.c_str()), closedir); in load_keys()
180 PLOG(ERROR) << "load_keys: failed to open directory '" << path << "'"; in load_keys()
194 LOG(INFO) << "skipped non-adb_key '" << path << "/" << name << "'"; in load_keys()
198 result |= load_key((path + OS_PATH_SEPARATOR + name)); in load_keys()
203 LOG(ERROR) << "load_keys: unexpected type for '" << path << "': 0x" << std::hex << st.st_mode; in load_keys()
212 std::string path = get_user_key_path(); in load_userkey() local
213 if (path.empty()) { in load_userkey()
219 if (stat(path.c_str(), &buf) == -1) { in load_userkey()
220 LOG(INFO) << "User key '" << path << "' does not exist..."; in load_userkey()
221 if (!generate_key(path)) { in load_userkey()
227 return load_key(path); in load_userkey()
237 for (const auto& path : android::base::Split(adb_keys_path, ENV_PATH_SEPARATOR_STR)) { in get_vendor_keys() local
238 result.emplace(path); in get_vendor_keys()
281 static bool pubkey_from_privkey(std::string* out, const std::string& path) { in pubkey_from_privkey() argument
282 std::shared_ptr<RSA> privkey = read_key_file(path); in pubkey_from_privkey()
290 std::string path = get_user_key_path(); in adb_auth_get_user_privkey() local
291 if (path.empty()) { in adb_auth_get_user_privkey()
296 std::shared_ptr<RSA> rsa_privkey = read_key_file(path); in adb_auth_get_user_privkey()
312 std::string path = get_user_key_path(); in adb_auth_get_userkey() local
313 if (path.empty()) { in adb_auth_get_userkey()
319 if (!pubkey_from_privkey(&result, path)) { in adb_auth_get_userkey()
368 std::string path = root_it->second; in adb_auth_inotify_update() local
370 path += '/'; in adb_auth_inotify_update()
371 path += event->name; in adb_auth_inotify_update()
376 LOG(INFO) << "ignoring new directory at '" << path << "'"; in adb_auth_inotify_update()
378 LOG(INFO) << "observed new file at '" << path << "'"; in adb_auth_inotify_update()
379 load_keys(path, false); in adb_auth_inotify_update()
382 LOG(WARNING) << "unmonitored event for " << path << ": 0x" << std::hex in adb_auth_inotify_update()
400 for (const std::string& path : paths) { in adb_auth_inotify_init() local
401 int wd = inotify_add_watch(infd, path.c_str(), IN_CREATE | IN_MOVED_TO); in adb_auth_inotify_init()
403 PLOG(ERROR) << "failed to inotify_add_watch on path '" << path << "'"; in adb_auth_inotify_init()
407 g_monitored_paths[wd] = path; in adb_auth_inotify_init()
408 LOG(INFO) << "watch descriptor " << wd << " registered for '" << path << "'"; in adb_auth_inotify_init()
430 for (const std::string& path : key_paths) { in adb_auth_init() local
431 load_keys(path); in adb_auth_init()