]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
cldap: Make finddcs.out.netlogon a pointer
authorVolker Lendecke <vl@samba.org>
Wed, 30 Oct 2024 10:10:28 +0000 (11:10 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 11 Nov 2024 14:03:03 +0000 (14:03 +0000)
struct netlogon_samlogon_response has subpointers, this patch enables
a proper talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/libcli/finddc.h
source4/libcli/finddcs_cldap.c
source4/libnet/libnet_lookup.c
source4/libnet/py_net.c

index 3836d127026b1559b42d9345b2d12e0de6cf602d..03bc6d9e368077288b20ca29d9af0be9dbb262ef 100644 (file)
@@ -34,7 +34,7 @@ struct finddcs {
        } in;
        struct {
                const char *address; /* IP address of server */
-               struct netlogon_samlogon_response netlogon;
+               struct netlogon_samlogon_response *netlogon;
        } out;
 };
 
index 19c2993ded5d50b90f84023ee8b55c90710dcbbb..36d4c7cc0af09c2fdd37813ab85bf34a8cb6dcc1 100644 (file)
@@ -461,8 +461,7 @@ NTSTATUS finddcs_cldap_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct
                return status;
        }
 
-       talloc_steal(mem_ctx, state->netlogon);
-       io->out.netlogon = *state->netlogon->out.netlogon;
+       io->out.netlogon = talloc_move(mem_ctx, &state->netlogon->out.netlogon);
        io->out.address = talloc_steal(
                mem_ctx, state->srv_addresses[state->srv_address_index]);
 
index 63ce6015b66e76d01df806720de8cc9ca43511c9..b52c37f93058ce065c49650e844b7ed49f86f6e8 100644 (file)
@@ -227,7 +227,7 @@ NTSTATUS libnet_LookupDCs_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        io->out.dcs = talloc(mem_ctx, struct nbt_dc_name);
        NT_STATUS_HAVE_NO_MEMORY(io->out.dcs);
        io->out.dcs[0].address = finddcs_io.out.address;
-       io->out.dcs[0].name = finddcs_io.out.netlogon.data.nt5_ex.pdc_dns_name;
+       io->out.dcs[0].name = finddcs_io.out.netlogon->data.nt5_ex.pdc_dns_name;
        return status;
 }
 
index 257149d229804547ca87172d0dbbb3da4f383fcc..8beb789d4bb9d9c73afec1f5d469ada7c6b7613e 100644 (file)
@@ -766,8 +766,10 @@ static PyObject *py_net_finddc(py_net_Object *self, PyObject *args, PyObject *kw
                return NULL;
        }
 
-       ret = py_return_ndr_struct("samba.dcerpc.nbt", "NETLOGON_SAM_LOGON_RESPONSE_EX",
-                                  io, &io->out.netlogon.data.nt5_ex);
+       ret = py_return_ndr_struct("samba.dcerpc.nbt",
+                                  "NETLOGON_SAM_LOGON_RESPONSE_EX",
+                                  io,
+                                  &io->out.netlogon->data.nt5_ex);
        talloc_free(mem_ctx);
 
        return ret;