Skip to content
Snippets Groups Projects
Commit 9f73a972 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

Throw an exception when reading an unexpected LDIF record type

parent 3c5d741c
No related branches found
No related tags found
No related merge requests found
......@@ -179,11 +179,12 @@ int LdifReader::readNextRecord( bool first )
LDAPEntry LdifReader::getEntryRecord()
{
std::list<stringpair>::const_iterator i = m_currentRecord.begin();
if ( m_curRecType != LDAPMsg::SEARCH_ENTRY )
{
// Error
throw( std::runtime_error( "The LDIF record: '" + i->second +
"' is not a valid LDAP Entry" ));
}
std::list<stringpair>::const_iterator i = m_currentRecord.begin();
LDAPEntry resEntry(i->second);
i++;
LDAPAttribute curAttr(i->first);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment