svn commit: samba r26382 - in branches/SAMBA_4_0: . source/auth/credentials source/libcli/wrepl source/librpc/rpc source/ntvfs/ipc source/param source/rpc_server/srvsvc source/smb_server source/torture source/torture/nbt source/wrepl_server

jelmer at samba.org jelmer at samba.org
Mon Dec 10 18:41:58 GMT 2007


Author: jelmer
Date: 2007-12-10 18:41:55 +0000 (Mon, 10 Dec 2007)
New Revision: 26382

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

Log:
Remove more uses of global_loadparm.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/auth/credentials/credentials.c
   branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c
   branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.h
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
   branches/SAMBA_4_0/source/ntvfs/ipc/rap_server.c
   branches/SAMBA_4_0/source/param/share.c
   branches/SAMBA_4_0/source/rpc_server/srvsvc/dcesrv_srvsvc.c
   branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/torture/masktest.c
   branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/auth/credentials/credentials.c
===================================================================
--- branches/SAMBA_4_0/source/auth/credentials/credentials.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/auth/credentials/credentials.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -82,7 +82,6 @@
 	struct cli_credentials *anon_credentials;
 
 	anon_credentials = cli_credentials_init(mem_ctx);
-	cli_credentials_set_conf(anon_credentials, global_loadparm);
 	cli_credentials_set_anonymous(anon_credentials);
 
 	return anon_credentials;
@@ -720,6 +719,7 @@
 	cli_credentials_set_username(cred, "", CRED_SPECIFIED);
 	cli_credentials_set_domain(cred, "", CRED_SPECIFIED);
 	cli_credentials_set_password(cred, NULL, CRED_SPECIFIED);
+	cli_credentials_set_realm(cred, NULL, CRED_SPECIFIED);
 }
 
 /**

Modified: branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -313,6 +313,7 @@
   connect a wrepl_socket to a WINS server
 */
 struct composite_context *wrepl_connect_send(struct wrepl_socket *wrepl_socket,
+					     struct resolve_context *resolve_ctx,
 					     const char *our_ip, const char *peer_ip)
 {
 	struct composite_context *result;
@@ -344,7 +345,7 @@
 	if (composite_nomem(peer, result)) return result;
 
 	state->creq = socket_connect_send(wrepl_socket->sock, us, peer,
-					  0, lp_resolve_context(global_loadparm), 
+					  0, resolve_ctx,
 					  wrepl_socket->event.ctx);
 	composite_continue(result, state->creq, wrepl_connect_handler, state);
 	return result;
@@ -371,9 +372,10 @@
 /*
   connect a wrepl_socket to a WINS server - sync API
 */
-NTSTATUS wrepl_connect(struct wrepl_socket *wrepl_socket, const char *our_ip, const char *peer_ip)
+NTSTATUS wrepl_connect(struct wrepl_socket *wrepl_socket, struct resolve_context *resolve_ctx,
+		       const char *our_ip, const char *peer_ip)
 {
-	struct composite_context *c_req = wrepl_connect_send(wrepl_socket, our_ip, peer_ip);
+	struct composite_context *c_req = wrepl_connect_send(wrepl_socket, resolve_ctx, our_ip, peer_ip);
 	return wrepl_connect_recv(c_req);
 }
 

Modified: branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.h	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.h	2007-12-10 18:41:55 UTC (rev 26382)
@@ -154,4 +154,6 @@
 	} out;
 };
 
+struct resolve_context;
+
 #include "libcli/wrepl/winsrepl_proto.h"

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -939,7 +939,6 @@
 	/* anonymous credentials for rpc connection used to get endpoint mapping */
 	anon_creds = cli_credentials_init(mem_ctx);
 	cli_credentials_set_event_context(anon_creds, ev);
-	cli_credentials_set_conf(anon_creds, global_loadparm);
 	cli_credentials_set_anonymous(anon_creds);
 
 	/*

Modified: branches/SAMBA_4_0/source/ntvfs/ipc/rap_server.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/ipc/rap_server.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/ntvfs/ipc/rap_server.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -23,6 +23,7 @@
 #include "libcli/rap/rap.h"
 #include "librpc/gen_ndr/srvsvc.h"
 #include "rpc_server/common/common.h"
+#include "param/param.h"
 
 /* At this moment these are just dummy functions, but you might get the
  * idea. */
