The branch, master has been updated
       via  54bd30f... s4-samdb: reduce the number of samdb opens at startup
      from  b55a5ad... s4-ldb: ensure DNs pass validity tests in indexing

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


- Log -----------------------------------------------------------------
commit 54bd30f70632b8fcbe164133d2479092b7262a29
Author: Andrew Tridgell <tri...@samba.org>
Date:   Sun Oct 25 17:19:03 2009 +1100

    s4-samdb: reduce the number of samdb opens at startup
    
    Using common parameters means that the ldb_wrap code can return a
    reference rather than a new database

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

Summary of changes:
 source4/dsdb/kcc/kcc_service.c       |    9 +++------
 source4/dsdb/repl/drepl_service.c    |    9 +++------
 source4/dsdb/samdb/samdb_privilege.c |   13 ++-----------
 source4/kdc/hdb-samba4.c             |    6 +++---
 source4/ldap_server/ldap_server.c    |    6 ++----
 source4/smb_server/smb_server.c      |   14 --------------
 6 files changed, 13 insertions(+), 44 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/kcc/kcc_service.c b/source4/dsdb/kcc/kcc_service.c
index 32e09ac..b088d2e 100644
--- a/source4/dsdb/kcc/kcc_service.c
+++ b/source4/dsdb/kcc/kcc_service.c
@@ -40,12 +40,9 @@
  */
 static WERROR kccsrv_init_creds(struct kccsrv_service *service)
 {
-       NTSTATUS status;
-
-       status = auth_system_session_info(service, service->task->lp_ctx, 
-                                         &service->system_session_info);
-       if (!NT_STATUS_IS_OK(status)) {
-               return ntstatus_to_werror(status);
+       service->system_session_info = system_session(service->task->lp_ctx);
+       if (!service->system_session_info) {
+               return WERR_NOMEM;
        }
 
        return WERR_OK;
diff --git a/source4/dsdb/repl/drepl_service.c 
b/source4/dsdb/repl/drepl_service.c
index 34853c8..a05ccc8 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -35,12 +35,9 @@
 
 static WERROR dreplsrv_init_creds(struct dreplsrv_service *service)
 {
-       NTSTATUS status;
-
-       status = auth_system_session_info(service, service->task->lp_ctx, 
-                                         &service->system_session_info);
-       if (!NT_STATUS_IS_OK(status)) {
-               return ntstatus_to_werror(status);
+       service->system_session_info = system_session(service->task->lp_ctx);
+       if (service->system_session_info == NULL) {
+               return WERR_NOMEM;
        }
 
        return WERR_OK;
diff --git a/source4/dsdb/samdb/samdb_privilege.c 
b/source4/dsdb/samdb/samdb_privilege.c
index dcb96d8..81b9381 100644
--- a/source4/dsdb/samdb/samdb_privilege.c
+++ b/source4/dsdb/samdb/samdb_privilege.c
@@ -33,17 +33,8 @@ struct ldb_context *privilege_connect(TALLOC_CTX *mem_ctx,
                                      struct tevent_context *ev_ctx,
                                      struct loadparm_context *lp_ctx)
 {
-       char *path;
-       struct ldb_context *pdb;
-
-       path = private_path(mem_ctx, lp_ctx, "privilege.ldb");
-       if (!path) return NULL;
-
-       pdb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, path, 
-                              NULL, NULL, 0);
-       talloc_free(path);
-
-       return pdb;
+       return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, "privilege.ldb", 
+                               NULL, NULL, 0);
 }
 
 /*
diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c
index 4062e13..5fef590 100644
--- a/source4/kdc/hdb-samba4.c
+++ b/source4/kdc/hdb-samba4.c
@@ -1596,9 +1596,9 @@ NTSTATUS hdb_samba4_create_kdc(TALLOC_CTX *mem_ctx,
        (*db)->hdb_db = NULL;
        (*db)->hdb_capability_flags = 0;
 
-       nt_status = auth_system_session_info(*db, lp_ctx, &session_info);
-       if (!NT_STATUS_IS_OK(nt_status)) {
-               return nt_status;
+       session_info = system_session(lp_ctx);
+       if (session_info == NULL) {
+               return NT_STATUS_INTERNAL_ERROR;
        }
        
        /* The idea here is very simple.  Using Kerberos to
diff --git a/source4/ldap_server/ldap_server.c 
b/source4/ldap_server/ldap_server.c
index c45a416..63bfc70 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -468,11 +468,9 @@ static void ldapsrv_accept_priv(struct stream_connection 
*c)
        struct ldapsrv_service *ldapsrv_service = talloc_get_type_abort(
                c->private_data, struct ldapsrv_service);
        struct auth_session_info *session_info;
-       NTSTATUS status;
 
-       status = auth_system_session_info(
-               c, ldapsrv_service->task->lp_ctx, &session_info);
-       if (!NT_STATUS_IS_OK(status)) {
+       session_info = system_session(ldapsrv_service->task->lp_ctx);
+       if (!session_info) {
                stream_terminate_connection(c, "failed to setup system "
                                            "session info");
                return;
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index 9b10f66..b0a37ad 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -200,18 +200,6 @@ _PUBLIC_ NTSTATUS smbsrv_add_socket(struct tevent_context 
*event_context,
 
 
 /*
-  pre-open some of our ldb databases, to prevent an explosion of memory usage
-  when we fork
- */
-static void smbsrv_preopen_ldb(struct task_server *task)
-{
-       /* yes, this looks strange. It is a hack to preload the
-          schema. I'd like to share most of the ldb context with the
-          child too. That will come later */
-       talloc_free(samdb_connect(task, task->event_ctx, task->lp_ctx, NULL));
-}
-
-/*
   open the smb server sockets
 */
 static void smbsrv_task_init(struct task_server *task)
@@ -245,8 +233,6 @@ static void smbsrv_task_init(struct task_server *task)
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }
 
-       smbsrv_preopen_ldb(task);
-
        return;
 failed:
        task_server_terminate(task, "Failed to startup smb server task", true); 


-- 
Samba Shared Repository

Reply via email to