s4:registry: add a TALLOC_CTX argument to reg_open_remote()
authorMichael Adam <obnox@samba.org>
Thu, 12 Jul 2012 22:16:09 +0000 (00:16 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 12 Jul 2012 22:57:19 +0000 (00:57 +0200)
source4/lib/registry/registry.h
source4/lib/registry/rpc.c
source4/lib/registry/tools/common.c
source4/lib/registry/tools/regdiff.c

index 8a8271e3c9e1e0f03c726c30ff4de32e6eae9a6a..c22038cbfa952b231bba5c6d6b95bc30674f3747 100644 (file)
@@ -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,
index 42b7374f7adc9d993f34621ae4057e0e5c6377d3..a8f8382ec5b40982f8f2ee87bf4d5aefde71e67a 100644 (file)
@@ -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 */
index d997cb0fde585d6797d6c968b1d1b5c65f3a67b0..a2fda8d48df9801924f6223b965cce40e5c5986e 100644 (file)
@@ -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",
index bd58f7748fd9c240c5f85f2f6901263d64296682..3683e76da6614f968753390369d14340c0848ae1 100644 (file)
@@ -45,7 +45,7 @@ static struct registry_context *open_backend(poptContext pc,
                error = reg_open_samba(NULL, &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(NULL, &ctx, NULL, cmdline_credentials, lp_ctx,
                                        remote_host, ev_ctx);
                break;
        case REG_NULL: