From 2712192e12eef1ffa64bbc7bbf2a4034900731af Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 27 Jul 2018 16:06:24 -0700 Subject: [PATCH] adbd: fix check of `remount -R`. The check was accidentally flipped when refactoring from strcmp to std::string::operator==, inverting the behavior of `remount -R`. Test: `adb remount` with verity enabled Change-Id: Ib43889f1f4cc2f8fe1fd5d6e17e47d538dbe91bd --- adb/daemon/remount_service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/daemon/remount_service.cpp b/adb/daemon/remount_service.cpp index 76a1452a0..658858717 100644 --- a/adb/daemon/remount_service.cpp +++ b/adb/daemon/remount_service.cpp @@ -216,7 +216,7 @@ static void reboot_for_remount(int fd, bool need_fsck) { } void remount_service(unique_fd fd, const std::string& cmd) { - bool user_requested_reboot = cmd != "-R"; + bool user_requested_reboot = cmd == "-R"; if (getuid() != 0) { WriteFdExactly(fd.get(), "Not running as root. Try \"adb root\" first.\n");