svn commit: samba r10862 - in branches/SOC/SAMBA_4_0/source: libnet librpc/idl torture torture/rpc

metze at samba.org metze at samba.org
Mon Oct 10 08:31:55 GMT 2005


Author: metze
Date: 2005-10-10 08:31:52 +0000 (Mon, 10 Oct 2005)
New Revision: 10862

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

Log:
remove the differences between SAMBA_4_0 and SOC/SAMBA_4_0

metze
Modified:
   branches/SOC/SAMBA_4_0/source/libnet/libnet_join.c
   branches/SOC/SAMBA_4_0/source/librpc/idl/drsuapi.idl
   branches/SOC/SAMBA_4_0/source/torture/rpc/testjoin.c
   branches/SOC/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SOC/SAMBA_4_0/source/libnet/libnet_join.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/libnet/libnet_join.c	2005-10-10 07:45:58 UTC (rev 10861)
+++ branches/SOC/SAMBA_4_0/source/libnet/libnet_join.c	2005-10-10 08:31:52 UTC (rev 10862)
@@ -757,7 +757,7 @@
 	sc.out.connect_handle = &p_handle;
 
 	/* 2. do a samr_Connect to get a policy handle */
-	status = dcerpc_samr_Connect(samr_pipe, tmp_ctx, &sc);				
+	status = dcerpc_samr_Connect(samr_pipe, tmp_ctx, &sc);
 	if (!NT_STATUS_IS_OK(status)) {
 		r->out.error_string = talloc_asprintf(mem_ctx,
 						"samr_Connect failed: %s",
@@ -945,22 +945,6 @@
 			return status;
 		}
 	}
-	/*
-	 This code still has an issue in that it isn't storing the samr_pipe and the u_handle in mem_ctx,
-	 and so they aren't staying open once this function returns.
-	 Because of this, the RPC-NETLOGON torture test fails when trying to use the pipe and handle to leave 
-	 the domain. 
-	 
-	 Because they are local variables and not in a TALLOC_CTX, I can't talloc_steal() them.	 
-	*/
-	r->out.join_password = talloc_steal(mem_ctx, password_str);
-	r->out.domain_sid = talloc_steal(mem_ctx, domain_sid);
-	r->out.domain_name = talloc_steal(mem_ctx, domain_name);
-	r->out.realm = talloc_steal(mem_ctx, realm);
-	r->out.samr_pipe = samr_pipe;
-	r->out.samr_binding = talloc_steal(mem_ctx, samr_binding);
-	r->out.user_handle = u_handle;
-	r->out.error_string = talloc_steal(mem_ctx, r2.samr_handle.out.error_string);
 
 	account_sid = dom_sid_add_rid(mem_ctx, domain_sid, rid);
 	if (!account_sid) {
@@ -1009,8 +993,6 @@
 	return cu_status;
 }
 
-
-
 static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx, 
 					   TALLOC_CTX *mem_ctx, 
 					   struct libnet_Join *r)
@@ -1128,7 +1110,6 @@
 		talloc_free(tmp_mem);
 		return NT_STATUS_NO_MEMORY;
 	}
-	if (!msg) goto no_mem;
 
 	msg->dn = ldb_dn_build_child(tmp_mem, "flatname", r2->out.domain_name, base_dn);
 	if (!msg->dn) {
@@ -1288,10 +1269,6 @@
 	talloc_steal(mem_ctx, r2->out.domain_sid);
 	talloc_free(tmp_mem);
 	return NT_STATUS_OK;
-no_mem:
-	r->out.error_string = NULL;
-	talloc_free(tmp_mem);	
-	return NT_STATUS_NO_MEMORY;
 }
 
 NTSTATUS libnet_Join(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_Join *r)

Modified: branches/SOC/SAMBA_4_0/source/librpc/idl/drsuapi.idl
===================================================================
--- branches/SOC/SAMBA_4_0/source/librpc/idl/drsuapi.idl	2005-10-10 07:45:58 UTC (rev 10861)
+++ branches/SOC/SAMBA_4_0/source/librpc/idl/drsuapi.idl	2005-10-10 08:31:52 UTC (rev 10862)
@@ -371,9 +371,7 @@
 	 */
 
 	typedef [flag(NDR_PAHEX),v1_enum] enum {
-		DRSUAPI_OBJECTCLASS_top			= 0x00010000,
-		DRSUAPI_OBJECTCLASS_domain		= 0x000a0042,
-		DRSUAPI_OBJECTCLASS_domainDNS		= 0x000a0043
+		DRSUAPI_OBJECTCLASS_top			= 0x00010000
 	} drsuapi_DsObjectClassId;
 
 	typedef [flag(NDR_PAHEX),v1_enum,public] enum {
@@ -394,12 +392,7 @@
 		DRSUAPI_ATTRIBUTE_objectCategory	= 0x0009030e,
 		DRSUAPI_ATTRIBUTE_msDS_Behavior_Version	= 0x000905b3,
 		DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs	= 0x0009071c,
-		DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs	= 0x0009072c,
-		DRSUAPI_ATTRIBUTE_gPLink		= 0x0009037b,
-		DRSUAPI_ATTRIBUTE_instanceType		= 0x00020001,
-		DRSUAPI_ATTRIBUTE_whenCreated		= 0x00020002,
-		DRSUAPI_ATTRIBUTE_fSMORoleOwner		= 0x00090171,
-		DRSUAPI_ATTRIBUTE_wellKnownObjects	= 0x0009026a
+		DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs	= 0x0009072c
 	} drsuapi_DsAttributeId;
 
 	/* Generic DATA_BLOB values */

