Core: in LDAP authenticator, don't try database auth with blank password
authorBen Rosser <rosser.bjr@gmail.com>
Thu, 14 Feb 2019 16:28:02 +0000 (11:28 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 31 May 2019 14:54:43 +0000 (16:54 +0200)
commit45645a28bdc5b6c1052b3e4cebf8cc80832d205a
treecbb399474db659aba89955b3aa9d1ab764239f66
parent8efbb2ef22f5f007b5dc6d5b15ecf070ccef08ca
Core: in LDAP authenticator, don't try database auth with blank password

In the LDAP authenticator, we were trying to do database auth against
the core with a blank password (QString()), after LDAP auth has succeeded.
This was done because there was not another way to retrieve a quassel
UserId object for a given string username.

However, if we want to support migrating a user from Database to LDAP
auth, this causes problems-- we'd need to set the password column to
whatever an empty QString() maps to in the hashing algorithm.

It seems much simpler to just add a new method to core.h to look up
a UserId object in the current storage provider when we pass it
a string username. Then we can just call that method in the LDAP
authenticator.
src/core/core.h
src/core/ldapauthenticator.cpp