[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Thu Jul 12 18:52:02 MDT 2012


The branch, master has been updated
       via  bf650a1 s4:registry:regdiff: use existing talloc context for the event context
       via  342ab97 s4:registry:regdiff: add TALLOC_CTX * argument to open_backend()
       via  6ee16ce s4:registry: add a TALLOC_CTX argument to reg_open_remote()
      from  e454681 Linux-specific optimization in aio_open code.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bf650a1b59f84f93f79d753a6dc99940772fb020
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jul 13 00:29:14 2012 +0200

    s4:registry:regdiff: use existing talloc context for the event context
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Fri Jul 13 02:51:44 CEST 2012 on sn-devel-104

commit 342ab9750657bd34d7212f7121d47a06b6b12aa5
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jul 13 00:20:03 2012 +0200

    s4:registry:regdiff: add TALLOC_CTX * argument to open_backend()

commit 6ee16cefc98c8a033664be476be4446599450d23
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jul 13 00:16:09 2012 +0200

    s4:registry: add a TALLOC_CTX argument to reg_open_remote()

-----------------------------------------------------------------------

Summary of changes:
 source4/lib/registry/registry.h      |    3 ++-
 source4/lib/registry/rpc.c           |    5 +++--
 source4/lib/registry/tools/common.c  |    2 +-
 source4/lib/registry/tools/regdiff.c |   15 ++++++++-------
 4 files changed, 14 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index 8a8271e..c22038c 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -379,7 +379,8 @@ WERROR reg_open_samba(TALLOC_CTX *mem_ctx,
 /**
  * Open the registry on a remote machine.
  */
-WERROR reg_open_remote(struct registry_context **ctx,
+WERROR reg_open_remote(TALLOC_CTX *mem_ctx,
+		       struct registry_context **ctx,
 		       struct auth_session_info *session_info,
 		       struct cli_credentials *credentials,
 		       struct loadparm_context *lp_ctx,
diff --git a/source4/lib/registry/rpc.c b/source4/lib/registry/rpc.c
index 42b7374..a8f8382 100644
--- a/source4/lib/registry/rpc.c
+++ b/source4/lib/registry/rpc.c
@@ -475,7 +475,8 @@ static struct registry_operations reg_backend_rpc = {
 	.get_key_info = rpc_get_info,
 };
 
-_PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
+_PUBLIC_ WERROR reg_open_remote(TALLOC_CTX *mem_ctx,
+				struct registry_context **ctx,
 				struct auth_session_info *session_info,
 				struct cli_credentials *credentials,
 				struct loadparm_context *lp_ctx,
@@ -487,7 +488,7 @@ _PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
 
 	dcerpc_init();
 
-	rctx = talloc(NULL, struct rpc_registry_context);
+	rctx = talloc(mem_ctx, struct rpc_registry_context);
 	W_ERROR_HAVE_NO_MEMORY(rctx);
 
 	/* Default to local smbd if no connection is specified */
diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c
index d997cb0..a2fda8d 100644
--- a/source4/lib/registry/tools/common.c
+++ b/source4/lib/registry/tools/common.c
@@ -31,7 +31,7 @@ struct registry_context *reg_common_open_remote(const char *remote,
 	struct registry_context *h = NULL;
 	WERROR error;
 
-	error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, ev_ctx);
+	error = reg_open_remote(NULL, &h, NULL, creds, lp_ctx, remote, ev_ctx);
 
 	if (!W_ERROR_IS_OK(error)) {
 		fprintf(stderr, "Unable to open remote registry at %s:%s \n",
diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c
index bd58f77..cf65de3 100644
--- a/source4/lib/registry/tools/regdiff.c
+++ b/source4/lib/registry/tools/regdiff.c
@@ -28,7 +28,8 @@
 
 enum reg_backend { REG_UNKNOWN, REG_LOCAL, REG_REMOTE, REG_NULL };
 
-static struct registry_context *open_backend(poptContext pc,
+static struct registry_context *open_backend(TALLOC_CTX *mem_ctx,
+					     poptContext pc,
 					     struct tevent_context *ev_ctx,
 					     struct loadparm_context *lp_ctx,
 					     enum reg_backend backend,
@@ -42,14 +43,14 @@ static struct registry_context *open_backend(poptContext pc,
 		poptPrintUsage(pc, stderr, 0);
 		return NULL;
 	case REG_LOCAL:
-		error = reg_open_samba(NULL, &ctx, ev_ctx, lp_ctx, NULL, cmdline_credentials);
+		error = reg_open_samba(mem_ctx, &ctx, ev_ctx, lp_ctx, NULL, cmdline_credentials);
 		break;
 	case REG_REMOTE:
-		error = reg_open_remote(&ctx, NULL, cmdline_credentials, lp_ctx,
+		error = reg_open_remote(mem_ctx, &ctx, NULL, cmdline_credentials, lp_ctx,
 					remote_host, ev_ctx);
 		break;
 	case REG_NULL:
-		error = reg_open_local(NULL, &ctx);
+		error = reg_open_local(mem_ctx, &ctx);
 		break;
 	}
 
@@ -118,13 +119,13 @@ int main(int argc, const char **argv)
 
 	}
 
-	ev_ctx = s4_event_context_init(NULL);
+	ev_ctx = s4_event_context_init(ctx);
 
-	h1 = open_backend(pc, ev_ctx, cmdline_lp_ctx, backend1, remote1);
+	h1 = open_backend(ctx, pc, ev_ctx, cmdline_lp_ctx, backend1, remote1);
 	if (h1 == NULL)
 		return 1;
 
-	h2 = open_backend(pc, ev_ctx, cmdline_lp_ctx, backend2, remote2);
+	h2 = open_backend(ctx, pc, ev_ctx, cmdline_lp_ctx, backend2, remote2);
 	if (h2 == NULL)
 		return 1;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list