Fix postinstall

This commit is contained in:
Kayou 2020-04-01 14:26:31 +02:00 committed by Alexandre Aubin
parent ef50e8bf49
commit c6806af2ee

View file

@ -94,11 +94,8 @@ class Authenticator(BaseAuthenticator):
logger.warning("Error during ldap authentication process: %s", e) logger.warning("Error during ldap authentication process: %s", e)
raise raise
else: else:
# If we are trying to login with SASL, we must be logged in as admin # FIXME: During SASL bind whoami from the test server return the admindn while userdn is returned normally :
if self.sasldn in self.userdn and who != self.admincn: if not (who == self.admindn or who == self.userdn):
raise MoulinetteError("Not logged in with the expected userdn ?!")
# else if the userdn must be the same as the identity
elif self.sasldn not in self.userdn and who != self.userdn:
raise MoulinetteError("Not logged in with the expected userdn ?!") raise MoulinetteError("Not logged in with the expected userdn ?!")
else: else:
self.con = con self.con = con