Show $ADB_VENDOR_KEYS if authentication fails.
Incorrectly set $ADB_VENDOR_KEYS is the most likely cause of failed
adb connections. Make it easier to debug such problems by including
the value in use in the error message.
Bug: 20165551
Change-Id: I64c1d98ae6d3fb40eea9e1f0ddcfcf4f2d9d7318
diff --git a/adb/sockets.cpp b/adb/sockets.cpp
index 48d02d6..e52d6b1 100644
--- a/adb/sockets.cpp
+++ b/adb/sockets.cpp
@@ -827,12 +827,11 @@
}
#else /* !ADB_HOST */
if (s->transport == NULL) {
- const char* error_string = "unknown failure";
- s->transport = acquire_one_transport (CS_ANY,
- kTransportAny, NULL, &error_string);
+ std::string error_msg = "unknown failure";
+ s->transport = acquire_one_transport(CS_ANY, kTransportAny, NULL, &error_msg);
if (s->transport == NULL) {
- sendfailmsg(s->peer->fd, error_string);
+ sendfailmsg(s->peer->fd, error_msg.c_str());
goto fail;
}
}