Don't use super() when normalizing username using PAM

- We don't need the extra normalization of that function.
- Also add in username_map support here.  It probably isn't needed
  most of the time with PAM, but it keeps things consistent and is
  easier than documenting an exception.
This commit is contained in:
Richard Darst
2019-02-03 00:37:06 +02:00
parent 92223b1dde
commit d33226f3c2

View File

@@ -787,6 +787,8 @@ class PAMAuthenticator(LocalAuthenticator):
import pwd
uid = pwd.getpwnam(username).pw_uid
username = pwd.getpwuid(uid).pw_name
username = self.username_map.get(username, username)
else:
return super().normalize_username(username)
class DummyAuthenticator(Authenticator):