Reordered the locking and setting of user email addresses to avoid a race condition...
[citadel.git] / citadel / user_ops.c
index 31864a27bdd336e86ffc36ef1168be98301de5c7..32af98e9105ec3cc5a1c230aac8631fd70f73891 100644 (file)
@@ -644,6 +644,7 @@ void do_login(void)
                        CCC->user.axlevel = AxAideU;
                }
        }
+       CtdlPutUserLock(&CCC->user);
 
        /*
         * If we are using LDAP authentication, extract the user's email addresses from the directory.
@@ -660,13 +661,12 @@ void do_login(void)
 #endif
 
        /*
-        * No email address for user?  Make one up.
-        */
+        * No email address for user?  Make one up.     (commented out because it appears to break things)
        if (IsEmptyStr(CCC->user.emailaddrs)) {
                sprintf(CCC->user.emailaddrs, "cit%ld@%s", CCC->user.usernum, CtdlGetConfigStr("c_fqdn"));
        }
+        */
        
-       CtdlPutUserLock(&CCC->user);
 
        /*
         * Populate cs_inet_email and cs_inet_other_emails with valid email addresses from the user record