diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-23 14:30:00 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-23 14:52:18 +1100 |
commit | 33756d6374fbeff15c2824c540f433ad6870e5c9 (patch) | |
tree | 692cbcaa344a6cbb4366f7a2563ef9f8ca430274 /source4/smbd | |
parent | 4ad0397d8afdd6bec609506f3736f8567afe7564 (diff) | |
download | samba-33756d6374fbeff15c2824c540f433ad6870e5c9.tar.gz samba-33756d6374fbeff15c2824c540f433ad6870e5c9.tar.bz2 samba-33756d6374fbeff15c2824c540f433ad6870e5c9.zip |
s4-server: pre-open the main ldb databases in the server
By pre-opening these databases and leaving them open, we allow the new
ldb_wrap_connect() code to share the ldb context between users.
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/server.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 8aad26dd2c..ddfa220a72 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -31,6 +31,7 @@ #include "ntvfs/ntvfs.h" #include "ntptr/ntptr.h" #include "auth/gensec/gensec.h" +#include "auth/gensec/schannel_state.h" #include "smbd/process_model.h" #include "param/secrets.h" #include "smbd/pidfile.h" @@ -181,15 +182,20 @@ _NORETURN_ static void max_runtime_handler(struct tevent_context *ev, } /* - pre-open the sam ldb to ensure the schema has been loaded. This - saves a lot of time in child processes + pre-open the key databases. This saves a lot of time in child + processes */ -static void prime_samdb_schema(struct tevent_context *event_ctx) +static void prime_ldb_databases(struct tevent_context *event_ctx) { - TALLOC_CTX *samdb_context; - samdb_context = talloc_new(event_ctx); - samdb_connect(samdb_context, event_ctx, cmdline_lp_ctx, system_session(samdb_context, cmdline_lp_ctx)); - talloc_free(samdb_context); + TALLOC_CTX *db_context; + db_context = talloc_new(event_ctx); + + samdb_connect(db_context, event_ctx, cmdline_lp_ctx, system_session(cmdline_lp_ctx)); + privilege_connect(db_context, event_ctx, cmdline_lp_ctx); + schannel_db_connect(db_context, event_ctx, cmdline_lp_ctx); + + /* we deliberately leave these open, which allows them to be + * re-used in ldb_wrap_connect() */ } @@ -398,7 +404,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ discard_const(binary_name)); } - prime_samdb_schema(event_ctx); + prime_ldb_databases(event_ctx); status = setup_parent_messaging(event_ctx, cmdline_lp_ctx); if (!NT_STATUS_IS_OK(status)) { |