Commit e699edcb authored by jan.koester's avatar jan.koester
Browse files

test

parent e455480f
Loading
Loading
Loading
Loading
Loading
+9 −0
Changes for plugin/ad/ad.cpp: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -597,6 +597,14 @@ std::vector<uint8_t> ActiveDirectory::handleMessage(const uint8_t *data, size_t
        return {};
    uint8_t appTag = tag & 0x1F;

    {
        static const char *opName[] = {"BIND","BINDRESP","UNBIND","SEARCH","SEARCHENTRY",
            "SEARCHDONE","?6?","MODIFY","ADD","DEL","?10?","MODRDN","?12?","COMPARE"};
        const char *nm = (appTag < 14) ? opName[appTag] : "?";
        std::cerr << "[LDAP] msgId=" << msgId << " op=" << int(appTag) << "(" << nm
                  << ") authed=" << session.authenticated << " as='" << session.bindDN << "'" << std::endl;
    }

    switch (appTag) {
    case LDAP_BIND_REQUEST:   return handleBindRequest(content, contentLen, msgId, session);
    case LDAP_UNBIND_REQUEST: return handleUnbindRequest(msgId, session);
@@ -628,6 +636,7 @@ std::vector<uint8_t> ActiveDirectory::handleBindRequest(const uint8_t *content,
        return buildLdapMessage(msgId, appResp, buildLdapResult(LDAP_PROTOCOL_ERROR, "", "version"));
    int32_t version = 0;
    LdapBer::parseInteger(data, dataLen, version);
    (void)version;

    if (!LdapBer::parseTLV(content, len, off, tag, data, dataLen))
        return buildLdapMessage(msgId, appResp, buildLdapResult(LDAP_PROTOCOL_ERROR, "", "bind DN"));