diff options
| author | 2024-08-30 01:12:46 +0000 | |
|---|---|---|
| committer | 2024-08-30 01:12:46 +0000 | |
| commit | babe78168543c711b1faef8ab078e5916632b49f (patch) | |
| tree | b6c56de516b028f93345b6951e9bd852c34a7f0d | |
| parent | aea255c630aa86769c172e0f5c587ca4e5e897ce (diff) | |
| parent | cdca5ed76e491039f1ac9500731d1dc795c0d783 (diff) | |
Merge "Move adb_keys to product partition" into main am: cdca5ed76e
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3244206
Change-Id: I002ca7362fc27cb562fc04e6bb7ee813a42a9ce5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/adbd_auth/adbd_auth.cpp | 9 |
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; } |