MCPcopy Create free account
hub / github.com/USBGuard/usbguard / parseConf

Method parseConf

src/Daemon/LDAPHandler.cpp:214–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212 }
213
214 void LDAPHandler::parseConf(const std::string path)
215 {
216 _ldap_file = path;
217 USBGUARD_LOG(Info) << "Loading LDAP configuration from " << _ldap_file;
218 std::ifstream ldap_file(_ldap_file);
219
220 if (!ldap_file.is_open()) {
221 throw ErrnoException("LDAP configuration parsing", _ldap_file, errno);
222 }
223
224 _parser.parseStream(ldap_file);
225 _parsedOptions = _parser.getMap();
226 ldap_file.close();
227 USBGUARD_LOG(Debug) << "Map contains:";
228
229 for (auto x: _parsedOptions) {
230 USBGUARD_LOG(Debug) << "--> " << x.first << "->" << x.second << " <--";
231 }
232
233 USBGUARD_LOG(Debug) << "LDAP conf has been parsed";
234 }
235
236 void LDAPHandler::validateConf()
237 {

Callers

nothing calls this directly

Calls 4

ErrnoExceptionClass · 0.85
parseStreamMethod · 0.45
getMapMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected