s4: Add TALLOC_CTX * to register_server_service().
authorJeremy Allison <jra@samba.org>
Tue, 9 May 2017 20:46:45 +0000 (13:46 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 11 May 2017 18:30:13 +0000 (20:30 +0200)
Use the passed in context from callers. Remove one
talloc_autofree_context().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 files changed:
file_server/file_server.c
source4/cldap_server/cldap_server.c
source4/dns_server/dns_server.c
source4/dsdb/dns/dns_update.c
source4/dsdb/kcc/kcc_service.c
source4/dsdb/repl/drepl_service.c
source4/echo_server/echo_server.c
source4/kdc/kdc-heimdal.c
source4/kdc/kdc-service-mit.c
source4/ldap_server/ldap_server.c
source4/nbt_server/nbt_server.c
source4/ntp_signd/ntp_signd.c
source4/rpc_server/service_rpc.c
source4/smb_server/service_smb.c
source4/smbd/service.c
source4/web_server/web_server.c
source4/winbind/winbindd.c
source4/wrepl_server/wrepl_server.c

index 72d7de5..83641f8 100644 (file)
@@ -97,5 +97,5 @@ NTSTATUS server_service_s3fs_init(TALLOC_CTX *);
 
 NTSTATUS server_service_s3fs_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("s3fs", s3fs_task_init);
+       return register_server_service(ctx, "s3fs", s3fs_task_init);
 }
index de8bc4e..35a2b99 100644 (file)
@@ -243,5 +243,5 @@ static void cldapd_task_init(struct task_server *task)
 */
 NTSTATUS server_service_cldapd_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("cldap", cldapd_task_init);
+       return register_server_service(ctx, "cldap", cldapd_task_init);
 }
index d467cca..5e9527d 100644 (file)
@@ -929,5 +929,5 @@ static void dns_task_init(struct task_server *task)
 
 NTSTATUS server_service_dns_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("dns", dns_task_init);
+       return register_server_service(ctx, "dns", dns_task_init);
 }
index d2e3466..f74256d 100644 (file)
@@ -667,5 +667,5 @@ static void dnsupdate_task_init(struct task_server *task)
 */
 NTSTATUS server_service_dnsupdate_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("dnsupdate", dnsupdate_task_init);
+       return register_server_service(ctx, "dnsupdate", dnsupdate_task_init);
 }
index 000206f..946a8fe 100644 (file)
@@ -347,5 +347,5 @@ static void kccsrv_task_init(struct task_server *task)
 */
 NTSTATUS server_service_kcc_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("kcc", kccsrv_task_init);
+       return register_server_service(ctx, "kcc", kccsrv_task_init);
 }
index 787f2d7..39791b4 100644 (file)
@@ -516,5 +516,5 @@ static void dreplsrv_task_init(struct task_server *task)
 */
 NTSTATUS server_service_drepl_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("drepl", dreplsrv_task_init);
+       return register_server_service(ctx, "drepl", dreplsrv_task_init);
 }
index a934b5b..e610232 100644 (file)
@@ -343,5 +343,5 @@ static void echo_task_init(struct task_server *task)
  */
 NTSTATUS server_service_echo_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("echo", echo_task_init);
+       return register_server_service(ctx, "echo", echo_task_init);
 }
index fd48114..d5c721b 100644 (file)
@@ -468,5 +468,5 @@ static void kdc_task_init(struct task_server *task)
 /* called at smbd startup - register ourselves as a server service */
 NTSTATUS server_service_kdc_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("kdc", kdc_task_init);
+       return register_server_service(ctx, "kdc", kdc_task_init);
 }
index 87c0179..13d6f1f 100644 (file)
@@ -352,5 +352,5 @@ NTSTATUS server_service_mitkdc_init(TALLOC_CTX *mem_ctx);
 
 NTSTATUS server_service_mitkdc_init(TALLOC_CTX *mem_ctx)
 {
-       return register_server_service("kdc", mitkdc_task_init);
+       return register_server_service(mem_ctx, "kdc", mitkdc_task_init);
 }
index 747e25d..347a17d 100644 (file)
@@ -1184,5 +1184,5 @@ failed:
 
 NTSTATUS server_service_ldap_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("ldap", ldapsrv_task_init);
+       return register_server_service(ctx, "ldap", ldapsrv_task_init);
 }
index 2c20c10..2196bb0 100644 (file)
@@ -100,5 +100,5 @@ static void nbtd_task_init(struct task_server *task)
 */
 NTSTATUS server_service_nbtd_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("nbt", nbtd_task_init);
+       return register_server_service(ctx, "nbt", nbtd_task_init);
 }
index ddd38c1..7949dc2 100644 (file)
@@ -554,5 +554,5 @@ static void ntp_signd_task_init(struct task_server *task)
 /* called at smbd startup - register ourselves as a server service */
 NTSTATUS server_service_ntp_signd_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("ntp_signd", ntp_signd_task_init);
+       return register_server_service(ctx, "ntp_signd", ntp_signd_task_init);
 }
index f6b1ac9..44c0d53 100644 (file)
@@ -126,5 +126,5 @@ failed:
 
 NTSTATUS server_service_rpc_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("rpc", dcesrv_task_init);
+       return register_server_service(ctx, "rpc", dcesrv_task_init);
 }
index 1a830d0..a607861 100644 (file)
@@ -89,5 +89,5 @@ NTSTATUS server_service_smb_init(TALLOC_CTX *ctx)
 {
        ntvfs_init(cmdline_lp_ctx);
        share_init();
-       return register_server_service("smb", smbsrv_task_init);
+       return register_server_service(ctx, "smb", smbsrv_task_init);
 }
index 81ad3c5..403ae74 100644 (file)
@@ -36,11 +36,12 @@ static struct registered_server {
 /*
   register a server service. 
 */
-NTSTATUS register_server_service(const char *name,
-                                void (*task_init)(struct task_server *))
+NTSTATUS register_server_service(TALLOC_CTX *ctx,
+                               const char *name,
+                               void (*task_init)(struct task_server *))
 {
        struct registered_server *srv;
-       srv = talloc(talloc_autofree_context(), struct registered_server);
+       srv = talloc(ctx, struct registered_server);
        NT_STATUS_HAVE_NO_MEMORY(srv);
        srv->service_name = name;
        srv->task_init = task_init;
index 02f2460..d854a29 100644 (file)
@@ -372,5 +372,5 @@ failed:
 /* called at smbd startup - register ourselves as a server service */
 NTSTATUS server_service_web_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("web", websrv_task_init);
+       return register_server_service(ctx, "web", websrv_task_init);
 }
index 6e6f262..c8c0733 100644 (file)
@@ -90,9 +90,9 @@ NTSTATUS server_service_winbindd_init(TALLOC_CTX *);
 
 NTSTATUS server_service_winbindd_init(TALLOC_CTX *ctx)
 {
-       NTSTATUS status = register_server_service("winbindd", winbindd_task_init);
+       NTSTATUS status = register_server_service(ctx, "winbindd", winbindd_task_init);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       return register_server_service("winbind", winbindd_task_init);
+       return register_server_service(ctx, "winbind", winbindd_task_init);
 }
index d054a22..dc28e23 100644 (file)
@@ -508,5 +508,5 @@ static void wreplsrv_task_init(struct task_server *task)
 */
 NTSTATUS server_service_wrepl_init(TALLOC_CTX *ctx)
 {
-       return register_server_service("wrepl", wreplsrv_task_init);
+       return register_server_service(ctx, "wrepl", wreplsrv_task_init);
 }