Skip to content

Commit cdca5ed

Browse files
iskim517Gerrit Code Review
authored andcommitted
Merge "Move adb_keys to product partition" into main
2 parents 5532466 + 4b9fcd9 commit cdca5ed

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

libs/adbd_auth/adbd_auth.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,16 @@ struct AdbdAuthContext {
390390
}
391391
}
392392

393-
static constexpr const char* key_paths[] = {"/adb_keys", "/data/misc/adb/adb_keys"};
393+
static constexpr std::pair<const char*, bool> key_paths[] = {
394+
{"/adb_keys", true /* follow symlinks */ },
395+
{"/data/misc/adb/adb_keys", false /* don't follow symlinks */ },
396+
};
394397
void IteratePublicKeys(bool (*callback)(void*, const char*, size_t), void* opaque) {
395-
for (const auto& path : key_paths) {
398+
for (const auto& [path, follow_symlinks] : key_paths) {
396399
if (access(path, R_OK) == 0) {
397400
LOG(INFO) << "adbd_auth: loading keys from " << path;
398401
std::string content;
399-
if (!android::base::ReadFileToString(path, &content)) {
402+
if (!android::base::ReadFileToString(path, &content, follow_symlinks)) {
400403
PLOG(ERROR) << "adbd_auth: couldn't read " << path;
401404
continue;
402405
}

0 commit comments

Comments
 (0)