Modified: branches/SOC/SAMBA_4_0/source/torture/rpc/testjoin.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/torture/rpc/testjoin.c	2005-10-10 07:45:58 UTC (rev 10861)
+++ branches/SOC/SAMBA_4_0/source/torture/rpc/testjoin.c	2005-10-10 08:31:52 UTC (rev 10862)
@@ -4,7 +4,6 @@
    utility code to join/leave a domain
 
    Copyright (C) Andrew Tridgell 2004
-   Copyright (C) Brad Henry 2005
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,8 +28,6 @@
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "system/time.h"
-#include "libnet/libnet.h"
-#include "lib/cmdline/popt_common.h"
 #include "lib/crypto/crypto.h"
 #include "libnet/libnet.h"
 #include "lib/cmdline/popt_common.h"
@@ -38,7 +35,7 @@
 
 
 struct test_join {
-	struct dcerpc_pipe *p; /* SAMR pipe */
+	struct dcerpc_pipe *p;
 	struct policy_handle user_handle;
 	struct libnet_JoinDomain *libnet_r;
 	const char *dom_sid;
@@ -130,8 +127,7 @@
 	ZERO_STRUCTP(join);
 
 	printf("Connecting to SAMR\n");
-	
-	/*torture_rpc_connection opens the rpc connection with cmdline_credentials.*/
+
 	status = torture_rpc_connection(join, 
 					&join->p, 
 					DCERPC_SAMR_NAME,
@@ -280,8 +276,7 @@
 }
 
 
-struct test_join *torture_join_domain(TALLOC_CTX *mem_ctx, 
-				      const char *machine_name, 
+struct test_join *torture_join_domain(const char *machine_name, 
 				      uint32_t acct_flags,
 				      struct cli_credentials **machine_credentials)
 {
@@ -405,65 +400,6 @@
 		return NULL;
 	}
 
-	*/
-	
-	struct libnet_context *libnet_ctx;
-	struct libnet_JoinDomain *libnet_r;
-	struct test_join *tj;
-	NTSTATUS status;
-
-	
-	libnet_r = talloc(mem_ctx, struct libnet_JoinDomain);
-	
-	libnet_ctx = libnet_context_init(NULL);
-	if (libnet_ctx == NULL) {
-		return NULL;
-	}
-	libnet_ctx->cred = cmdline_credentials;
-	libnet_r->in.domain_name = domain;
-	libnet_r->in.level = LIBNET_JOIN_SPECIFIED; 
-	libnet_r->in.netbios_name = machine_name;
-	libnet_r->in.account_name = talloc_asprintf(libnet_r, "%s$", libnet_r->in.netbios_name);
-	libnet_r->in.acct_type = acct_flags;
-
-	/*
-	 Call libnet_JoinDomain() rather than libnet_Join() -- it calls libnet_Join_primary_domain(), which puts 
-	 the machine acct info into secrets.tdb. We don't want that for a torture_join.
-	 */	
-	printf("Joining domain.\n");
-	
-	status = libnet_JoinDomain(libnet_ctx, mem_ctx, libnet_r);
-	if (!NT_STATUS_IS_OK(status)) {
-		return NULL;
-	}
-
-	tj = talloc(mem_ctx, struct test_join);
-	tj->p = libnet_r->out.samr_pipe;
-	tj->user_handle = libnet_r->out.user_handle;
-	tj->dom_sid = dom_sid_string(tj, libnet_r->out.domain_sid);
-	*machine_password = talloc_steal(tj, libnet_r->out.join_password);
-	
-	/*
-	  Leave domain. This will ensure that the info for the torture machine
-	  acct is what we are expecting when we rejoin again.
-	*/
-	printf("Leaving domain.\n");
-	torture_leave_domain(tj);
-	
-	printf("Joining domain.\n");
-	
-	status = libnet_JoinDomain(libnet_ctx, mem_ctx, libnet_r);
-	if (!NT_STATUS_IS_OK(status)) {
-		return NULL;
-	}
-	
-	tj = talloc(mem_ctx, struct test_join);
-	tj->p = libnet_r->out.samr_pipe;
-	tj->user_handle = libnet_r->out.user_handle;
-	tj->dom_sid = dom_sid_string(tj, libnet_r->out.domain_sid);
-	*machine_password = talloc_steal(tj, libnet_r->out.join_password);
-			
-	printf("torture_join_domain() complete.\n");
 	return tj;
 }
 
@@ -552,8 +488,6 @@
 
 	if (!join) {
 		return;
-	} else {
-		 printf("torture_leave_domain(): GUID_all_zero(&join->user_handle.uuid) returned true, dcerpc_samr_DeleteUser() not called.\n");
 	}
 	d.in.user_handle = &join->user_handle;
 	d.out.user_handle = &join->user_handle;
@@ -586,7 +520,7 @@
 	struct test_join *join;
 };
 
-struct test_join_ads_dc *torture_join_domain_ads_dc(TALLOC_CTX *mem_ctx, const char *machine_name, 
+struct test_join_ads_dc *torture_join_domain_ads_dc(const char *machine_name, 
 						    const char *domain,
 						    struct cli_credentials **machine_credentials)
 {

Modified: branches/SOC/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/torture/torture.c	2005-10-10 07:45:58 UTC (rev 10861)
+++ branches/SOC/SAMBA_4_0/source/torture/torture.c	2005-10-10 08:31:52 UTC (rev 10862)
@@ -2354,6 +2354,8 @@
 	{"NET-API-LOOKUPPDC", torture_lookup_pdc, 0},
 	{"NET-API-CREATEUSER", torture_createuser, 0},
 	{"NET-API-RPCCONNECT", torture_rpc_connect, 0},
+	{"NET-API-LISTSHARES", torture_listshares, 0},
+	{"NET-API-DELSHARE", torture_delshare, 0},
 
 	{NULL, NULL, 0}};
 



More information about the samba-cvs mailing list