[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Sat May 13 19:02:02 UTC 2017


The branch, master has been updated
       via  5098636 s4: nmblookup: Allocate event context off NULL instead of talloc_autofree_context().
       via  dd80082 s4: cifsdd: Allocate the event context off NULL, not talloc_autofree_context().
       via  1ad4bae s4: client: Allocate event context off struct smbclient_context *, not talloc_autofree_context().
       via  3cfa58d gensec: Add a TALLOC_CTX * to gensec_register().
       via  6f05597 s4: ntvfs: Add a TALLOC_CTX * to sys_notify_register().
       via  f0d8913 s4: ntvfs: Add a TALLOC_CTX * to sys_lease_register().
       via  e1b4df4 s4: ntvfs: Add a TALLOC_CTX * paramter to pvfs_acl_register()
      from  91852dd s4: torture: Remove use of local variables that are simply mirroring popt_get_cmdline_credentials().

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


- Log -----------------------------------------------------------------
commit 5098636c784df917fb038ac4822f7a863d9543de
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 16:15:56 2017 -0700

    s4: nmblookup: Allocate event context off NULL instead of talloc_autofree_context().
    
    It's already correctly freed on exit.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Sat May 13 21:01:25 CEST 2017 on sn-devel-144

commit dd8008250b259acdb02d3b067f8a4194dd68c14a
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 16:10:31 2017 -0700

    s4: cifsdd: Allocate the event context off NULL, not talloc_autofree_context().
    
    Ensure it's freed on exit paths.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 1ad4bae2623ff487509b1b5f15b9253e7c522f5f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 16:01:59 2017 -0700

    s4: client: Allocate event context off struct smbclient_context *, not talloc_autofree_context().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 3cfa58de1256de94461e9e303984030fa6483568
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 15:56:29 2017 -0700

    gensec: Add a TALLOC_CTX * to gensec_register().
    
    Pass in the TALLOC_CTX * from the module init to remove
    another talloc_autofree_context() use.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6f05597f5f02c2ad2b01a66e3b3b4625c6f05021
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 15:50:08 2017 -0700

    s4: ntvfs: Add a TALLOC_CTX * to sys_notify_register().
    
    Pass in the TALLOC_CTX * from the module init to remove
    another talloc_autofree_context() use.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f0d8913a0f795657200c18807bd3855eef5fb6e0
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 15:49:28 2017 -0700

    s4: ntvfs: Add a TALLOC_CTX * to sys_lease_register().
    
    Pass in the TALLOC_CTX * from the module init to remove
    another talloc_autofree_context() use.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit e1b4df414f9e6689589eb247f99bb20742a4cefc
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 11 15:45:57 2017 -0700

    s4: ntvfs: Add a TALLOC_CTX * paramter to pvfs_acl_register()
    
    Make use of the passed in TALLOC_CTX * from the init function
    to remove a talloc_autofree_context() use.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 auth/gensec/external.c                 |  2 +-
 auth/gensec/gensec.h                   |  3 ++-
 auth/gensec/gensec_start.c             |  5 +++--
 auth/gensec/ncalrpc.c                  |  2 +-
 auth/gensec/schannel.c                 |  2 +-
 auth/gensec/spnego.c                   |  2 +-
 auth/ntlmssp/ntlmssp.c                 |  4 ++--
 libcli/nbt/tools/nmblookup.c           |  2 +-
 source4/auth/gensec/gensec_gssapi.c    |  6 +++---
 source4/auth/gensec/gensec_krb5.c      |  4 ++--
 source4/client/cifsdd.c                | 10 ++++++++--
 source4/client/client.c                |  2 +-
 source4/lib/http/gensec/basic.c        |  2 +-
 source4/lib/http/gensec/ntlm.c         |  2 +-
 source4/ntvfs/posix/pvfs_acl.c         |  5 +++--
 source4/ntvfs/posix/pvfs_acl_nfs4.c    |  2 +-
 source4/ntvfs/posix/pvfs_acl_xattr.c   |  2 +-
 source4/ntvfs/sysdep/inotify.c         |  2 +-
 source4/ntvfs/sysdep/sys_lease.c       |  5 +++--
 source4/ntvfs/sysdep/sys_lease.h       |  2 +-
 source4/ntvfs/sysdep/sys_lease_linux.c |  2 +-
 source4/ntvfs/sysdep/sys_notify.c      |  5 +++--
 source4/ntvfs/sysdep/sys_notify.h      |  3 ++-
 23 files changed, 44 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/gensec/external.c b/auth/gensec/external.c
index 92295bc..0158045 100644
--- a/auth/gensec/external.c
+++ b/auth/gensec/external.c
@@ -115,7 +115,7 @@ NTSTATUS gensec_external_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
 
-	ret = gensec_register(&gensec_external_ops);
+	ret = gensec_register(ctx, &gensec_external_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			 gensec_external_ops.name));
diff --git a/auth/gensec/gensec.h b/auth/gensec/gensec.h
index 3924a7c..e7b9477 100644
--- a/auth/gensec/gensec.h
+++ b/auth/gensec/gensec.h
@@ -181,7 +181,8 @@ NTSTATUS gensec_start_mech_by_oid(struct gensec_security *gensec_security,
 const char *gensec_get_name_by_oid(struct gensec_security *gensec_security, const char *oid_string);
 struct cli_credentials *gensec_get_credentials(struct gensec_security *gensec_security);
 NTSTATUS gensec_init(void);
-NTSTATUS gensec_register(const struct gensec_security_ops *ops);
+NTSTATUS gensec_register(TALLOC_CTX *ctx,
+		const struct gensec_security_ops *ops);
 const struct gensec_security_ops *gensec_security_by_oid(struct gensec_security *gensec_security,
 							 const char *oid_string);
 const struct gensec_security_ops *gensec_security_by_sasl_name(struct gensec_security *gensec_security,
diff --git a/auth/gensec/gensec_start.c b/auth/gensec/gensec_start.c
index 83a86cf..0f7e826 100644
--- a/auth/gensec/gensec_start.c
+++ b/auth/gensec/gensec_start.c
@@ -893,7 +893,8 @@ _PUBLIC_ NTSTATUS gensec_set_credentials(struct gensec_security *gensec_security
   The 'name' can be later used by other backends to find the operations
   structure for this backend.
 */
-_PUBLIC_ NTSTATUS gensec_register(const struct gensec_security_ops *ops)
+_PUBLIC_ NTSTATUS gensec_register(TALLOC_CTX *ctx,
+			const struct gensec_security_ops *ops)
 {
 	if (gensec_security_by_name(NULL, ops->name) != NULL) {
 		/* its already registered! */
@@ -902,7 +903,7 @@ _PUBLIC_ NTSTATUS gensec_register(const struct gensec_security_ops *ops)
 		return NT_STATUS_OBJECT_NAME_COLLISION;
 	}
 
-	generic_security_ops = talloc_realloc(talloc_autofree_context(),
+	generic_security_ops = talloc_realloc(ctx,
 					      generic_security_ops,
 					      const struct gensec_security_ops *,
 					      gensec_num_backends+2);
diff --git a/auth/gensec/ncalrpc.c b/auth/gensec/ncalrpc.c
index 8916ef5..f28a1c4 100644
--- a/auth/gensec/ncalrpc.c
+++ b/auth/gensec/ncalrpc.c
@@ -342,7 +342,7 @@ _PUBLIC_ NTSTATUS gensec_ncalrpc_as_system_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS status;
 
-	status = gensec_register(&gensec_ncalrpc_security_ops);
+	status = gensec_register(ctx, &gensec_ncalrpc_security_ops);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0, ("Failed to register '%s' gensec backend!\n",
 			  gensec_ncalrpc_security_ops.name));
diff --git a/auth/gensec/schannel.c b/auth/gensec/schannel.c
index bf169d4..41f6351 100644
--- a/auth/gensec/schannel.c
+++ b/auth/gensec/schannel.c
@@ -852,7 +852,7 @@ static const struct gensec_security_ops gensec_schannel_security_ops = {
 _PUBLIC_ NTSTATUS gensec_schannel_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
-	ret = gensec_register(&gensec_schannel_security_ops);
+	ret = gensec_register(ctx, &gensec_schannel_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_schannel_security_ops.name));
diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index 4b3edc6..484f491 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -1697,7 +1697,7 @@ static const struct gensec_security_ops gensec_spnego_security_ops = {
 _PUBLIC_ NTSTATUS gensec_spnego_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
-	ret = gensec_register(&gensec_spnego_security_ops);
+	ret = gensec_register(ctx, &gensec_spnego_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_spnego_security_ops.name));
diff --git a/auth/ntlmssp/ntlmssp.c b/auth/ntlmssp/ntlmssp.c
index ec2f6d9..cb8f10b 100644
--- a/auth/ntlmssp/ntlmssp.c
+++ b/auth/ntlmssp/ntlmssp.c
@@ -256,14 +256,14 @@ _PUBLIC_ NTSTATUS gensec_ntlmssp_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
 
-	ret = gensec_register(&gensec_ntlmssp_security_ops);
+	ret = gensec_register(ctx, &gensec_ntlmssp_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_ntlmssp_security_ops.name));
 		return ret;
 	}
 
-	ret = gensec_register(&gensec_ntlmssp_resume_ccache_ops);
+	ret = gensec_register(ctx, &gensec_ntlmssp_resume_ccache_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_ntlmssp_resume_ccache_ops.name));
diff --git a/libcli/nbt/tools/nmblookup.c b/libcli/nbt/tools/nmblookup.c
index afb81c7..e5fa573 100644
--- a/libcli/nbt/tools/nmblookup.c
+++ b/libcli/nbt/tools/nmblookup.c
@@ -372,7 +372,7 @@ int main(int argc, const char *argv[])
 
 	load_interface_list(NULL, cmdline_lp_ctx, &ifaces);
 
-	ev = s4_event_context_init(talloc_autofree_context());
+	ev = s4_event_context_init(NULL);
 
 	while (poptPeekArg(pc)) {
 		const char *name = poptGetArg(pc);
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 73a08f1..2b3c56b 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -1644,21 +1644,21 @@ _PUBLIC_ NTSTATUS gensec_gssapi_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
 
-	ret = gensec_register(&gensec_gssapi_spnego_security_ops);
+	ret = gensec_register(ctx, &gensec_gssapi_spnego_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_gssapi_spnego_security_ops.name));
 		return ret;
 	}
 
