static bool cldap_socket_recv_dgram(struct cldap_socket *c,
struct cldap_incoming *in)
{
- DATA_BLOB blob;
struct asn1_data *asn1;
void *p;
struct cldap_search_state *search;
goto error;
}
- blob = data_blob_const(in->buf, in->len);
-
asn1 = asn1_init(in);
if (!asn1) {
goto nomem;
}
- if (!asn1_load(asn1, blob)) {
- goto nomem;
- }
+ asn1_load_nocopy(asn1, in->buf, in->len);
in->ldap_msg = talloc(in, struct ldap_message);
if (in->ldap_msg == NULL) {
search = talloc_get_type_abort(p, struct cldap_search_state);
search->response.in = talloc_move(search, &in);
+
search->response.asn1 = asn1;
- search->response.asn1->ofs = 0;
+
+ asn1_load_nocopy(search->response.asn1,
+ search->response.in->buf, search->response.in->len);
DLIST_REMOVE(c->searches.list, search);
talloc_set_destructor(state, cldap_search_state_destructor);
+ if (state->caller.cldap == NULL) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ goto post;
+ }
+
if (io->in.dest_address) {
if (cldap->connected) {
tevent_req_nterror(req, NT_STATUS_PIPE_CONNECTED);
}
tevent_req_set_callback(subreq, cldap_search_state_queue_done, req);
- DLIST_ADD_END(cldap->searches.list, state, struct cldap_search_state *);
+ DLIST_ADD_END(cldap->searches.list, state);
return req;
}
if (io->in.domain_sid) {
struct dom_sid *sid = dom_sid_parse_talloc(mem_ctx, io->in.domain_sid);
- if (filter == NULL) {
- return NULL;
- }
+
filter = talloc_asprintf_append_buffer(filter, "(domainSid=%s)",
ldap_encode_ndr_dom_sid(mem_ctx, sid));
if (filter == NULL) {
}
if (io->in.domain_guid) {
struct GUID guid;
- NTSTATUS status;
- status = GUID_from_string(io->in.domain_guid, &guid);
- if (filter == NULL) {
- return NULL;
- }
+ GUID_from_string(io->in.domain_guid, &guid);
+
filter = talloc_asprintf_append_buffer(filter, "(DomainGuid=%s)",
ldap_encode_ndr_GUID(mem_ctx, &guid));
if (filter == NULL) {
{
struct cldap_netlogon_state *state = tevent_req_data(req,
struct cldap_netlogon_state);
- NTSTATUS status;
+ NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
DATA_BLOB *data;
if (tevent_req_is_nterror(req, &status)) {