Don't fail if a key we want to delete is already deleted

This can happen when cleaning up stale users at boot time.

Bug: 30158800
Change-Id: I2733d8d525fc79b7f05eb2225b7e6e14c4da277f
This commit is contained in:
Paul Crowley 2016-07-19 15:29:53 -07:00
parent abc253884f
commit ab0b56aef3

View file

@ -534,7 +534,12 @@ bool e4crypt_destroy_user_key(userid_t user_id) {
for (auto const path: get_ce_key_paths(get_ce_key_directory_path(user_id))) {
success &= android::vold::destroyKey(path);
}
success &= android::vold::destroyKey(get_de_key_path(user_id));
auto de_key_path = get_de_key_path(user_id);
if (path_exists(de_key_path)) {
success &= android::vold::destroyKey(de_key_path);
} else {
LOG(INFO) << "Not present so not erasing: " << de_key_path;
}
}
return success;
}