-	ret = gensec_register(&gensec_gssapi_krb5_security_ops);
+	ret = gensec_register(ctx, &gensec_gssapi_krb5_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_gssapi_krb5_security_ops.name));
 		return ret;
 	}
 
-	ret = gensec_register(&gensec_gssapi_sasl_krb5_security_ops);
+	ret = gensec_register(ctx, &gensec_gssapi_sasl_krb5_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_gssapi_sasl_krb5_security_ops.name));
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index 4756c84..fdd3823 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -1086,14 +1086,14 @@ _PUBLIC_ NTSTATUS gensec_krb5_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS ret;
 
-	ret = gensec_register(&gensec_krb5_security_ops);
+	ret = gensec_register(ctx, &gensec_krb5_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_krb5_security_ops.name));
 		return ret;
 	}
 
-	ret = gensec_register(&gensec_fake_gssapi_krb5_security_ops);
+	ret = gensec_register(ctx, &gensec_fake_gssapi_krb5_security_ops);
 	if (!NT_STATUS_IS_OK(ret)) {
 		DEBUG(0,("Failed to register '%s' gensec backend!\n",
 			gensec_fake_gssapi_krb5_security_ops.name));
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 980948a..7ab59cd 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -551,6 +551,7 @@ int main(int argc, const char ** argv)
 	int i;
 	const char ** dd_args;
 	struct tevent_context *ev;
+	int rc;
 
 	poptContext pctx;
 	struct poptOption poptions[] = {
@@ -601,7 +602,7 @@ int main(int argc, const char ** argv)
 		}
 	}
 