@@ -40,7 +41,7 @@
 	r->out.available = 0;
 	r->out.info = NULL;
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(global_loadparm), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return nterr;
 	}

Modified: branches/SAMBA_4_0/source/param/share.c
===================================================================
--- branches/SAMBA_4_0/source/param/share.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/param/share.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -126,9 +126,8 @@
 	return NT_STATUS_OK;
 }
 
-NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, 
-								   const char *backend_name,
-								   struct share_context **ctx)
+NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name,
+				   struct share_context **ctx)
 {
 	const struct share_ops *ops;
 
@@ -141,11 +140,6 @@
 	return ops->init(mem_ctx, ops, ctx);
 }
 
-NTSTATUS share_get_context(TALLOC_CTX *mem_ctx, struct share_context **ctx)
-{
-	return share_get_context_by_name(mem_ctx, lp_share_backend(global_loadparm), ctx);
-}
-
 /*
   initialise the SHARE subsystem
 */

Modified: branches/SAMBA_4_0/source/rpc_server/srvsvc/dcesrv_srvsvc.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/srvsvc/dcesrv_srvsvc.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/rpc_server/srvsvc/dcesrv_srvsvc.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -444,7 +444,7 @@
 		int count = 8;
 		int i;
 
-		nterr = share_get_context(mem_ctx, &sctx);
+		nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 		if (!NT_STATUS_IS_OK(nterr)) {
 			return ntstatus_to_werror(nterr);
 		}
@@ -542,7 +542,7 @@
 		int count = 10;
 		int i;
 
-		nterr = share_get_context(mem_ctx, &sctx);
+		nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 		if (!NT_STATUS_IS_OK(nterr)) {
 			return ntstatus_to_werror(nterr);
 		}
@@ -734,7 +734,7 @@
 	/* TODO: - paging of results 
 	 */
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}
@@ -983,7 +983,7 @@
 		return WERR_INVALID_PARAM;
 	}
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}
@@ -1237,7 +1237,7 @@
 		return WERR_INVALID_PARAM;
 	}
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}
@@ -1414,7 +1414,7 @@
 	}
 	all_string_sub(device, "\\", "/", 0);
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}
@@ -1828,7 +1828,7 @@
 	/* TODO: - paging of results 
 	 */
 
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}
@@ -2291,7 +2291,7 @@
 	NTSTATUS nterr;
 	struct share_context *sctx;
 		
-	nterr = share_get_context(mem_ctx, &sctx);
+	nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(nterr)) {
 		return ntstatus_to_werror(nterr);
 	}

Modified: branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -25,6 +25,7 @@
 #include "rpc_server/common/common.h"
 #include "rpc_server/srvsvc/proto.h"
 #include "lib/socket/socket.h"
+#include "param/param.h"
 
 struct socket_address *srvsvc_get_my_addr(void *p, TALLOC_CTX *mem_ctx)
 {
@@ -61,7 +62,7 @@
 	struct share_config *scfg;
 	const char *sharetype;
 
-	status = share_get_context(mem_ctx, &sctx);
+	status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx);
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb_server.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -156,7 +156,8 @@
 
 	smbsrv_management_init(smb_conn);
 
-	if (!NT_STATUS_IS_OK(share_get_context(smb_conn, &(smb_conn->share_context)))) {
+	if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lp_share_backend(smb_conn->lp_ctx), 
+						       &(smb_conn->share_context)))) {
 		smbsrv_terminate_connection(smb_conn, "share_init failed!");
 		return;
 	}

Modified: branches/SAMBA_4_0/source/torture/masktest.c
===================================================================
--- branches/SAMBA_4_0/source/torture/masktest.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/torture/masktest.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -287,8 +287,6 @@
 
 	setup_logging("masktest", DEBUG_STDOUT);
 
-	lp_set_cmdline(global_loadparm, "log level", "0");
-
 	if (argc < 2 || argv[1][0] == '-') {
 		usage();
 		exit(1);

Modified: branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/winsreplication.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/torture/nbt/winsreplication.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -107,10 +107,10 @@
 	wrepl_socket2 = wrepl_socket_init(tctx, NULL);
 
 	torture_comment(tctx, "Setup 2 wrepl connections\n");
-	status = wrepl_connect(wrepl_socket1, NULL, address);
+	status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), NULL, address);
 	CHECK_STATUS(tctx, status, NT_STATUS_OK);
 
