diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-21 14:51:13 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-21 14:51:13 +0200 |
commit | 5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch) | |
tree | b0a7e52b5646c8eec182dbc391e7934b6804488c /source4/libnet | |
parent | 625359b2e266105022309df8985720108ecd6f67 (diff) | |
parent | 2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff) | |
download | samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2 samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts:
source4/lib/registry/ldb.c
source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/groupinfo.c | 1 | ||||
-rw-r--r-- | source4/libnet/groupman.c | 1 | ||||
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 219 | ||||
-rw-r--r-- | source4/libnet/libnet_join.c | 68 | ||||
-rw-r--r-- | source4/libnet/libnet_lookup.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_passwd.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_samdump.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_samdump_keytab.c | 18 | ||||
-rw-r--r-- | source4/libnet/libnet_samsync_ldb.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_site.c | 7 | ||||
-rw-r--r-- | source4/libnet/libnet_unbecome_dc.c | 38 | ||||
-rw-r--r-- | source4/libnet/libnet_vampire.c | 2 | ||||
-rw-r--r-- | source4/libnet/py_net.c | 2 | ||||
-rw-r--r-- | source4/libnet/userinfo.c | 1 | ||||
-rw-r--r-- | source4/libnet/userman.c | 1 |
15 files changed, 193 insertions, 173 deletions
diff --git a/source4/libnet/groupinfo.c b/source4/libnet/groupinfo.c index 6c8580a662..1da6646702 100644 --- a/source4/libnet/groupinfo.c +++ b/source4/libnet/groupinfo.c @@ -30,6 +30,7 @@ #include "libnet/userman.h" #include "libnet/groupinfo.h" #include "librpc/gen_ndr/ndr_samr_c.h" +#include "libnet/libnet_proto.h" struct groupinfo_state { diff --git a/source4/libnet/groupman.c b/source4/libnet/groupman.c index 1e12c87713..58d5742336 100644 --- a/source4/libnet/groupman.c +++ b/source4/libnet/groupman.c @@ -26,6 +26,7 @@ #include "libnet/composite.h" #include "libnet/groupman.h" #include "librpc/gen_ndr/ndr_samr_c.h" +#include "libnet/libnet_proto.h" struct groupadd_state { diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 332b041e36..6e7924248c 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -770,7 +770,7 @@ static void becomeDC_recv_cldap(struct cldap_request *req) c->status = cldap_netlogon_recv(req, s, &s->cldap.io); if (!composite_is_ok(c)) return; - s->cldap.netlogon = s->cldap.io.out.netlogon.nt5_ex; + s->cldap.netlogon = s->cldap.io.out.netlogon.data.nt5_ex; s->domain.dns_name = s->cldap.netlogon.dns_domain; s->domain.netbios_name = s->cldap.netlogon.domain; @@ -820,8 +820,8 @@ static NTSTATUS becomeDC_ldap1_rootdse(struct libnet_BecomeDC_state *s) basedn = ldb_dn_new(s, s->ldap1.ldb, NULL); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -829,7 +829,6 @@ static NTSTATUS becomeDC_ldap1_rootdse(struct libnet_BecomeDC_state *s) talloc_free(r); return NT_STATUS_INVALID_NETWORK_RESPONSE; } - talloc_steal(s, r); s->ldap1.rootdse = r->msgs[0]; @@ -864,8 +863,8 @@ static NTSTATUS becomeDC_ldap1_crossref_behavior_version(struct libnet_BecomeDC_ basedn = ldb_dn_new(s, s->ldap1.ldb, s->forest.config_dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_ONELEVEL, - "(cn=Partitions)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_ONELEVEL, attrs, + "(cn=Partitions)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -893,8 +892,8 @@ static NTSTATUS becomeDC_ldap1_domain_behavior_version(struct libnet_BecomeDC_st basedn = ldb_dn_new(s, s->ldap1.ldb, s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -922,8 +921,8 @@ static NTSTATUS becomeDC_ldap1_schema_object_version(struct libnet_BecomeDC_stat basedn = ldb_dn_new(s, s->ldap1.ldb, s->forest.schema_dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -952,8 +951,8 @@ static NTSTATUS becomeDC_ldap1_w2k3_update_revision(struct libnet_BecomeDC_state s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret == LDB_ERR_NO_SUCH_OBJECT) { /* w2k doesn't have this object */ @@ -1000,8 +999,8 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", _1_1_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + _1_1_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1013,8 +1012,8 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state basedn = talloc_steal(s, r->msgs[0]->dn); talloc_free(r); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", fsmo_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + fsmo_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1038,8 +1037,8 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state s->infrastructure_fsmo.server_dn_str = ldb_dn_alloc_linearized(s, server_dn); NT_STATUS_HAVE_NO_MEMORY(s->infrastructure_fsmo.server_dn_str); - ret = ldb_search(s->ldap1.ldb, server_dn, LDB_SCOPE_BASE, - "(objectClass=*)", dns_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, server_dn, LDB_SCOPE_BASE, + dns_attrs, "(objectClass=*)"); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); } else if (r->count != 1) { @@ -1053,8 +1052,8 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state talloc_free(r); - ret = ldb_search(s->ldap1.ldb, ntds_dn, LDB_SCOPE_BASE, - "(objectClass=*)", guid_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, ntds_dn, LDB_SCOPE_BASE, + guid_attrs, "(objectClass=*)"); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); } else if (r->count != 1) { @@ -1097,8 +1096,8 @@ static NTSTATUS becomeDC_ldap1_rid_manager_fsmo(struct libnet_BecomeDC_state *s) basedn = ldb_dn_new(s, s->ldap1.ldb, s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", rid_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + rid_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1115,8 +1114,8 @@ static NTSTATUS becomeDC_ldap1_rid_manager_fsmo(struct libnet_BecomeDC_state *s) talloc_free(r); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", fsmo_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + fsmo_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1140,8 +1139,8 @@ static NTSTATUS becomeDC_ldap1_rid_manager_fsmo(struct libnet_BecomeDC_state *s) s->rid_manager_fsmo.server_dn_str = ldb_dn_alloc_linearized(s, server_dn); NT_STATUS_HAVE_NO_MEMORY(s->rid_manager_fsmo.server_dn_str); - ret = ldb_search(s->ldap1.ldb, server_dn, LDB_SCOPE_BASE, - "(objectClass=*)", dns_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, server_dn, LDB_SCOPE_BASE, + dns_attrs, "(objectClass=*)"); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); } else if (r->count != 1) { @@ -1155,8 +1154,8 @@ static NTSTATUS becomeDC_ldap1_rid_manager_fsmo(struct libnet_BecomeDC_state *s) talloc_free(r); - ret = ldb_search(s->ldap1.ldb, ntds_dn, LDB_SCOPE_BASE, - "(objectClass=*)", guid_attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, ntds_dn, LDB_SCOPE_BASE, + guid_attrs, "(objectClass=*)"); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); } else if (r->count != 1) { @@ -1182,8 +1181,8 @@ static NTSTATUS becomeDC_ldap1_site_object(struct libnet_BecomeDC_state *s) s->forest.config_dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", NULL, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + NULL, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1214,7 +1213,6 @@ static NTSTATUS becomeDC_ldap1_computer_object(struct libnet_BecomeDC_state *s) int ret; struct ldb_result *r; struct ldb_dn *basedn; - char *filter; static const char *attrs[] = { "distinguishedName", "userAccountControl", @@ -1224,12 +1222,9 @@ static NTSTATUS becomeDC_ldap1_computer_object(struct libnet_BecomeDC_state *s) basedn = ldb_dn_new(s, s->ldap1.ldb, s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - filter = talloc_asprintf(basedn, "(&(|(objectClass=user)(objectClass=computer))(sAMAccountName=%s$))", - s->dest_dsa.netbios_name); - NT_STATUS_HAVE_NO_MEMORY(filter); - - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_SUBTREE, - filter, attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_SUBTREE, attrs, + "(&(|(objectClass=user)(objectClass=computer))(sAMAccountName=%s$))", + s->dest_dsa.netbios_name); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -1263,8 +1258,8 @@ static NTSTATUS becomeDC_ldap1_server_object_1(struct libnet_BecomeDC_state *s) s->forest.config_dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", NULL, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + NULL, "(objectClass=*)"); talloc_free(basedn); if (ret == LDB_ERR_NO_SUCH_OBJECT) { /* if the object doesn't exist, we'll create it later */ @@ -1320,8 +1315,8 @@ static NTSTATUS becomeDC_ldap1_server_object_2(struct libnet_BecomeDC_state *s) basedn = ldb_dn_new(s, s->ldap1.ldb, s->dest_dsa.computer_dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap1.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap1.ldb, s, &r, basedn, LDB_SCOPE_BASE, + attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -2178,11 +2173,15 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) /* setup request structure */ r->in.bind_handle = &s->drsuapi1.bind_handle; r->in.level = 2; - r->in.req.req2.first_object.next_object = NULL; - r->in.req.req2.first_object.object.identifier = identifier; - r->in.req.req2.first_object.object.flags = 0x00000000; - r->in.req.req2.first_object.object.attribute_ctr.num_attributes = num_attrs; - r->in.req.req2.first_object.object.attribute_ctr.attributes = attrs; + r->in.req = talloc(s, union drsuapi_DsAddEntryRequest); + r->in.req->req2.first_object.next_object = NULL; + r->in.req->req2.first_object.object.identifier = identifier; + r->in.req->req2.first_object.object.flags = 0x00000000; + r->in.req->req2.first_object.object.attribute_ctr.num_attributes= num_attrs; + r->in.req->req2.first_object.object.attribute_ctr.attributes = attrs; + + r->out.level_out = talloc(s, int32_t); + r->out.ctr = talloc(s, union drsuapi_DsAddEntryCtr); req = dcerpc_drsuapi_DsAddEntry_send(s->drsuapi1.pipe, r, r); composite_continue_rpc(c, req, becomeDC_drsuapi1_add_entry_recv, s); @@ -2217,37 +2216,37 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req) return; } - if (r->out.level == 3) { - if (r->out.ctr.ctr3.count != 1) { + if (*r->out.level_out == 3) { + if (r->out.ctr->ctr3.count != 1) { WERROR status; - if (r->out.ctr.ctr3.level != 1) { + if (r->out.ctr->ctr3.level != 1) { composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } - if (!r->out.ctr.ctr3.error) { + if (!r->out.ctr->ctr3.error) { composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } - status = r->out.ctr.ctr3.error->info1.status; + status = r->out.ctr->ctr3.error->info1.status; - if (!r->out.ctr.ctr3.error->info1.info) { + if (!r->out.ctr->ctr3.error->info1.info) { composite_error(c, werror_to_ntstatus(status)); return; } /* see if we can get a more detailed error */ - switch (r->out.ctr.ctr3.error->info1.level) { + switch (r->out.ctr->ctr3.error->info1.level) { case 1: - status = r->out.ctr.ctr3.error->info1.info->error1.status; + status = r->out.ctr->ctr3.error->info1.info->error1.status; break; case 4: case 5: case 6: case 7: - status = r->out.ctr.ctr3.error->info1.info->errorX.status; + status = r->out.ctr->ctr3.error->info1.info->errorX.status; break; } @@ -2255,14 +2254,14 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req) return; } - s->dest_dsa.ntds_guid = r->out.ctr.ctr3.objects[0].guid; - } else if (r->out.level == 2) { - if (r->out.ctr.ctr2.count != 1) { - composite_error(c, werror_to_ntstatus(r->out.ctr.ctr2.error.status)); + s->dest_dsa.ntds_guid = r->out.ctr->ctr3.objects[0].guid; + } else if (*r->out.level_out == 2) { + if (r->out.ctr->ctr2.count != 1) { + composite_error(c, werror_to_ntstatus(r->out.ctr->ctr2.error.status)); return; } - s->dest_dsa.ntds_guid = r->out.ctr.ctr2.objects[0].guid; + s->dest_dsa.ntds_guid = r->out.ctr->ctr2.objects[0].guid; } else { composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE); return; @@ -2397,40 +2396,42 @@ static void becomeDC_drsuapi_pull_partition_send(struct libnet_BecomeDC_state *s r = talloc(s, struct drsuapi_DsGetNCChanges); if (composite_nomem(r, c)) return; - r->in.level = talloc(r, int32_t); - if (composite_nomem(r->in.level, c)) return; - r->out.level = talloc(r, int32_t); - if (composite_nomem(r->out.level, c)) return; + r->out.level_out = talloc(r, int32_t); + if (composite_nomem(r->out.level_out, c)) return; + r->in.req = talloc(r, union drsuapi_DsGetNCChangesRequest); + if (composite_nomem(r->in.req, c)) return; + r->out.ctr = talloc(r, union drsuapi_DsGetNCChangesCtr); + if (composite_nomem(r->out.ctr, c)) return; r->in.bind_handle = &drsuapi_h->bind_handle; if (drsuapi_h->remote_info28.supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) { - *r->in.level = 8; - r->in.req.req8.destination_dsa_guid = partition->destination_dsa_guid; - r->in.req.req8.source_dsa_invocation_id = partition->source_dsa_invocation_id; - r->in.req.req8.naming_context = &partition->nc; - r->in.req.req8.highwatermark = partition->highwatermark; - r->in.req.req8.uptodateness_vector = NULL; - r->in.req.req8.replica_flags = partition->replica_flags; - r->in.req.req8.max_object_count = 133; - r->in.req.req8.max_ndr_size = 1336811; - r->in.req.req8.extended_op = DRSUAPI_EXOP_NONE; - r->in.req.req8.fsmo_info = 0; - r->in.req.req8.partial_attribute_set = NULL; - r->in.req.req8.partial_attribute_set_ex = NULL; - r->in.req.req8.mapping_ctr.num_mappings = 0; - r->in.req.req8.mapping_ctr.mappings = NULL; + r->in.level = 8; + r->in.req->req8.destination_dsa_guid = partition->destination_dsa_guid; + r->in.req->req8.source_dsa_invocation_id= partition->source_dsa_invocation_id; + r->in.req->req8.naming_context = &partition->nc; + r->in.req->req8.highwatermark = partition->highwatermark; + r->in.req->req8.uptodateness_vector = NULL; + r->in.req->req8.replica_flags = partition->replica_flags; + r->in.req->req8.max_object_count = 133; + r->in.req->req8.max_ndr_size = 1336811; + r->in.req->req8.extended_op = DRSUAPI_EXOP_NONE; + r->in.req->req8.fsmo_info = 0; + r->in.req->req8.partial_attribute_set = NULL; + r->in.req->req8.partial_attribute_set_ex= NULL; + r->in.req->req8.mapping_ctr.num_mappings= 0; + r->in.req->req8.mapping_ctr.mappings = NULL; } else { - *r->in.level = 5; - r->in.req.req5.destination_dsa_guid = partition->destination_dsa_guid; - r->in.req.req5.source_dsa_invocation_id = partition->source_dsa_invocation_id; - r->in.req.req5.naming_context = &partition->nc; - r->in.req.req5.highwatermark = partition->highwatermark; - r->in.req.req5.uptodateness_vector = NULL; - r->in.req.req5.replica_flags = partition->replica_flags; - r->in.req.req5.max_object_count = 133; - r->in.req.req5.max_ndr_size = 1336770; - r->in.req.req5.extended_op = DRSUAPI_EXOP_NONE; - r->in.req.req5.fsmo_info = 0; + r->in.level = 5; + r->in.req->req5.destination_dsa_guid = partition->destination_dsa_guid; + r->in.req->req5.source_dsa_invocation_id= partition->source_dsa_invocation_id; + r->in.req->req5.naming_context = &partition->nc; + r->in.req->req5.highwatermark = partition->highwatermark; + r->in.req->req5.uptodateness_vector = NULL; + r->in.req->req5.replica_flags = partition->replica_flags; + r->in.req->req5.max_object_count = 133; + r->in.req->req5.max_ndr_size = 1336770; + r->in.req->req5.extended_op = DRSUAPI_EXOP_NONE; + r->in.req->req5.fsmo_info = 0; } /* @@ -2462,28 +2463,28 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state return r->out.result; } - if (*r->out.level == 1) { + if (*r->out.level_out == 1) { ctr_level = 1; - ctr1 = &r->out.ctr.ctr1; - } else if (*r->out.level == 2 && - r->out.ctr.ctr2.mszip1.ts) { + ctr1 = &r->out.ctr->ctr1; + } else if (*r->out.level_out == 2 && + r->out.ctr->ctr2.mszip1.ts) { ctr_level = 1; - ctr1 = &r->out.ctr.ctr2.mszip1.ts->ctr1; - } else if (*r->out.level == 6) { + ctr1 = &r->out.ctr->ctr2.mszip1.ts->ctr1; + } else if (*r->out.level_out == 6) { ctr_level = 6; - ctr6 = &r->out.ctr.ctr6; - } else if (*r->out.level == 7 && - r->out.ctr.ctr7.level == 6 && - r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP && - r->out.ctr.ctr7.ctr.mszip6.ts) { + ctr6 = &r->out.ctr->ctr6; + } else if (*r->out.level_out == 7 && + r->out.ctr->ctr7.level == 6 && + r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP && + r->out.ctr->ctr7.ctr.mszip6.ts) { ctr_level = 6; - ctr6 = &r->out.ctr.ctr7.ctr.mszip6.ts->ctr6; - } else if (*r->out.level == 7 && - r->out.ctr.ctr7.level == 6 && - r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS && - r->out.ctr.ctr7.ctr.xpress6.ts) { + ctr6 = &r->out.ctr->ctr7.ctr.mszip6.ts->ctr6; + } else if (*r->out.level_out == 7 && + r->out.ctr->ctr7.level == 6 && + r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS && + r->out.ctr->ctr7.ctr.xpress6.ts) { ctr_level = 6; - ctr6 = &r->out.ctr.ctr7.ctr.xpress6.ts->ctr6; + ctr6 = &r->out.ctr->ctr7.ctr.xpress6.ts->ctr6; } else { return WERR_BAD_NET_RESP; } @@ -2908,8 +2909,8 @@ static NTSTATUS becomeDC_ldap2_move_computer(struct libnet_BecomeDC_state *s) s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap2.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", _1_1_attrs, &r); + ret = ldb_search(s->ldap2.ldb, s, &r, basedn, LDB_SCOPE_BASE, + _1_1_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index 5776888cb0..0ed5e8ae26 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -27,7 +27,7 @@ #include "param/secrets.h" #include "dsdb/samdb/samdb.h" #include "ldb_wrap.h" -#include "util/util_ldb.h" +#include "../lib/util/util_ldb.h" #include "libcli/security/security.h" #include "auth/credentials/credentials.h" #include "auth/credentials/credentials_krb5.h" @@ -162,13 +162,19 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J ZERO_STRUCT(r_crack_names); r_crack_names.in.bind_handle = &drsuapi_bind_handle; r_crack_names.in.level = 1; - r_crack_names.in.req.req1.codepage = 1252; /* western european */ - r_crack_names.in.req.req1.language = 0x00000407; /* german */ - r_crack_names.in.req.req1.count = 1; - r_crack_names.in.req.req1.names = names; - r_crack_names.in.req.req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS; - r_crack_names.in.req.req1.format_offered= DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY; - r_crack_names.in.req.req1.format_desired= DRSUAPI_DS_NAME_FORMAT_FQDN_1779; + r_crack_names.in.req = talloc(r, union drsuapi_DsNameRequest); + if (!r_crack_names.in.req) { + r->out.error_string = NULL; + talloc_free(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } + r_crack_names.in.req->req1.codepage = 1252; /* western european */ + r_crack_names.in.req->req1.language = 0x00000407; /* german */ + r_crack_names.in.req->req1.count = 1; + r_crack_names.in.req->req1.names = names; + r_crack_names.in.req->req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS; + r_crack_names.in.req->req1.format_offered = DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY; + r_crack_names.in.req->req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; names[0].str = dom_sid_string(tmp_ctx, r->out.account_sid); if (!names[0].str) { r->out.error_string = NULL; @@ -176,6 +182,14 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J return NT_STATUS_NO_MEMORY; } + r_crack_names.out.ctr = talloc(r, union drsuapi_DsNameCtr); + r_crack_names.out.level_out = talloc(r, int32_t); + if (!r_crack_names.out.ctr || !r_crack_names.out.level_out) { + r->out.error_string = NULL; + talloc_free(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } + status = dcerpc_drsuapi_DsCrackNames(drsuapi_pipe, tmp_ctx, &r_crack_names); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { @@ -201,24 +215,24 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J "DsCrackNames failed - %s", win_errstr(r_crack_names.out.result)); talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; - } else if (r_crack_names.out.level != 1 - || !r_crack_names.out.ctr.ctr1 - || r_crack_names.out.ctr.ctr1->count != 1) { + } else if (*r_crack_names.out.level_out != 1 + || !r_crack_names.out.ctr->ctr1 + || r_crack_names.out.ctr->ctr1->count != 1) { r->out.error_string = talloc_asprintf(r, "DsCrackNames failed"); talloc_free(tmp_ctx); return NT_STATUS_INVALID_PARAMETER; - } else if (r_crack_names.out.ctr.ctr1->array[0].status != DRSUAPI_DS_NAME_STATUS_OK) { - r->out.error_string = talloc_asprintf(r, "DsCrackNames failed: %d", r_crack_names.out.ctr.ctr1->array[0].status); + } else if (r_crack_names.out.ctr->ctr1->array[0].status != DRSUAPI_DS_NAME_STATUS_OK) { + r->out.error_string = talloc_asprintf(r, "DsCrackNames failed: %d", r_crack_names.out.ctr->ctr1->array[0].status); talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; - } else if (r_crack_names.out.ctr.ctr1->array[0].result_name == NULL) { + } else if (r_crack_names.out.ctr->ctr1->array[0].result_name == NULL) { r->out.error_string = talloc_asprintf(r, "DsCrackNames failed: no result name"); talloc_free(tmp_ctx); return NT_STATUS_INVALID_PARAMETER; } /* Store the DN of our machine account. */ - account_dn_str = r_crack_names.out.ctr.ctr1->array[0].result_name; + account_dn_str = r_crack_names.out.ctr->ctr1->array[0].result_name; /* Now we know the user's DN, open with LDAP, read and modify a few things */ @@ -248,8 +262,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J } /* search for the user's record */ - ret = ldb_search(remote_ldb, account_dn, LDB_SCOPE_BASE, - NULL, attrs, &res); + ret = ldb_search(remote_ldb, tmp_ctx, &res, + account_dn, LDB_SCOPE_BASE, attrs, NULL); if (ret != LDB_SUCCESS) { r->out.error_string = talloc_asprintf(r, "ldb_search for %s failed - %s", account_dn_str, ldb_errstring(remote_ldb)); @@ -257,8 +271,6 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J return NT_STATUS_UNSUCCESSFUL; } - talloc_steal(tmp_ctx, res); - if (res->count != 1) { r->out.error_string = talloc_asprintf(r, "ldb_search for %s failed - found %d entries", account_dn_str, res->count); @@ -330,8 +342,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J } /* DsCrackNames to find out the DN of the domain. */ - r_crack_names.in.req.req1.format_offered = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT; - r_crack_names.in.req.req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; + r_crack_names.in.req->req1.format_offered = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT; + r_crack_names.in.req->req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; names[0].str = talloc_asprintf(tmp_ctx, "%s\\", r->out.domain_name); if (!names[0].str) { r->out.error_string = NULL; @@ -364,11 +376,11 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J "DsCrackNames failed - %s", win_errstr(r_crack_names.out.result)); talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; - } else if (r_crack_names.out.level != 1 - || !r_crack_names.out.ctr.ctr1 - || r_crack_names.out.ctr.ctr1->count != 1 - || !r_crack_names.out.ctr.ctr1->array[0].result_name - || r_crack_names.out.ctr.ctr1->array[0].status != DRSUAPI_DS_NAME_STATUS_OK) { + } else if (*r_crack_names.out.level_out != 1 + || !r_crack_names.out.ctr->ctr1 + || r_crack_names.out.ctr->ctr1->count != 1 + || !r_crack_names.out.ctr->ctr1->array[0].result_name + || r_crack_names.out.ctr->ctr1->array[0].status != DRSUAPI_DS_NAME_STATUS_OK) { r->out.error_string = talloc_asprintf(r, "DsCrackNames failed"); talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; @@ -379,8 +391,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J talloc_steal(r, account_dn_str); /* Store the domain DN. */ - r->out.domain_dn_str = r_crack_names.out.ctr.ctr1->array[0].result_name; - talloc_steal(r, r_crack_names.out.ctr.ctr1->array[0].result_name); + r->out.domain_dn_str = r_crack_names.out.ctr->ctr1->array[0].result_name; + talloc_steal(r, r_crack_names.out.ctr->ctr1->array[0].result_name); /* Store the KVNO of the account, critical for some kerberos * operations */ diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index cab4d9e73f..dc54ec3cf1 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -129,7 +129,7 @@ NTSTATUS libnet_Lookup_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, if (NT_STATUS_IS_OK(status)) { s = talloc_get_type(c->private_data, struct lookup_state); - io->out.address = str_list_make(mem_ctx, s->address, NULL); + io->out.address = (const char **)str_list_make(mem_ctx, s->address, NULL); NT_STATUS_HAVE_NO_MEMORY(io->out.address); } diff --git a/source4/libnet/libnet_passwd.c b/source4/libnet/libnet_passwd.c index 28d9ae8cbe..de2ed01abd 100644 --- a/source4/libnet/libnet_passwd.c +++ b/source4/libnet/libnet_passwd.c @@ -20,7 +20,7 @@ #include "includes.h" #include "libnet/libnet.h" -#include "lib/crypto/crypto.h" +#include "../lib/crypto/crypto.h" #include "libcli/auth/libcli_auth.h" #include "librpc/gen_ndr/ndr_samr_c.h" diff --git a/source4/libnet/libnet_samdump.c b/source4/libnet/libnet_samdump.c index 9d417d280d..1fe07b60dc 100644 --- a/source4/libnet/libnet_samdump.c +++ b/source4/libnet/libnet_samdump.c @@ -22,7 +22,7 @@ #include "includes.h" #include "libnet/libnet.h" -#include "lib/util/dlinklist.h" +#include "../lib/util/dlinklist.h" #include "samba3/samba3.h" #include "libcli/security/security.h" diff --git a/source4/libnet/libnet_samdump_keytab.c b/source4/libnet/libnet_samdump_keytab.c index 0c4d3e5c59..4b71b0c24d 100644 --- a/source4/libnet/libnet_samdump_keytab.c +++ b/source4/libnet/libnet_samdump_keytab.c @@ -68,6 +68,11 @@ static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } +struct libnet_samdump_keytab_data { + const char *keytab_name; + struct loadparm_context *lp_ctx; +}; + static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx, void *private, enum netr_SamDatabaseID database, @@ -75,8 +80,7 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx, char **error_string) { NTSTATUS nt_status = NT_STATUS_OK; - const char *keytab_name = private; - + struct libnet_samdump_keytab_data *data = private; *error_string = NULL; switch (delta->delta_type) { case NETR_DELTA_USER: @@ -85,8 +89,8 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx, if (database == SAM_DATABASE_DOMAIN) { nt_status = samdump_keytab_handle_user(mem_ctx, event_context_find(mem_ctx), - global_loadparm, - keytab_name, + data->lp_ctx, + data->keytab_name, delta); break; } @@ -101,14 +105,18 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx, NTSTATUS libnet_SamDump_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r) { NTSTATUS nt_status; + struct libnet_samdump_keytab_data data; struct libnet_SamSync r2; + data.keytab_name = r->in.keytab_name; + data.lp_ctx = ctx->lp_ctx; + r2.out.error_string = NULL; r2.in.binding_string = r->in.binding_string; r2.in.rid_crypt = true; r2.in.init_fn = NULL; r2.in.delta_fn = libnet_samdump_keytab_fn; - r2.in.fn_ctx = discard_const(r->in.keytab_name); + r2.in.fn_ctx = &data; r2.in.machine_account = r->in.machine_account; nt_status = libnet_SamSync_netlogon(ctx, mem_ctx, &r2); r->out.error_string = r2.out.error_string; diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c index c72aef7d70..8b7dd1f598 100644 --- a/source4/libnet/libnet_samsync_ldb.c +++ b/source4/libnet/libnet_samsync_ldb.c @@ -27,7 +27,7 @@ #include "libcli/ldap/ldap_ndr.h" #include "dsdb/samdb/samdb.h" #include "auth/auth.h" -#include "util/util_ldb.h" +#include "../lib/util/util_ldb.h" #include "librpc/gen_ndr/ndr_misc.h" #include "ldb_wrap.h" #include "libcli/security/security.h" diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c index bb65de1f54..4a32ab92ed 100644 --- a/source4/libnet/libnet_site.c +++ b/source4/libnet/libnet_site.c @@ -56,9 +56,10 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; search.in.map_response = true; - cldap = cldap_socket_init(tmp_ctx, lctx->event_ctx, lp_iconv_convenience(global_loadparm)); + cldap = cldap_socket_init(tmp_ctx, lctx->event_ctx, lp_iconv_convenience(lctx->lp_ctx)); status = cldap_netlogon(cldap, tmp_ctx, &search); - if (!NT_STATUS_IS_OK(status) || !search.out.netlogon.nt5_ex.client_site) { + if (!NT_STATUS_IS_OK(status) + || !search.out.netlogon.data.nt5_ex.client_site) { /* If cldap_netlogon() returns in error, default to using Default-First-Site-Name. @@ -72,7 +73,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li } } else { site_name_str = talloc_asprintf(tmp_ctx, "%s", - search.out.netlogon.nt5_ex.client_site); + search.out.netlogon.data.nt5_ex.client_site); if (!site_name_str) { r->out.error_string = NULL; talloc_free(tmp_ctx); diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index 6a42fa2370..79c6dc0fc1 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -289,7 +289,7 @@ static void unbecomeDC_recv_cldap(struct cldap_request *req) c->status = cldap_netlogon_recv(req, s, &s->cldap.io); if (!composite_is_ok(c)) return; - s->cldap.netlogon = s->cldap.io.out.netlogon.nt5_ex; + s->cldap.netlogon = s->cldap.io.out.netlogon.data.nt5_ex; s->domain.dns_name = s->cldap.netlogon.dns_domain; s->domain.netbios_name = s->cldap.netlogon.domain; @@ -337,8 +337,8 @@ static NTSTATUS unbecomeDC_ldap_rootdse(struct libnet_UnbecomeDC_state *s) basedn = ldb_dn_new(s, s->ldap.ldb, NULL); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->ldap.ldb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -346,7 +346,6 @@ static NTSTATUS unbecomeDC_ldap_rootdse(struct libnet_UnbecomeDC_state *s) talloc_free(r); return NT_STATUS_INVALID_NETWORK_RESPONSE; } - talloc_steal(s, r); s->domain.dn_str = ldb_msg_find_attr_as_string(r->msgs[0], "defaultNamingContext", NULL); if (!s->domain.dn_str) return NT_STATUS_INVALID_NETWORK_RESPONSE; @@ -371,7 +370,6 @@ static NTSTATUS unbecomeDC_ldap_computer_object(struct libnet_UnbecomeDC_state * int ret; struct ldb_result *r; struct ldb_dn *basedn; - char *filter; static const char *attrs[] = { "distinguishedName", "userAccountControl", @@ -381,12 +379,9 @@ static NTSTATUS unbecomeDC_ldap_computer_object(struct libnet_UnbecomeDC_state * basedn = ldb_dn_new(s, s->ldap.ldb, s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - filter = talloc_asprintf(basedn, "(&(|(objectClass=user)(objectClass=computer))(sAMAccountName=%s$))", - s->dest_dsa.netbios_name); - NT_STATUS_HAVE_NO_MEMORY(filter); - - ret = ldb_search(s->ldap.ldb, basedn, LDB_SCOPE_SUBTREE, - filter, attrs, &r); + ret = ldb_search(s->ldap.ldb, s, &r, basedn, LDB_SCOPE_SUBTREE, attrs, + "(&(|(objectClass=user)(objectClass=computer))(sAMAccountName=%s$))", + s->dest_dsa.netbios_name); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -462,8 +457,8 @@ static NTSTATUS unbecomeDC_ldap_move_computer(struct libnet_UnbecomeDC_state *s) s->domain.dn_str); NT_STATUS_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->ldap.ldb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", _1_1_attrs, &r); + ret = ldb_search(s->ldap.ldb, s, &r, basedn, LDB_SCOPE_BASE, + _1_1_attrs, "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return NT_STATUS_LDAP(ret); @@ -644,9 +639,13 @@ static void unbecomeDC_drsuapi_remove_ds_server_send(struct libnet_UnbecomeDC_st r->in.bind_handle = &s->drsuapi.bind_handle; r->in.level = 1; - r->in.req.req1.server_dn= s->dest_dsa.server_dn_str; - r->in.req.req1.domain_dn= s->domain.dn_str; - r->in.req.req1.unknown = 0x00000001; + r->in.req = talloc(s, union drsuapi_DsRemoveDSServerRequest); + r->in.req->req1.server_dn = s->dest_dsa.server_dn_str; + r->in.req->req1.domain_dn = s->domain.dn_str; + r->in.req->req1.commit = true; + + r->out.level_out = talloc(s, int32_t); + r->out.res = talloc(s, union drsuapi_DsRemoveDSServerResult); req = dcerpc_drsuapi_DsRemoveDSServer_send(s->drsuapi.pipe, s, r); composite_continue_rpc(c, req, unbecomeDC_drsuapi_remove_ds_server_recv, s); @@ -667,15 +666,10 @@ static void unbecomeDC_drsuapi_remove_ds_server_recv(struct rpc_request *req) return; } - if (r->out.level != 1) { + if (*r->out.level_out != 1) { composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE); return; } - - if (!W_ERROR_IS_OK(r->out.res.res1.status)) { - composite_error(c, werror_to_ntstatus(r->out.res.res1.status)); - return; - } composite_done(c); } diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 42d6f72dd1..7b686ba007 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -26,7 +26,7 @@ #include "libnet/libnet.h" #include "lib/events/events.h" #include "dsdb/samdb/samdb.h" -#include "lib/util/dlinklist.h" +#include "../lib/util/dlinklist.h" #include "lib/ldb/include/ldb.h" #include "lib/ldb/include/ldb_errors.h" #include "librpc/ndr/libndr.h" diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 3736454fa0..d5495f1e72 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -24,7 +24,7 @@ #include "libcli/security/security.h" #include "lib/events/events.h" -struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev) +static struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev) { /* FIXME: Use obj */ return libnet_context_init(ev, global_loadparm); diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c index 847997fc12..e8b6b090c7 100644 --- a/source4/libnet/userinfo.c +++ b/source4/libnet/userinfo.c @@ -29,6 +29,7 @@ #include "libnet/userman.h" #include "libnet/userinfo.h" #include "librpc/gen_ndr/ndr_samr_c.h" +#include "libnet/libnet_proto.h" struct userinfo_state { diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c index 25ed4775cb..398d9f2cb0 100644 --- a/source4/libnet/userman.c +++ b/source4/libnet/userman.c @@ -27,6 +27,7 @@ #include "libnet/userman.h" #include "libnet/userinfo.h" #include "librpc/gen_ndr/ndr_samr_c.h" +#include "libnet/libnet_proto.h" /* * Composite USER ADD functionality |