-	ev = s4_event_context_init(talloc_autofree_context());
+	ev = s4_event_context_init(NULL);
 
 	gensec_init();
 	dump_args();
@@ -609,22 +610,27 @@ int main(int argc, const char ** argv)
 	if (check_arg_numeric("ibs") == 0 || check_arg_numeric("obs") == 0) {
 		fprintf(stderr, "%s: block sizes must be greater that zero\n",
 				PROGNAME);
+		talloc_free(ev);
 		exit(SYNTAX_EXIT_CODE);
 	}
 
 	if (check_arg_pathname("if") == NULL) {
 		fprintf(stderr, "%s: missing input filename\n", PROGNAME);
+		talloc_free(ev);
 		exit(SYNTAX_EXIT_CODE);
 	}
 
 	if (check_arg_pathname("of") == NULL) {
 		fprintf(stderr, "%s: missing output filename\n", PROGNAME);
+		talloc_free(ev);
 		exit(SYNTAX_EXIT_CODE);
 	}
 
 	CatchSignal(SIGINT, dd_handle_signal);
 	CatchSignal(SIGUSR1, dd_handle_signal);
-	return(copy_files(ev, cmdline_lp_ctx));
+	rc = copy_files(ev, cmdline_lp_ctx);
+	talloc_free(ev);
+	return rc;
 }
 
 /* vim: set sw=8 sts=8 ts=8 tw=79 : */
