+ /* Continue attempting user validation... */
+ safestrncpy(username, trythisname, USERNAME_SIZE);
+ striplt(username);
+
+ if (IsEmptyStr(username)) {
+ return login_not_found;
+ }
+
+ if (config.c_auth_mode == AUTHMODE_HOST) {
+
+ /* host auth mode */
+
+ struct passwd pd;
+ struct passwd *tempPwdPtr;
+ char pwdbuffer[256];
+
+ lprintf(CTDL_DEBUG, "asking host about <%s>\n", username);
+#ifdef HAVE_GETPWNAM_R
+#ifdef SOLARIS_GETPWUID
+ lprintf(CTDL_DEBUG, "Calling getpwnam_r()\n");
+ tempPwdPtr = getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer);
+#else // SOLARIS_GETPWUID
+ lprintf(CTDL_DEBUG, "Calling getpwnam_r()\n");
+ getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer, &tempPwdPtr);
+#endif // SOLARIS_GETPWUID
+#else // HAVE_GETPWNAM_R
+ lprintf(CTDL_DEBUG, "SHOULD NEVER GET HERE!!!\n");
+ tempPwdPtr = NULL;
+#endif // HAVE_GETPWNAM_R
+ if (tempPwdPtr == NULL) {
+ lprintf(CTDL_DEBUG, "no such user <%s>\n", username);
+ return login_not_found;
+ }
+
+ /* Locate the associated Citadel account.
+ * If not found, make one attempt to create it.
+ */
+ found_user = getuserbyuid(&CC->user, pd.pw_uid);
+ lprintf(CTDL_DEBUG, "found it: uid=%ld, gecos=%s here: %d\n",
+ (long)pd.pw_uid, pd.pw_gecos, found_user);
+ if (found_user != 0) {