equal
deleted
inserted
replaced
287 pwd = rset[0][0] |
287 pwd = rset[0][0] |
288 except IndexError: |
288 except IndexError: |
289 raise AuthenticationError('bad login') |
289 raise AuthenticationError('bad login') |
290 # passwords are stored using the Bytes type, so we get a StringIO |
290 # passwords are stored using the Bytes type, so we get a StringIO |
291 if pwd is not None: |
291 if pwd is not None: |
292 args['pwd'] = crypt_password(password, pwd.getvalue()[:2]) |
292 args['pwd'] = Binary(crypt_password(password, pwd.getvalue()[:2])) |
293 # get eid from login and (crypted) password |
293 # get eid from login and (crypted) password |
|
294 # XXX why not simply compare password? |
294 rset = self.syntax_tree_search(session, self._auth_rqlst, args) |
295 rset = self.syntax_tree_search(session, self._auth_rqlst, args) |
295 try: |
296 try: |
296 return rset[0][0] |
297 return rset[0][0] |
297 except IndexError: |
298 except IndexError: |
298 raise AuthenticationError('bad password') |
299 raise AuthenticationError('bad password') |