OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |