commit | 1b1e2f5332e22cafe6ea2402a16d9edd82eae0db | [log] [tgz] |
---|---|---|
author | Kelvin Zhang <zhangkelvin@google.com> | Tue Dec 01 19:03:37 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Dec 01 19:03:37 2020 +0000 |
tree | 4a8436639e8d7356c53df9c9696304788c2ebc83 | |
parent | bca33e1e9b9ccbddb6007bdcd2b9122a3bf8a8dc [diff] | |
parent | 4ce01107651dd3418279fb6aae2193d298cfc96a [diff] |
Check if mount directory exists before attempting mount() syscall am: 4ce0110765 Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1507100 Change-Id: I324fc4d39d884341eda604e6392e6a5055c381a7
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc index bd49639..37a8577 100644 --- a/payload_consumer/postinstall_runner_action.cc +++ b/payload_consumer/postinstall_runner_action.cc
@@ -143,6 +143,11 @@ fs_mount_dir_ = temp_dir.value(); #endif // __ANDROID__ + if (!utils::FileExists(fs_mount_dir_.c_str())) { + LOG(ERROR) << "Mount point " << fs_mount_dir_ + << " does not exist, mount call will fail"; + return CompletePostinstall(ErrorCode::kPostinstallRunnerError); + } // Double check that the fs_mount_dir is not busy with a previous mounted // filesystem from a previous crashed postinstall step. if (utils::IsMountpoint(fs_mount_dir_)) {