From: mirv Date: Fri, 4 Jan 2008 18:35:55 +0000 (+0100) Subject: remove sec. loader code / cleanup. Task done ;) X-Git-Tag: 0.9.0~53 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d259f1323d942305da1d6903ab49d62e7b592628;p=sasc-ng.git remove sec. loader code / cleanup. Task done ;) --- diff --git a/data.c b/data.c index 7427078..52983df 100644 --- a/data.c +++ b/data.c @@ -510,32 +510,6 @@ void cStructLoaders::Purge(void) } } -// -- cConfRead ---------------------------------------------------------------- - -bool cConfRead::ConfRead(const char *type, const char *filename, bool missingok) -{ - bool res=false; - FILE *f=fopen(filename,"r"); - if(f) { - res=true; - PRINTF(L_GEN_INFO,"loading %s from %s",type,filename); - char buff[1024]; - while(fgets(buff,sizeof(buff),f)) { - if(!index(buff,'\n') && !feof(f)) - PRINTF(L_GEN_ERROR,"confread %s fgets readbuffer overflow",type); - char *line=skipspace(stripspace(buff)); - if(line[0]==0 || line[0]==';' || line[0]=='#') continue; // skip empty & comment lines - if(!ParseLine(line,false)) { - PRINTF(L_GEN_ERROR,"file '%s' has error in line '%s'",filename,buff); - res=false; - } - } - fclose(f); - } - else if(!missingok) PRINTF(L_GEN_ERROR,"Failed to open file '%s': %s",filename,strerror(errno)); - return res; -} - // -- cPid --------------------------------------------------------------------- cPid::cPid(int Pid, int Section, int Mask, int Mode) @@ -677,11 +651,6 @@ cString cPlainKey::ToString(bool hide) return cString::sprintf(hide ? "%c %.*X %s %.4s..." : "%c %.*X %s %s",type,IdSize(),id,*PrintKeyNr(),*Print()); } -void cPlainKey::FormatError(const char *type, const char *sline) -{ - PRINTF(L_GEN_WARN,"%s key: bad format '%.15s%s'\n",type,sline,(strlen(sline)>15)?"...":""); -} - // -- cMutableKey -------------------------------------------------------------- cMutableKey::cMutableKey(bool Super) diff --git a/data.h b/data.h index 1e7a879..ff5e378 100644 --- a/data.h +++ b/data.h @@ -191,15 +191,6 @@ public: // ---------------------------------------------------------------- -class cConfRead { -public: - virtual ~cConfRead() {} - bool ConfRead(const char *type, const char *filename, bool missingok=false); - virtual bool ParseLine(const char *line, bool fromCache)=0; - }; - -// ---------------------------------------------------------------- - class cPid : public cSimpleItem { public: int pid, sct, mask, mode; @@ -266,7 +257,6 @@ protected: virtual int IdSize(void); virtual cString Print(void)=0; virtual cString PrintKeyNr(void); - void FormatError(const char *type, const char *sline); public: int type, id, keynr; // diff --git a/smartcard.c b/smartcard.c index 14cd9be..957c0cf 100644 --- a/smartcard.c +++ b/smartcard.c @@ -1107,7 +1107,7 @@ static const char *serModes[] = { 0,"8e2","8o2","8n2" }; cSmartCards::cSmartCards(void) :cThread("SmartcardWatcher") -,cStructList("smartcard data",DATAFILE,SL_MISSINGOK|SL_WATCH) +,cStructList("smartcard data",DATAFILE,SL_MISSINGOK|SL_WATCH|SL_VERBOSE) { for(int i=0 ; i