()
Gets the current user's login keychain and updates login_keychain.
Gets the current user's login keychain and updates login_keychain.
Gets the current user s login keychain and updates login_keychain .
def LoginKeychain():
  """Gets the current user's login keychain and updates login_keychain."""
  global login_keychain  # pylint: disable=global-statement
  if os.uname()[0] == 'Linux':
    return
  if os.getuid() == 0:
    logging.debug('Root has no access to login keychain.')
    return
  stdout, stderr, rc = gmacpyutil.RunProcess([CMD_SECURITY, 'login-keychain'])
  if rc == 0:
    login_keychain = stdout.strip(' \n"')
  else:
    logging.error('Unable to determine login keychain: %s', stderr)
    login_keychain = None
def LoginKeychain ( ) : global login_keychain # pylint: disable=global-statement if os . uname ( ) [ 0 ] == 'Linux' : return if os . getuid ( ) == 0 : logging . debug ( 'Root has no access to login keychain.' ) return stdout , stderr , rc = gmacpyutil . RunProcess ( [ CMD_SECURITY , 'login-keychain' ] ) if rc == 0 : login_keychain = stdout . strip ( ' \n"' ) else : logging . error ( 'Unable to determine login keychain: %s' , stderr ) login_keychain = None