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

Side by Side Diff: mount.cc

Issue 6895001: [cryptohome] make guest-mode homedir mount with -rwx------ (Closed) Base URL: http://git.chromium.org/git/cryptohome.git@master
Patch Set: Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | platform.h » ('j') | platform.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Contains the implementation of class Mount 5 // Contains the implementation of class Mount
6 6
7 #include "mount.h" 7 #include "mount.h"
8 8
9 #include <errno.h> 9 #include <errno.h>
10 10
11 #include <base/file_util.h> 11 #include <base/file_util.h>
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 if (set_vault_ownership_) { 842 if (set_vault_ownership_) {
843 if (!platform_->SetOwnership(home_dir_, default_user_, default_group_)) { 843 if (!platform_->SetOwnership(home_dir_, default_user_, default_group_)) {
844 LOG(ERROR) << "Couldn't change owner (" << default_user_ << ":" 844 LOG(ERROR) << "Couldn't change owner (" << default_user_ << ":"
845 << default_group_ << ") of guestfs path: " 845 << default_group_ << ") of guestfs path: "
846 << home_dir_.c_str(); 846 << home_dir_.c_str();
847 bool was_busy; 847 bool was_busy;
848 platform_->Unmount(home_dir_.c_str(), false, &was_busy); 848 platform_->Unmount(home_dir_.c_str(), false, &was_busy);
849 return false; 849 return false;
850 } 850 }
851 } 851 }
852 if (!platform_->SetPermissions(home_dir_, S_IRUSR | S_IWUSR | S_IXUSR))
Will Drewry 2011/04/21 21:42:09 Doesn't this need to call platform_->Unmount if it
853 return false;
852 CopySkeleton(); 854 CopySkeleton();
853 return true; 855 return true;
854 } 856 }
855 857
856 string Mount::GetUserDirectory(const Credentials& credentials) const { 858 string Mount::GetUserDirectory(const Credentials& credentials) const {
857 return StringPrintf("%s/%s", 859 return StringPrintf("%s/%s",
858 shadow_root_.c_str(), 860 shadow_root_.c_str(),
859 credentials.GetObfuscatedUsername(system_salt_).c_str()); 861 credentials.GetObfuscatedUsername(system_salt_).c_str());
860 } 862 }
861 863
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 if (error) { 1119 if (error) {
1118 *error = Mount::MOUNT_ERROR_KEY_FAILURE; 1120 *error = Mount::MOUNT_ERROR_KEY_FAILURE;
1119 } 1121 }
1120 return false; 1122 return false;
1121 } 1123 }
1122 1124
1123 return true; 1125 return true;
1124 } 1126 }
1125 1127
1126 } // namespace cryptohome 1128 } // namespace cryptohome
OLDNEW
« no previous file with comments | « no previous file | platform.h » ('j') | platform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698