MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / FillOutConfigInfo

Method FillOutConfigInfo

src/twadmin/twadmincl.cpp:157–186  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// FillOutConfigInfo -- fills out all the common info with config file information //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

155// FillOutConfigInfo -- fills out all the common info with config file information
156///////////////////////////////////////////////////////////////////////////////
157void cTWAModeCommon::FillOutConfigInfo(const cConfigFile* cf)
158{
159 if (cf == 0)
160 return;
161
162 TSTRING str;
163 if (cf->Lookup(TSTRING(_T("POLFILE")), str))
164 mPolFile = str;
165 if (cf->Lookup(TSTRING(_T("SITEKEYFILE")), str))
166 mSiteKeyFile = str;
167 if (cf->Lookup(TSTRING(_T("LOCALKEYFILE")), str))
168 mLocalKeyFile = str;
169 if (cf->Lookup(TSTRING(_T("LATEPROMPTING")), str))
170 {
171 if (_tcsicmp(str.c_str(), _T("true")) == 0)
172 mLatePassphrase = true;
173 }
174
175 //
176 // turn all of the file names into full paths (they're relative to the exe dir)
177 //
178 TSTRING fullPath;
179 if (!mPolFile.empty() && iFSServices::GetInstance()->FullPath(fullPath, mPolFile, cSystemInfo::GetExeDir()))
180 mPolFile = fullPath;
181 if (!mSiteKeyFile.empty() && iFSServices::GetInstance()->FullPath(fullPath, mSiteKeyFile, cSystemInfo::GetExeDir()))
182 mSiteKeyFile = fullPath;
183 if (!mLocalKeyFile.empty() &&
184 iFSServices::GetInstance()->FullPath(fullPath, mLocalKeyFile, cSystemInfo::GetExeDir()))
185 mLocalKeyFile = fullPath;
186}
187
188///////////////////////////////////////////////////////////////////////////////
189// FillOutCmdLineInfo -- fills out info common to all modes that appears on the

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
emptyMethod · 0.80
FullPathMethod · 0.80
LookupMethod · 0.45

Tested by

no test coverage detected