This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
11
telnet.c
11
telnet.c
@ -12,7 +12,6 @@
|
||||
#include "sics.h"
|
||||
#include "passwd.h"
|
||||
#include "telnet.h"
|
||||
#include "commandlog.h"
|
||||
#include "fortify.h"
|
||||
#define LOGINWAIT 300
|
||||
/* 300 == 5 minutes to wait for valid username password */
|
||||
@ -165,7 +164,7 @@ int TelnetTaskOld(void *pData)
|
||||
iRet = IsValidUser(pUser, pPasswd);
|
||||
if (iRet < 0) {
|
||||
snprintf(pBuffer,sizeof(pBuffer)-1, "SYSTEM ATTACK by %s / %s", pUser, pPasswd);
|
||||
SICSLogWrite(pBuffer, eInternal);
|
||||
Log(FATAL,"sys","%s",pBuffer);
|
||||
SCWrite(self->pCon,
|
||||
"I do not know you, I do not let you in", eError);
|
||||
SendGA(self->pCon);
|
||||
@ -175,8 +174,7 @@ int TelnetTaskOld(void *pData)
|
||||
NETInfo(self->pCon->pSock, pHost, 131);
|
||||
snprintf(pBuffer,sizeof(pBuffer)-1, "Accepted connection on socket %d from %s",
|
||||
self->pCon->pSock->sockid, pHost);
|
||||
SICSLogWrite(pBuffer, eInternal);
|
||||
WriteToCommandLog("SYS >", pBuffer);
|
||||
Log(INFO,"com",pBuffer);
|
||||
SendWelcome(self->pCon);
|
||||
SCSetRights(self->pCon, iRet);
|
||||
self->iLogin = 1;
|
||||
@ -273,7 +271,7 @@ int TelnetTask(void *pData)
|
||||
iRet = IsValidUser(pUser, pPasswd);
|
||||
if (iRet < 0) {
|
||||
snprintf(pBuffer,sizeof(pBuffer)-1, "SYSTEM ATTACK by %s / %s", pUser, pPasswd);
|
||||
SICSLogWrite(pBuffer, eInternal);
|
||||
Log(FATAL,"sys","%s",pBuffer);
|
||||
SCWrite(self->pCon,
|
||||
"I do not know you, I do not let you in", eError);
|
||||
SendGA(self->pCon);
|
||||
@ -282,8 +280,7 @@ int TelnetTask(void *pData)
|
||||
} else {
|
||||
snprintf(pBuffer,sizeof(pBuffer)-1, "Accepted telnet connection on handle %d",
|
||||
self->pCon->sockHandle);
|
||||
SICSLogWrite(pBuffer, eInternal);
|
||||
WriteToCommandLog("SYS >", pBuffer);
|
||||
Log(INFO,"com","%s",pBuffer);
|
||||
SendWelcome(self->pCon);
|
||||
SCSetRights(self->pCon, iRet);
|
||||
self->iLogin = 1;
|
||||
|
Reference in New Issue
Block a user