- Threshold code now contains security checks

This commit is contained in:
cvs
2000-09-01 14:50:55 +00:00
parent 889a754b00
commit 1552604aa6

View File

@ -44,15 +44,11 @@
#include <time.h>
#include "fortify.h"
#include <string.h>
#include "sics.h"
#include "countdriv.h"
#include "obdes.h"
#include "conman.h"
#include "interface.h"
#include "counter.h"
#include "fupa.h"
#include "devexec.h"
#include "status.h"
#include "event.h"
#include "splitter.h"
/*-------------------------------------------------------------------------*/
/*
@ -841,6 +837,10 @@
SCWrite(pCon,pBueffel,eValue);
return 1;
case 7: /* SetExponent */
if(!SCMatchRights(pCon,usMugger))
{
return 0;
}
self->iExponent = PaRes.Arg[0].iVal;
SCSendOK(pCon);
return 1;
@ -913,6 +913,13 @@
"ERROR: Insufficient privilege to set threshold",eError);
return 0;
}
if(isInRunMode(pServ->pExecutor))
{
SCWrite(pCon,
"ERROR: cannot change threshold while instrument is active",
eError);
return 0;
}
/* set threshold value */
iRet = self->pDriv->Set(self->pDriv,PARTHRESHOLD,
PaRes.Arg[0].iVal,PaRes.Arg[1].fVal);