diff options
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/lib/sharesec.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 9 |
3 files changed, 11 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 50ac834307..0da8c25a39 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -721,6 +721,7 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name, /* The following definitions come from lib/sharesec.c */ +bool share_info_db_init(void); SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access); SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename, size_t *psize); diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index a1d30f1d2b..799d983c82 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -37,7 +37,7 @@ static int delete_fn(struct db_record *rec, void *priv) return 0; } -static bool share_info_db_init(void) +bool share_info_db_init(void) { const char *vstring = "INFO/version"; int32 vers_id; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index ace3124842..09ad8d8ea5 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1218,6 +1218,15 @@ extern void build_options(bool screen); return -1; } + /* Open the share_info.tdb here, so we don't have to open + after the fork on every single connection. This is a small + performance improvment and reduces the total number of system + fds used. */ + if (!share_info_db_init()) { + DEBUG(0,("ERROR: failed to load share info db.\n")); + exit(1); + } + /* only start the background queue daemon if we are running as a daemon -- bad things will happen if smbd is launched via inetd and we fork a copy of |