server/sources/native.py
changeset 8349 fdb796435d7b
parent 8265 9747ab9230ad
parent 8317 9c59258e7798
child 8381 a682f5cb73f6
equal deleted inserted replaced
8340:622fcca4fe00 8349:fdb796435d7b
  1624                 raise AuthenticationError('bad login')
  1624                 raise AuthenticationError('bad login')
  1625             if pwd is None:
  1625             if pwd is None:
  1626                 # if pwd is None but a password is provided, something is wrong
  1626                 # if pwd is None but a password is provided, something is wrong
  1627                 raise AuthenticationError('bad password')
  1627                 raise AuthenticationError('bad password')
  1628             # passwords are stored using the Bytes type, so we get a StringIO
  1628             # passwords are stored using the Bytes type, so we get a StringIO
  1629             args['pwd'] = Binary(crypt_password(password, pwd.getvalue()[:2]))
  1629             args['pwd'] = Binary(crypt_password(password, pwd.getvalue()))
  1630         # get eid from login and (crypted) password
  1630         # get eid from login and (crypted) password
  1631         rset = self.source.syntax_tree_search(session, self._auth_rqlst, args)
  1631         rset = self.source.syntax_tree_search(session, self._auth_rqlst, args)
  1632         try:
  1632         try:
  1633             return rset[0][0]
  1633             return rset[0][0]
  1634         except IndexError:
  1634         except IndexError: