Skip to content
Snippets Groups Projects
Commit 15015312 authored by rswindell's avatar rswindell
Browse files

Don't log "(null)" for the user name in filter_ip() when the user name is

not known/available (e.g. certain types of SSH login failures).
parent 6c1e245c
No related branches found
No related tags found
No related merge requests found
...@@ -2771,8 +2771,10 @@ BOOL DLLCALL filter_ip(scfg_t* cfg, const char* prot, const char* reason, const ...@@ -2771,8 +2771,10 @@ BOOL DLLCALL filter_ip(scfg_t* cfg, const char* prot, const char* reason, const
if((fp=fopen(fname,"a"))==NULL) if((fp=fopen(fname,"a"))==NULL)
return(FALSE); return(FALSE);
fprintf(fp,"\n; %s %s by %s on %s\n" fprintf(fp, "\n; %s %s ", prot, reason);
,prot,reason,username,timestr(cfg,now,tstr)); if(username != NULL)
fprintf(fp, "by %s ", username);
fprintf(fp,"on %s\n", timestr(cfg, now, tstr));
if(host!=NULL) if(host!=NULL)
fprintf(fp,"; Hostname: %s\n",host); fprintf(fp,"; Hostname: %s\n",host);
......
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