Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: mount.cc

Issue 6598009: Deprecating tracked_directories as a Vault parameter (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cryptohome.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mount.h ('k') | mount_unittest.cc » ('j') | service.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mount.cc
diff --git a/mount.cc b/mount.cc
index 7c23e5d16faa68ee0ce7ee8653f0e6fed827fe04..9f69d2593ed17b938b3a865585c7733afe39766e 100644
--- a/mount.cc
+++ b/mount.cc
@@ -235,15 +235,6 @@ bool Mount::MountCryptohomeInner(const Credentials& credentials,
return false;
}
- // TODO(glotov): the following code is deprecated. Remove it.
- if (mount_args.replace_tracked_subdirectories) {
- if (ReplaceTrackedSubdirectories(mount_args.tracked_subdirectories,
- &serialized)) {
- // If the tracked subdirectories changed, re-save the vault keyset
- StoreVaultKeyset(credentials, serialized);
- }
- }
-
crypto_->ClearKeyset();
// Add the decrypted key to the keyring so that ecryptfs can use it
@@ -364,11 +355,10 @@ bool Mount::CreateCryptohome(const Credentials& credentials,
FilePath user_dir(GetUserDirectory(credentials));
file_util::CreateDirectory(user_dir);
- // Generat a new master key
+ // Generate a new master key
VaultKeyset vault_keyset;
vault_keyset.CreateRandom(*this);
SerializedVaultKeyset serialized;
- ReplaceTrackedSubdirectories(mount_args.tracked_subdirectories, &serialized);
if (!AddVaultKeyset(credentials, vault_keyset, &serialized)) {
platform_->SetMask(original_mask);
return false;
@@ -488,38 +478,6 @@ bool Mount::CreateTrackedSubdirectories(const Credentials& credentials,
return result;
}
-bool Mount::ReplaceTrackedSubdirectories(
- const std::vector<std::string>& tracked_subdirectories,
- SerializedVaultKeyset* serialized) const {
- std::set<std::string> existing;
- for (int index = 0; index < serialized->tracked_subdirectories_size();
- ++index) {
- existing.insert(serialized->tracked_subdirectories(index));
- }
- bool new_exists = false;
- for (std::vector<std::string>::const_iterator itr =
- tracked_subdirectories.begin();
- itr != tracked_subdirectories.end();
- ++itr) {
- if (!existing.erase(*itr)) {
- new_exists = true;
- }
- }
- // If there are any subdirectories that were in one set but not the other,
- // then we need to replace
- if (existing.size() || new_exists) {
- serialized->clear_tracked_subdirectories();
- for (std::vector<std::string>::const_iterator itr =
- tracked_subdirectories.begin();
- itr != tracked_subdirectories.end();
- ++itr) {
- serialized->add_tracked_subdirectories(*itr);
- }
- return true;
- }
- return false;
-}
-
void Mount::CleanUnmountedTrackedSubdirectories() const {
FilePath shadow_root(shadow_root_);
file_util::FileEnumerator dir_enumerator(shadow_root, false,
« no previous file with comments | « mount.h ('k') | mount_unittest.cc » ('j') | service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698