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