Author: brad
Date: 2005-08-04 16:17:47 +0000 (Thu, 04 Aug 2005)
New Revision: 9062

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9062

Log:
 [EMAIL PROTECTED]:  j0j0 | 2005-08-04 10:21:34 -0600
 Some more work towards performing a dc join.

Modified:
   branches/SOC/SAMBA_4_0/
   branches/SOC/SAMBA_4_0/source/torture/rpc/dssync.c


Changeset:

Property changes on: branches/SOC/SAMBA_4_0
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:9033
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5249
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5244
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:9033
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5250
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5244

Modified: branches/SOC/SAMBA_4_0/source/torture/rpc/dssync.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/torture/rpc/dssync.c  2005-08-04 16:17:36 UTC 
(rev 9061)
+++ branches/SOC/SAMBA_4_0/source/torture/rpc/dssync.c  2005-08-04 16:17:47 UTC 
(rev 9062)
@@ -45,6 +45,7 @@
        struct ldb_context *ldb_ctx;
        struct ldb_message *ldb_msg;
        struct libnet_context *libnet_ctx;
+       struct libnet_Join *libnet_r;
        const char *ldap_url;
 
        const char *domain_dn;
@@ -123,6 +124,9 @@
 
        ctx->new_dc.invocation_id = GUID_random();
        /* ctx->old_dc ...*/
+       
+       ctx->ldb_ctx = ldb_init(mem_ctx);
+       ctx->libnet_ctx = libnet_context_init(mem_ctx);
 
        return ctx;
 }
@@ -708,30 +712,30 @@
 
                attribute_ctr->num_attributes           = i;
                
-               
-               
-               printf("The libnet_Join struct has a domain_name element. I am 
going to assume it is my ldap base dn.\n");
-               printf("That said, my ldap base dn is: %s.\n",ctx->domain_dn);
-               /* ctx->domain_dn is the ldap dn.*/ 
-               libnet_r.in.domain_name = 
talloc_asprintf(ctx,"%s",ctx->domain_dn);
+               libnet_r.in.domain_name = ctx->admin.credentials->domain;
                libnet_r.in.secure_channel_type = SEC_CHAN_BDC;
  
-               printf("attempting a DC join with libnet_Join()\n");
+               printf("attempting a DC join with 
libnet_Join(%s)\n",libnet_r.in.domain_name);
                /*
-               we get the following error when libnet_Join gets reached,
-               probably because we haven't provisioned these ldb's!
-               Unable to open tdb '/usr/local/samba/private/secrets.ldb'
-               Failed to connect to '/usr/local/samba/private/secrets.ldb'
+               if you haven't run the provision script, you get:
+                       Unable to open tdb 
'/usr/local/samba/private/secrets.ldb'
+                       Failed to connect to 
'/usr/local/samba/private/secrets.ldb'
+               when libnet_Join() is called.
+               
+               libnet_r.in.domain_name is a netbios domain name.
                */
-               status = libnet_Join(ctx->libnet_ctx,ctx,&libnet_r);
+               
+               status = libnet_Join(ctx->libnet_ctx, ctx, &libnet_r);
                if (!NT_STATUS_IS_OK(status)) {
                        const char *errstr = nt_errstr(status);
                        if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) 
{
                                errstr = dcerpc_errstr(ctx, 
ctx->admin.drsuapi.pipe->last_fault_code);
                        }
                        printf("libnet_Join() failed - %s\n", errstr);
+                       printf("libnet_r.out.error_string returned: 
%s\n",libnet_r.out.error_string);
                        ret = False;
                }
+               
                /*
                status = dcerpc_drsuapi_DsAddEntry(ctx->admin.drsuapi.pipe, 
ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
@@ -804,8 +808,10 @@
        
        mem_ctx = talloc_init("torture_rpc_dssync");
        ctx = test_create_context(mem_ctx);
+       /*
        ctx->ldb_ctx = ldb_init(mem_ctx);
-       ctx->libnet_ctx = libnet_context_init(mem_ctx);
+       ctx->libnet_ctx = libnet_context_init(mem_ctx);  
+       */
        rtn = ldb_connect(ctx->ldb_ctx,ctx->ldap_url,0,NULL);
        printf("Connected to %s.\n",ctx->ldap_url);
        

Reply via email to