summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Inseob Kim <inseob@google.com> 2024-08-28 17:21:27 +0900
committer Inseob Kim <inseob@google.com> 2024-08-29 12:50:01 +0900
commit4b9fcd9d8a7efdb1ce77c5ba18b2289cfff0ca9a (patch)
tree58523f7348d456cbe515af516d09190bff861a44
parent5a74561a2b3d7d58a3e0034629b2eee277dfae20 (diff)
Move adb_keys to product partition
/adb_keys will be moved to /product/etc/security as it's a product-specific file. To prevent regression, /adb_keys will be a symlink to the new location. Bug: 353430323 Test: boot and connect adb with ADB_VENDOR_KEYS Change-Id: Iaec1acfa5e8e758058fabf2ec0edd85bd64e7700
-rw-r--r--libs/adbd_auth/adbd_auth.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/adbd_auth/adbd_auth.cpp b/libs/adbd_auth/adbd_auth.cpp
index 78896ed553..d31cb3dff0 100644
--- a/libs/adbd_auth/adbd_auth.cpp
+++ b/libs/adbd_auth/adbd_auth.cpp
@@ -390,13 +390,16 @@ public:
}
}
- static constexpr const char* key_paths[] = {"/adb_keys", "/data/misc/adb/adb_keys"};
+ static constexpr std::pair<const char*, bool> key_paths[] = {
+ {"/adb_keys", true /* follow symlinks */ },
+ {"/data/misc/adb/adb_keys", false /* don't follow symlinks */ },
+ };
void IteratePublicKeys(bool (*callback)(void*, const char*, size_t), void* opaque) {
- for (const auto& path : key_paths) {
+ for (const auto& [path, follow_symlinks] : key_paths) {
if (access(path, R_OK) == 0) {
LOG(INFO) << "adbd_auth: loading keys from " << path;
std::string content;
- if (!android::base::ReadFileToString(path, &content)) {
+ if (!android::base::ReadFileToString(path, &content, follow_symlinks)) {
PLOG(ERROR) << "adbd_auth: couldn't read " << path;
continue;
}