- Threshold code now contains security checks
This commit is contained in:
17
counter.c
17
counter.c
@ -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);
|
||||
|
Reference in New Issue
Block a user