diff --git a/source4/client/client.c b/source4/client/client.c
index 9b2115a..e04aa25 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -3415,7 +3415,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 	lpcfg_smbcli_options(cmdline_lp_ctx, &smb_options);
 	lpcfg_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
 
-	ev_ctx = s4_event_context_init(talloc_autofree_context());
+	ev_ctx = s4_event_context_init(ctx);
 
 	DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) );
 
diff --git a/source4/lib/http/gensec/basic.c b/source4/lib/http/gensec/basic.c
index 6477863..6077aca 100644
--- a/source4/lib/http/gensec/basic.c
+++ b/source4/lib/http/gensec/basic.c
@@ -127,7 +127,7 @@ _PUBLIC_ NTSTATUS gensec_http_basic_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS status;
 
-	status = gensec_register(&gensec_http_basic_security_ops);
+	status = gensec_register(ctx, &gensec_http_basic_security_ops);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0, ("Failed to register '%s' gensec backend!\n",
 				gensec_http_basic_security_ops.name));
diff --git a/source4/lib/http/gensec/ntlm.c b/source4/lib/http/gensec/ntlm.c
index 391f99f..cc4b0f0 100644
--- a/source4/lib/http/gensec/ntlm.c
+++ b/source4/lib/http/gensec/ntlm.c
@@ -110,7 +110,7 @@ _PUBLIC_ NTSTATUS gensec_http_ntlm_init(TALLOC_CTX *ctx)
 {
 	NTSTATUS status;
 
-	status = gensec_register(&gensec_http_ntlm_security_ops);
+	status = gensec_register(ctx, &gensec_http_ntlm_security_ops);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0, ("Failed to register '%s' gensec backend!\n",
 				gensec_http_ntlm_security_ops.name));
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index 9a110ca..d284585 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -41,7 +41,7 @@ static int num_backends;
   The 'name' can be later used by other backends to find the operations
   structure for this backend.  
 */
-NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
+NTSTATUS pvfs_acl_register(TALLOC_CTX *ctx, const struct pvfs_acl_ops *ops)
 {
 	struct pvfs_acl_ops *new_ops;
 
@@ -50,7 +50,8 @@ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
 		return NT_STATUS_OBJECT_NAME_COLLISION;
 	}
 
-	backends = talloc_realloc(talloc_autofree_context(), backends, struct pvfs_acl_backend, num_backends+1);
+	backends = talloc_realloc(ctx, backends,
+			struct pvfs_acl_backend, num_backends+1);
 	NT_STATUS_HAVE_NO_MEMORY(backends);
 
 	new_ops = (struct pvfs_acl_ops *)talloc_memdup(backends, ops, sizeof(*ops));
diff --git a/source4/ntvfs/posix/pvfs_acl_nfs4.c b/source4/ntvfs/posix/pvfs_acl_nfs4.c
index 392dc92..b07d2ba 100644
--- a/source4/ntvfs/posix/pvfs_acl_nfs4.c
+++ b/source4/ntvfs/posix/pvfs_acl_nfs4.c
@@ -195,5 +195,5 @@ NTSTATUS pvfs_acl_nfs4_init(TALLOC_CTX *ctx)
 		.acl_load = pvfs_acl_load_nfs4,
 		.acl_save = pvfs_acl_save_nfs4
 	};
-	return pvfs_acl_register(&ops);
+	return pvfs_acl_register(ctx, &ops);
 }
diff --git a/source4/ntvfs/posix/pvfs_acl_xattr.c b/source4/ntvfs/posix/pvfs_acl_xattr.c
index 648c459..1f569ca 100644
--- a/source4/ntvfs/posix/pvfs_acl_xattr.c
+++ b/source4/ntvfs/posix/pvfs_acl_xattr.c
@@ -100,5 +100,5 @@ NTSTATUS pvfs_acl_xattr_init(TALLOC_CTX *ctx)
 		.acl_load = pvfs_acl_load_xattr,
 		.acl_save = pvfs_acl_save_xattr
 	};
