- Fixed a few problems with hklscan
- Added transfer of zipped data to conman.c, histogram memory software in order to support the TRICS status display. - Upgraded TRICS data file writing. - First installment of triple axis spectrometer support: initialization of data structures and an implementation of the MAD dr(ive) command.
This commit is contained in:
58
nread.c
58
nread.c
@@ -8,6 +8,10 @@
|
||||
Mark Koennecke, September 1997
|
||||
|
||||
Telnet Functionality added: Mark Koennecke, January 1998
|
||||
|
||||
Revamped login to non telnet connection.
|
||||
Mark Koennecke, October 20000
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
@@ -174,6 +178,7 @@ extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
||||
int iRet;
|
||||
SConnection *pRes = NULL;
|
||||
char *pUser = NULL, *pPasswd = NULL;
|
||||
time_t target;
|
||||
|
||||
if(!VerifyChannel(pSock))
|
||||
{
|
||||
@@ -183,55 +188,28 @@ extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
||||
/* check for new connection */
|
||||
pNew = NETAccept(pSock,0);
|
||||
if(pNew)
|
||||
{ /* new connection, read user/passwd, verify and work accordingly */
|
||||
iRet = NETRead(pNew,pBuffer,1063, self->iPasswdTimeout);
|
||||
if(iRet <= 0)
|
||||
{
|
||||
/* create connection object */
|
||||
pRes = SCreateConnection(self->pMain->pSics,pNew,iRet);
|
||||
if(!pRes)
|
||||
{
|
||||
strcpy(pBuffer,"Timeout waiting for username/password");
|
||||
SICSLogWrite(pBuffer,eInternal);
|
||||
NETClosePort(pNew);
|
||||
free(pNew);
|
||||
return 0;
|
||||
SICSLogWrite("Failure to allocate new Connection",eInternal);
|
||||
NETClosePort(pNew);
|
||||
free(pNew);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pUser = strtok(pBuffer," \t");
|
||||
pPasswd = strtok(NULL," \t\r\n");
|
||||
iRet = IsValidUser(pUser,pPasswd);
|
||||
if(iRet < 0)
|
||||
{
|
||||
sprintf(pBuffer,"SYSTEM ATTACK by %s / %s",pUser,
|
||||
pPasswd);
|
||||
SICSLogWrite(pBuffer,eInternal);
|
||||
NETClosePort(pNew);
|
||||
free(pNew);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create connection object */
|
||||
pRes = SCreateConnection(self->pMain->pSics,pNew,iRet);
|
||||
if(!pRes)
|
||||
{
|
||||
SICSLogWrite("Failure to allocate new Connection",eInternal);
|
||||
NETClosePort(pNew);
|
||||
free(pNew);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* register the connection and create a task for it here */
|
||||
NetReadRegister(self,pNew,command, pRes);
|
||||
TaskRegister(self->pMain->pTasker,
|
||||
/* register the connection and create a task for it here */
|
||||
NetReadRegister(self,pNew,command, pRes);
|
||||
TaskRegister(self->pMain->pTasker,
|
||||
SCTaskFunction,
|
||||
SCSignalFunction,
|
||||
SCDeleteConnection,
|
||||
pRes,
|
||||
1);
|
||||
SCSendOK(pRes);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
SCSendOK(pRes);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user