diff options
author | Michael Adam <obnox@samba.org> | 2008-03-20 14:08:29 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-03-20 15:01:52 +0100 |
commit | 2f01e055cf0a8d49f1d732f03c7d2bebd8e123ae (patch) | |
tree | 0b31e527de931c3e93ce5e2d4ce90ec95e16352a /source3 | |
parent | 88801114667d13f0f7b4fbb289b1d004194a7f18 (diff) | |
download | samba-2f01e055cf0a8d49f1d732f03c7d2bebd8e123ae.tar.gz samba-2f01e055cf0a8d49f1d732f03c7d2bebd8e123ae.tar.bz2 samba-2f01e055cf0a8d49f1d732f03c7d2bebd8e123ae.zip |
registry: separate initialization of registry data from regdb_init().
Leave this to the users (currently registry_init_smbconf() and
init_registry()) to initialize as much of preliminary registry data
as needed.
Michael
(This used to be commit 59fdd30c789ccfd5cff356e459f1653b065b985c)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_backend_db.c | 11 | ||||
-rw-r--r-- | source3/registry/reg_init_full.c | 7 | ||||
-rw-r--r-- | source3/registry/reg_init_smbconf.c | 5 |
3 files changed, 14 insertions, 9 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index e2e908cb84..04b01797f7 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -183,7 +183,7 @@ fail: * create each component key of the specified path, * wrapped in one db transaction. */ -static bool init_registry_key(const char *add_path) +bool init_registry_key(const char *add_path) { if (regdb->transaction_start(regdb) == -1) { DEBUG(0, ("init_registry_key: transaction_start failed\n")); @@ -213,7 +213,7 @@ fail: Open the registry data in the tdb ***********************************************************************/ -static bool init_registry_data(void) +bool init_registry_data(void) { TALLOC_CTX *frame = NULL; REGVAL_CTR *values; @@ -351,13 +351,6 @@ bool regdb_init( void ) vers_id, REGVER_V1)); } - /* always setup the necessary keys and values */ - - if ( !init_registry_data() ) { - DEBUG(0,("regdb_init: Failed to initialize data in registry!\n")); - return false; - } - return true; } diff --git a/source3/registry/reg_init_full.c b/source3/registry/reg_init_full.c index b6a644bb11..5c59c6ba96 100644 --- a/source3/registry/reg_init_full.c +++ b/source3/registry/reg_init_full.c @@ -74,6 +74,13 @@ bool init_registry( void ) goto fail; } + /* setup the necessary keys and values */ + + if ( !init_registry_data() ) { + DEBUG(0,("regdb_init: Failed to initialize data in registry!\n")); + return false; + } + /* build the cache tree of registry hooks */ reghook_cache_init(); diff --git a/source3/registry/reg_init_smbconf.c b/source3/registry/reg_init_smbconf.c index b7e6add112..1b17852a7a 100644 --- a/source3/registry/reg_init_smbconf.c +++ b/source3/registry/reg_init_smbconf.c @@ -84,6 +84,11 @@ bool registry_init_smbconf(void) DEBUGADD(1, (".\n")); goto done; } + if (!init_registry_key(KEY_SMBCONF)) { + DEBUG(1, ("Could not initialize registry key '%s'\n", + KEY_SMBCONF)); + goto done; + } reghook_cache_init(); if (!reghook_cache_add(&smbconf_reg_hook)) { DEBUG(1, ("Error adding smbconf reghooks to reghook cache.\n")); |