summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-04-08 17:26:55 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-04-08 17:26:55 +1000
commit3f2e403a8672323517e9a5efc4026d58f22fe75b (patch)
treef01240b0e7f8deb6bd5629bea1afec033fea904a /source4
parent5454dc044da9e3c91fca6e55659a6d6a44179b4f (diff)
downloadsamba-3f2e403a8672323517e9a5efc4026d58f22fe75b.tar.gz
samba-3f2e403a8672323517e9a5efc4026d58f22fe75b.tar.bz2
samba-3f2e403a8672323517e9a5efc4026d58f22fe75b.zip
Rework talloc hirarchy for C provision setup.
This seems to fix (or sweep under the covers) a crash in this code. Andrew Bartlett (This used to be commit 2fcddfe583f9833cea80d02e08ac12dd1f91742c)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/local/torture.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c
index bb6e21ed4f..9bd60d9620 100644
--- a/source4/torture/local/torture.c
+++ b/source4/torture/local/torture.c
@@ -42,27 +42,28 @@ static bool test_tempdir(struct torture_context *tctx)
static bool test_provision(struct torture_context *tctx)
{
NTSTATUS status;
- struct provision_settings settings;
- char *location = NULL;
- torture_assert_ntstatus_ok(tctx, torture_temp_dir(tctx, "torture_provision", &location),
+ struct provision_settings *settings = talloc(tctx, struct provision_settings);
+ char *targetdir = NULL;
+
+ torture_assert_ntstatus_ok(tctx, torture_temp_dir(tctx, "torture_provision", &targetdir),
"torture_temp_dir should return NT_STATUS_OK" );
+ settings->targetdir = talloc_steal(settings, targetdir);
- settings.dns_name = "example.com";
- settings.site_name = "SOME-SITE-NAME";
- settings.root_dn_str = "DC=EXAMPLE,DC=COM";
- settings.domain_dn_str = "DC=EXAMPLE,DC=COM";
- settings.config_dn_str = NULL;
- settings.schema_dn_str = NULL;
- settings.invocation_id = NULL;
- settings.netbios_name = "FOO";
- settings.realm = "EXAMPLE.COM";
- settings.domain = "EXAMPLE";
- settings.ntds_guid = NULL;
- settings.ntds_dn_str = NULL;
- settings.machine_password = "geheim";
- settings.targetdir = location;
+ settings->dns_name = "example.com";
+ settings->site_name = "SOME-SITE-NAME";
+ settings->root_dn_str = "DC=EXAMPLE,DC=COM";
+ settings->domain_dn_str = "DC=EXAMPLE,DC=COM";
+ settings->config_dn_str = NULL;
+ settings->schema_dn_str = NULL;
+ settings->invocation_id = NULL;
+ settings->netbios_name = "FOO";
+ settings->realm = "EXAMPLE.COM";
+ settings->domain = "EXAMPLE";
+ settings->ntds_guid = NULL;
+ settings->ntds_dn_str = NULL;
+ settings->machine_password = "geheim";
- status = provision_bare(tctx, tctx->lp_ctx, &settings);
+ status = provision_bare(settings, tctx->lp_ctx, settings);
torture_assert_ntstatus_ok(tctx, status, "provision");