From c88367f593fdcbd076bfdfc5e81cb42098679e37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 16 Dec 2007 16:03:35 +0000 Subject: [PATCH] * allert if we find a user with empty realname in the host auth, else we fail with further notice in a hard to debug situation. --- citadel/user_ops.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/citadel/user_ops.c b/citadel/user_ops.c index fc54495cd..ccbd5b663 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -397,12 +397,12 @@ int CtdlLoginExistingUser(char *authname, char *trythisname) if (tempPwdPtr == NULL) { return login_not_found; } - lprintf(CTDL_DEBUG, "found it! uid=%ld, gecos=%s\n", (long)pd.pw_uid, pd.pw_gecos); /* 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: %ld\n", (long)pd.pw_uid, pd.pw_gecos, found_user); if (found_user != 0) { create_user(username, 0); found_user = getuserbyuid(&CC->user, pd.pw_uid); @@ -883,6 +883,17 @@ int create_user(char *newusername, int become_user) if (tempPwdPtr != NULL) { extract_token(username, pd.pw_gecos, 0, ',', sizeof username); uid = pd.pw_uid; + if (IsEmptyStr (username)) + { + lprintf (CTDL_EMERG, + "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n", + newusername, pd.pw_uid); + snprintf(buf, SIZ, + "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n", + newusername, pd.pw_uid); + aide_message(buf, "User Creation Failure Notice"); + + } } else { return (ERROR + NO_SUCH_USER); -- 2.39.2