-	return pvfs_acl_register(&ops);
+	return pvfs_acl_register(ctx, &ops);
 }
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c
index c769618..ba4b336 100644
--- a/source4/ntvfs/sysdep/inotify.c
+++ b/source4/ntvfs/sysdep/inotify.c
@@ -394,5 +394,5 @@ NTSTATUS sys_notify_inotify_init(TALLOC_CTX *);
 NTSTATUS sys_notify_inotify_init(TALLOC_CTX *ctx)
 {
 	/* register ourselves as a system inotify module */
-	return sys_notify_register(&inotify);
+	return sys_notify_register(ctx, &inotify);
 }
diff --git a/source4/ntvfs/sysdep/sys_lease.c b/source4/ntvfs/sysdep/sys_lease.c
index 3db6703..b6e6ffc 100644
--- a/source4/ntvfs/sysdep/sys_lease.c
+++ b/source4/ntvfs/sysdep/sys_lease.c
@@ -103,10 +103,11 @@ _PUBLIC_ struct sys_lease_context *sys_lease_context_create(struct share_config
 /*
   register a lease backend
 */
-_PUBLIC_ NTSTATUS sys_lease_register(const struct sys_lease_ops *backend)
+_PUBLIC_ NTSTATUS sys_lease_register(TALLOC_CTX *ctx,
+			const struct sys_lease_ops *backend)
 {
 	struct sys_lease_ops *b;
-	b = talloc_realloc(talloc_autofree_context(), backends,
+	b = talloc_realloc(ctx, backends,
 			   struct sys_lease_ops, num_backends+1);
 	NT_STATUS_HAVE_NO_MEMORY(b);
 	backends = b;
diff --git a/source4/ntvfs/sysdep/sys_lease.h b/source4/ntvfs/sysdep/sys_lease.h
index 57a5e0a..8b8d4bd 100644
--- a/source4/ntvfs/sysdep/sys_lease.h
+++ b/source4/ntvfs/sysdep/sys_lease.h
@@ -47,7 +47,7 @@ struct sys_lease_context {
 	const struct sys_lease_ops *ops;
 };
 
-NTSTATUS sys_lease_register(const struct sys_lease_ops *ops);
+NTSTATUS sys_lease_register(TALLOC_CTX *ctx, const struct sys_lease_ops *ops);
 NTSTATUS sys_lease_init(void);
 
 struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
diff --git a/source4/ntvfs/sysdep/sys_lease_linux.c b/source4/ntvfs/sysdep/sys_lease_linux.c
index 1c70f4e..566a9a3 100644
--- a/source4/ntvfs/sysdep/sys_lease_linux.c
+++ b/source4/ntvfs/sysdep/sys_lease_linux.c
@@ -211,5 +211,5 @@ static struct sys_lease_ops linux_lease_ops = {
 NTSTATUS sys_lease_linux_init(TALLOC_CTX *ctx)
 {
 	/* register ourselves as a system lease module */
-	return sys_lease_register(&linux_lease_ops);
+	return sys_lease_register(ctx, &linux_lease_ops);
 }
diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c
index aad3b90..7e00032 100644
--- a/source4/ntvfs/sysdep/sys_notify.c
+++ b/source4/ntvfs/sysdep/sys_notify.c
@@ -120,10 +120,11 @@ _PUBLIC_ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx,
 /*
   register a notify backend
 */
-_PUBLIC_ NTSTATUS sys_notify_register(struct sys_notify_backend *backend)
+_PUBLIC_ NTSTATUS sys_notify_register(TALLOC_CTX *ctx,
+			struct sys_notify_backend *backend)
 {
 	struct sys_notify_backend *b;
-	b = talloc_realloc(talloc_autofree_context(), backends, 
+	b = talloc_realloc(ctx, backends,
 			   struct sys_notify_backend, num_backends+1);
 	NT_STATUS_HAVE_NO_MEMORY(b);
 	backends = b;
diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h
index d912a9b..9e10f14 100644
--- a/source4/ntvfs/sysdep/sys_notify.h
+++ b/source4/ntvfs/sysdep/sys_notify.h
@@ -43,7 +43,8 @@ struct sys_notify_backend {
 	notify_watch_t notify_watch;
 };
 
-NTSTATUS sys_notify_register(struct sys_notify_backend *backend);
+NTSTATUS sys_notify_register(TALLOC_CTX *ctx,
+			struct sys_notify_backend *backend);
 struct sys_notify_context *sys_notify_context_create(struct share_config *scfg,
 						     TALLOC_CTX *mem_ctx, 
 						     struct tevent_context *ev);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list