Lines Matching full:user

25 def get_user_hash(user):  argument
26 """Get the user hash for the given user."""
28 '--user=%s' % user])
31 def user_path(user): argument
32 """Get the user mount point for the given user."""
33 return utils.system_output(['cryptohome-path', 'user', user])
36 def system_path(user): argument
37 """Get the system mount point for the given user."""
38 return utils.system_output(['cryptohome-path', 'system', user])
41 def ensure_clean_cryptohome_for(user, password=None): argument
42 """Ensure a fresh cryptohome exists for user.
44 @param user: user who needs a shiny new cryptohome.
49 remove_vault(user)
50 mount_vault(user, password, create=True)
176 def remove_vault(user): argument
177 """Remove the given user's vault from the shadow directory."""
178 logging.debug('user is %s', user)
179 user_hash = get_user_hash(user)
180 logging.debug('Removing vault for user %s with hash %s' % (user, user_hash))
181 cmd = CRYPTOHOME_CMD + ' --action=remove --force --user=%s' % user
185 raise ChromiumOSError('Cryptohome could not remove the user\'s vault.')
196 logging.debug('Removing vault for user with hash %s' % item)
200 def mount_vault(user, password, create=False): argument
201 """Mount the given user's vault."""
202 args = [CRYPTOHOME_CMD, '--action=mount', '--user=%s' % user,
208 user_hash = get_user_hash(user)
213 user=user,
220 """Mount the given user's vault."""
228 def test_auth(user, password): argument
229 cmd = [CRYPTOHOME_CMD, '--action=test_auth', '--user=%s' % user,
234 def unmount_vault(user): argument
235 """Unmount the given user's vault.
237 Once unmounting for a specific user is supported, the user parameter will
238 name the target user. See crosbug.com/20778.
242 if is_vault_mounted(user, allow_fail=True):
243 raise ChromiumOSError('Cryptohome did not unmount the user.')
262 def __get_user_mount_info(user, allow_fail=False): argument
263 """Get information about the active mounts for a given user.
265 Returns the active mounts at the user's user and system mount points. If no
266 user is given, the active mount at the shared mount point is returned
268 compatibility; the guest user has a mount at this mount point only).
270 return [__get_mount_info(mount_point=user_path(user),
272 __get_mount_info(mount_point=system_path(user),
276 user, argument
280 """Check whether a vault is mounted for the given user.
282 If no user is given, the shared mount point is checked, determining whether
283 a vault is mounted for any user.
285 user_mount_info = __get_user_mount_info(user=user, allow_fail=allow_fail)
295 """Check whether a vault backed by tmpfs is mounted for the guest user."""
297 user=GUEST_USER_NAME,
303 def get_mounted_vault_devices(user, allow_fail=False): argument
304 """Get the device(s) backing the vault mounted for the given user.
306 Returns the devices mounted at the user's user and system mount points. If
307 no user is given, the device mounted at the shared mount point is returned.
311 in __get_user_mount_info(user=user, allow_fail=allow_fail)
437 def mount(self, user, password, create=False, async=True): argument
441 TODO(ellyjones): Migrate mount_vault() to use a multi-user-safe
445 return self.__async_call(self.iface.AsyncMount, user, password,
447 out = self.__call(self.iface.Mount, user, password, create, False, [])
452 def unmount(self, user): argument
456 TODO(ellyjones): Once there's a per-user unmount method, use it. See
462 def is_mounted(self, user): argument
463 """Tests whether a user's cryptohome is mounted."""
464 return (utils.is_mountpoint(user_path(user))
465 and utils.is_mountpoint(system_path(user)))
468 def require_mounted(self, user): argument
469 """Raises a test failure if a user's cryptohome is not mounted."""
470 utils.require_mountpoint(user_path(user))
471 utils.require_mountpoint(system_path(user))
474 def migrate(self, user, oldkey, newkey, async=True): argument
475 """Migrates the specified user's cryptohome from one key to another."""
478 user, oldkey, newkey)['return_status']
479 return self.__call(self.iface.MigrateKey, user, oldkey, newkey)
482 def remove(self, user, async=True): argument
485 user)['return_status']
486 return self.__call(self.iface.Remove, user)
489 def ensure_clean_cryptohome_for(self, user, password=None): argument
490 """Ensure a fresh cryptohome exists for user.
492 @param user: user who needs a shiny new cryptohome.
497 self.remove(user)
498 self.mount(user, password, create=True)