Skip to content
Snippets Groups Projects
Commit ffba326d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix the "ERROR x getting data user y" log message (usernum was 0).

Add the errno value to help root-cause.

We really should be using safe_strerror() everywhere.
parent 9bf86ab1
No related branches found
No related tags found
No related merge requests found
Pipeline #7166 passed
......@@ -2510,8 +2510,8 @@ static void ctrl_thread(void* arg)
SKIP_WHITESPACE(p);
SAFECOPY(password,p);
user.number = find_login_id(&scfg, user.alias);
if(!user.number) {
int usernum = find_login_id(&scfg, user.alias);
if(usernum < 1) {
if(scfg.sys_misc&SM_ECHO_PW)
lprintf(LOG_NOTICE,"%04d !UNKNOWN USER: '%s' (password: %s)",sock,user.alias,p);
else
......@@ -2520,11 +2520,11 @@ static void ctrl_thread(void* arg)
break;
continue;
}
user.number = usernum;
if((i=getuserdat(&scfg, &user))!=0) {
lprintf(LOG_ERR,"%04d <%s> !ERROR %d getting data for user #%d"
,sock, user.alias, i, user.number);
lprintf(LOG_ERR,"%04d <%s> !ERROR %d (errno=%d) getting data for user #%d"
,sock, user.alias, i, errno, usernum);
sockprintf(sock,sess,"530 Database error %d",i);
user.number=0;
continue;
}
if(user.misc&(DELETED|INACTIVE)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment