Browse files

cyrusauth: Fix user creation

  • Loading branch information...
1 parent 47799ab commit 7454331ea32731abcd24d33cacaf99c9ac26bebe @DarthGandalf DarthGandalf committed Aug 29, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 modules/cyrusauth.cpp
View
11 modules/cyrusauth.cpp
@@ -128,21 +128,22 @@ class CSASLAuthMod : public CModule {
}
if (pUser && !pUser->Clone(*pBaseUser, sErr)) {
- DEBUG("saslauth: Clone User [" << CloneUser() << "] " << sErr);
+ DEBUG("saslauth: Clone User [" << CloneUser() << "] failed: " << sErr);
delete pUser;
pUser = NULL;
}
}
+ if (pUser) {
+ // "::" is an invalid MD5 hash, so user won't be able to login by usual method
+ pUser->SetPass("::", CUser::HASH_MD5, "::");
+ }
+
if (pUser && !CZNC::Get().AddUser(pUser, sErr)) {
DEBUG("saslauth: Add user [" << sUsername << "] failed: " << sErr);
delete pUser;
pUser = NULL;
}
-
- if (pUser) {
- pUser->SetPass("::", CUser::HASH_MD5, "::");
- }
}
if (pUser) {

0 comments on commit 7454331

Please sign in to comment.