Add flag for requesting an ephemeral mount

This CL adds a flag that allows Chrome to request an ephemeral mount for
a user. If the flag is set, a cryptohome backed by tmpfs will always be
mounted, even if a regular vault exists for the user.

This functionality is required for public accounts that look like regular
accounts to cryptohomed otherwise but whose cryptohomes must always be
ephemeral.

Adding a new flag to cryptohomed's Mount() and AsyncMount() dbus methods
would change the method signatures, requiring Chrome to be atomically
updated to the new signatures as well. Since an atomic change in
cryptohomed and Chrome is not possible, the CL replaces the obsolete
|replace_tracked_subdirectories| flag with the new |ensure_ephemeral|
flag instead. This is safe because the obsolete flag has been unused for
quite some time, is completely ignored by cryptohomed and always set to
|false| by Chrome. Thus, the new flag is effectively introduced in two
steps:

1/ Replace |replace_tracked_subdirectories| with |ensure_ephemeral| on the
   cryptohomed side (this CL). Cryptohomed starts honoring the new flag
   but since Chrome has not been updated yet, it will always set the flag
   to |false|, yielding the previous, non-ephemeral behavior.
2/ Update Chrome to set the |ensure_ephemeral| flag to |true| for public
   account users (a separate CL).

BUG=chromium-os:36892
TEST=new tests in mount_unittest.cc
Change-Id: Ic323271e3a38b979c6b5fe3e2f6bcb30af64add1
Reviewed-on: https://gerrit.chromium.org/gerrit/38995
Commit-Ready: Bartosz Fabianowski <bartfab@chromium.org>
Reviewed-by: Bartosz Fabianowski <bartfab@chromium.org>
Tested-by: Bartosz Fabianowski <bartfab@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
9 files changed
tree: b5b0f3cd28ac5e4a61c53a9b64cbbe83486ad224
  1. etc/
  2. share/
  3. attestation.cc
  4. attestation.h
  5. attestation.proto
  6. attestation_unittest.cc
  7. common.mk
  8. credentials.h
  9. crypto.cc
  10. crypto.h
  11. crypto_unittest.cc
  12. cryptohome-path.cc
  13. cryptohome.cc
  14. cryptohome.xml
  15. cryptohome_common.h
  16. cryptohome_event_source.cc
  17. cryptohome_event_source.h
  18. cryptohome_event_source_unittest.cc
  19. cryptohome_testrunner.cc
  20. cryptohomed.cc
  21. cryptolib.cc
  22. cryptolib.h
  23. email_to_image
  24. homedirs.cc
  25. homedirs.h
  26. homedirs_unittest.cc
  27. inherit-review-settings-ok
  28. install_attributes.cc
  29. install_attributes.h
  30. install_attributes.proto
  31. install_attributes_unittest.cc
  32. interface.cc
  33. interface.h
  34. LICENSE
  35. lockbox.cc
  36. lockbox.h
  37. lockbox_unittest.cc
  38. make_tests.cc
  39. make_tests.h
  40. make_tests.sh
  41. Makefile
  42. marshal.list
  43. mock_homedirs.h
  44. mock_install_attributes.h
  45. mock_lockbox.h
  46. mock_mount.h
  47. mock_platform.h
  48. mock_tpm.h
  49. mock_user_session.h
  50. mount.cc
  51. mount.h
  52. mount_stack.cc
  53. mount_stack.h
  54. mount_stack_unittest.cc
  55. mount_task.cc
  56. mount_task.h
  57. mount_task_unittest.cc
  58. mount_unittest.cc
  59. OWNERS
  60. pam_mount.conf.xml
  61. pkcs11_init.cc
  62. pkcs11_init.h
  63. platform.cc
  64. platform.h
  65. README
  66. README.dbus
  67. README.homedirs
  68. README.lockbox
  69. README.tpm
  70. service.cc
  71. service.h
  72. service_unittest.cc
  73. stateful_recovery.cc
  74. stateful_recovery.h
  75. stateful_recovery_unittest.cc
  76. tpm.cc
  77. tpm.h
  78. tpm_init.cc
  79. tpm_init.h
  80. tpm_status.proto
  81. user_oldest_activity_timestamp_cache.cc
  82. user_oldest_activity_timestamp_cache.h
  83. user_oldest_activity_timestamp_cache_unittest.cc
  84. user_session.cc
  85. user_session.h
  86. user_session_unittest.cc
  87. username_passkey.cc
  88. username_passkey.h
  89. username_passkey_unittest.cc
  90. vault_keyset.cc
  91. vault_keyset.h
  92. vault_keyset.proto
  93. vault_keyset_unittest.cc
  94. WATCHLISTS