Commit 1a01a7d9 authored by jan.koester's avatar jan.koester
Browse files

join works

parent d13c9cdb
Loading
Loading
Loading
Loading
Loading
+13 −0
Changes for plugin/ad/ad.cpp: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1072,6 +1072,19 @@ std::vector<uint8_t> ActiveDirectory::handleSearchRequest(const uint8_t *content
                return false;
            }
            LdapEntry le = renderEntry(ent, requested, typesOnly);
            {
                std::string dump;
                for (auto &at : le.attributes) {
                    dump += " " + at.type + "=";
                    for (auto &v : at.values) {
                        bool printable = !v.empty();
                        for (char c : v) if (c < 0x20 || uint8_t(c) > 0x7e) { printable = false; break; }
                        if (printable) dump += v;
                        else { static const char *hc="0123456789abcdef"; dump += "0x"; for (unsigned char c : v){ dump+=hc[c>>4]; dump+=hc[c&0xf]; } }
                    }
                }
                std::cerr << "[LDAP]   entry dn='" << le.dn << "'" << dump << std::endl;
            }
            auto e = buildSearchResultEntry(msgId, le);
            out.insert(out.end(), e.begin(), e.end());
            ++count;
+23 −0
Changes for plugin/smb/smb.cpp: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -549,6 +549,29 @@ std::vector<uint8_t> SmbServer::handleMessage(Conn &c, const std::vector<uint8_t
            resp.insert(resp.end(), out.begin(), out.end());
            return finish(resp);
        }
        if (ctl == 0x00140204 /* FSCTL_VALIDATE_NEGOTIATE_INFO */) {
            /* Secure negotiate (MS-SMB2 3.3.5.15.12): echo our negotiate info so
             * the 3.x client confirms no downgrade. Mismatch or NOT_SUPPORTED
             * makes Windows drop the connection -> SAMR over SMB never starts. */
            std::vector<uint8_t> out;
            uint32_t caps = (c.dialect >= smb::SMB_3_1_1) ? 0x0000002f : 0x00000007;
            w32(out, caps);
            out.insert(out.end(), _ServerGuid, _ServerGuid + 16);
            w16(out, 0x0001);          /* SecurityMode: signing enabled */
            w16(out, c.dialect);       /* the negotiated dialect */
            smb::Smb2Header h; h.command=req.command; h.messageId=req.messageId; h.sessionId=c.sessionId;
            h.treeId=req.treeId; h.status=smb::STATUS_SUCCESS; h.creditReqResp=1;
            auto resp = smb::buildHeader(h);
            w16(resp, 49); w16(resp, 0); w32(resp, ctl);
            w64(resp, volId); w64(resp, volId);
            w32(resp, 0); w32(resp, 0);          /* InputOffset/Count */
            w32(resp, 64 + 48);                  /* OutputOffset */
            w32(resp, uint32_t(out.size()));     /* OutputCount */
            w32(resp, 0); w32(resp, 0);          /* Flags/Reserved2 */
            resp.insert(resp.end(), out.begin(), out.end());
            return finish(resp);
        }
        std::cerr << "[SMB] unhandled IOCTL ctl=0x" << std::hex << ctl << std::dec << std::endl;
        return errorResponse(req, smb::STATUS_NOT_SUPPORTED);
    }
    case smb::SMB2_CLOSE: {
+4 −3
Changes for src/rpc/samr.cpp: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -133,9 +133,10 @@ DispatchResult samrDispatch(uint16_t opnum, const std::vector<uint8_t> &stub,
            PolicyHandle h = newHandle(H_CONNECT);
            NdrPush p;
            if (opnum == SAMR_CONNECT5) {
                p.u32(1);          /* level_out */
                p.u32(1);          /* info union tag */
                p.u32(0); p.u32(0); p.u32(0);  /* ClientVersion + reserved-ish (SamrConnectInfo1) */
                p.u32(1);          /* OutVersion */
                p.u32(1);          /* OutRevisionInfo union discriminant (= 1) */
                p.u32(0);          /* SAMPR_REVISION_INFO_V1.Revision */
                p.u32(0);          /* SAMPR_REVISION_INFO_V1.SupportedFeatures */
            }
            p.handle(h);
            p.u32(ST_OK);