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

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: do it Jim's way! 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 | no next file » | no next file with comments »
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) 2009-2010 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
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 return true; 828 return true;
829 } 829 }
830 current_user_->Reset(); 830 current_user_->Reset();
831 return false; 831 return false;
832 } 832 }
833 833
834 bool Mount::MountGuestCryptohome() const { 834 bool Mount::MountGuestCryptohome() const {
835 current_user_->Reset(); 835 current_user_->Reset();
836 836
837 // Attempt to mount guestfs 837 // Attempt to mount guestfs
838 if (!platform_->Mount("guestfs", home_dir_, "tmpfs", "")) { 838 if (!platform_->Mount("guestfs", home_dir_, "tmpfs", "mode=0700")) {
839 LOG(ERROR) << "Cryptohome mount failed: " << errno << " for guestfs"; 839 LOG(ERROR) << "Cryptohome mount failed: " << errno << " for guestfs";
840 return false; 840 return false;
841 } 841 }
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);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 if (error) { 1117 if (error) {
1118 *error = Mount::MOUNT_ERROR_KEY_FAILURE; 1118 *error = Mount::MOUNT_ERROR_KEY_FAILURE;
1119 } 1119 }
1120 return false; 1120 return false;
1121 } 1121 }
1122 1122
1123 return true; 1123 return true;
1124 } 1124 }
1125 1125
1126 } // namespace cryptohome 1126 } // namespace cryptohome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698