-	status = wrepl_connect(wrepl_socket2, NULL, address);
+	status = wrepl_connect(wrepl_socket2, lp_resolve_context(tctx->lp_ctx), NULL, address);
 	CHECK_STATUS(tctx, status, NT_STATUS_OK);
 
 	torture_comment(tctx, "Send a start association request (conn1)\n");
@@ -189,7 +189,7 @@
 	wrepl_socket = wrepl_socket_init(tctx, NULL);
 	
 	torture_comment(tctx, "Setup wrepl connections\n");
-	status = wrepl_connect(wrepl_socket, NULL, address);
+	status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address);
 	CHECK_STATUS(tctx, status, NT_STATUS_OK);
 
 	torture_comment(tctx, "Send 1st start association request\n");
@@ -258,7 +258,7 @@
 	wrepl_socket = wrepl_socket_init(tctx, NULL);
 	
 	torture_comment(tctx, "Setup wrepl connections\n");
-	status = wrepl_connect(wrepl_socket, NULL, address);
+	status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address);
 	CHECK_STATUS(tctx, status, NT_STATUS_OK);
 
 	torture_comment(tctx, "Send a start association request\n");
@@ -556,7 +556,7 @@
 	if (!ctx->pull) return NULL;
 
 	torture_comment(tctx, "Setup wrepl conflict pull connection\n");
-	status = wrepl_connect(ctx->pull, NULL, ctx->address);
+	status = wrepl_connect(ctx->pull, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address);
 	if (!NT_STATUS_IS_OK(status)) return NULL;
 
 	status = wrepl_associate(ctx->pull, &associate);
@@ -721,7 +721,7 @@
 
 	wrepl_socket = wrepl_socket_init(ctx, NULL);
 
-	status = wrepl_connect(wrepl_socket, NULL, ctx->address);
+	status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address);
 	CHECK_STATUS(tctx, status, NT_STATUS_OK);
 
 	status = wrepl_associate(wrepl_socket, &associate);

Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c
===================================================================
--- branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c	2007-12-10 18:41:45 UTC (rev 26381)
+++ branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c	2007-12-10 18:41:55 UTC (rev 26382)
@@ -29,6 +29,7 @@
 #include "nbt_server/wins/winsdb.h"
 #include "libcli/composite/composite.h"
 #include "libcli/wrepl/winsrepl.h"
+#include "libcli/resolve/resolve.h"
 
 enum wreplsrv_out_connect_stage {
 	WREPLSRV_OUT_CONNECT_STAGE_WAIT_SOCKET,
@@ -191,6 +192,7 @@
 	state->stage	= WREPLSRV_OUT_CONNECT_STAGE_WAIT_SOCKET;
 	state->wreplconn= wreplconn;
 	state->c_req	= wrepl_connect_send(wreplconn->sock,
+					     lp_resolve_context(service->task->lp_ctx),
 					     partner->our_address,
 					     partner->address);
 	if (!state->c_req) goto failed;
@@ -379,8 +381,7 @@
 		struct wreplsrv_pull_table_state *state = talloc_get_type(c->private_data,
 							  struct wreplsrv_pull_table_state);
 		io->out.num_owners	= state->table_io.out.num_partners;
-		io->out.owners		= state->table_io.out.partners;
-		talloc_reference(mem_ctx, state->table_io.out.partners);
+		io->out.owners		= talloc_reference(mem_ctx, state->table_io.out.partners);
 	}
 
 	talloc_free(c);
@@ -535,8 +536,7 @@
 		struct wreplsrv_pull_names_state *state = talloc_get_type(c->private_data,
 							  struct wreplsrv_pull_names_state);
 		io->out.num_names	= state->pull_io.out.num_names;
-		io->out.names		= state->pull_io.out.names;
-		talloc_reference(mem_ctx, state->pull_io.out.names);
+		io->out.names		= talloc_reference(mem_ctx, state->pull_io.out.names);
 	}
 
 	talloc_free(c);



More information about the samba-cvs mailing list