- moved IFServerOption to ifile.c
- moved PWSicsUser to passwd.c - moved back InitObjectCommands to ofac.c
This commit is contained in:
28
ifile.c
28
ifile.c
@ -43,6 +43,7 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sics.h>
|
||||
#include "ifile.h"
|
||||
|
||||
/*====================== Locals ============================================*/
|
||||
@ -208,6 +209,33 @@ void IFDeleteOptions(IPair * pList)
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------- Server options creation -------------------------*/
|
||||
int IFServerOption(SConnection * pCon, SicsInterp * pSics,
|
||||
void *pData, int argc, char *argv[])
|
||||
{
|
||||
char pBueffel[512];
|
||||
|
||||
assert(pSics);
|
||||
assert(pCon);
|
||||
|
||||
/* check authorisation */
|
||||
if (!SCMatchRights(pCon, usMugger)) {
|
||||
SCWrite(pCon, "Insufficient privilege to set options", eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* test if sufficient arguments */
|
||||
if (argc < 3) {
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Syntax: %s name value ", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* just do it */
|
||||
pSICSOptions = IFAddOption(pSICSOptions, argv[1], argv[2]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Testcode: Define MAIN to activate it. Needs a file test.txt
|
||||
as input
|
||||
|
Reference in New Issue
Block a user