Commit 55e9b427 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed bug with authentication with a plain password.

parent 7c3bc740
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -217,14 +217,18 @@ class CCConf(object):
            return None

        is_valid = False

        m = CCConf.RE_SALTPW.match(passwd_conf)
        if m is None:
            is_valid = self._auth_plain(passwd_conf, password)
            meth = '_auth_plain'
            password_wo_method = passwd_conf
        else:
            meth = '_auth_%s' % m.group('method').lower()
            password_wo_method = m.group('password')

        if hasattr(self, meth):
            auth = getattr(self, meth)
                is_valid = auth(password, m.group('password')) == passwd_conf
            is_valid = auth(password, password_wo_method) == passwd_conf
        else:
            logging.warning('Bad authentication method for %s: '
                            '%s' % (login, m.group('method')))