summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-10-07 12:14:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:54 -0500
commit01a1e5cdb0339a7cb3a85280b118985562bb2d7f (patch)
tree34067426544a5cdfe872943db9a80d1da36f82c1 /source3/registry/reg_frontend.c
parent5b32737374419525dd57216f595440847bb3c619 (diff)
downloadsamba-01a1e5cdb0339a7cb3a85280b118985562bb2d7f.tar.gz
samba-01a1e5cdb0339a7cb3a85280b118985562bb2d7f.tar.bz2
samba-01a1e5cdb0339a7cb3a85280b118985562bb2d7f.zip
r10819: merging a couple of fixes from trunk
* only keep the registry,tdb file open when we have an open key handle * tpot's setup.py fix * removing files that no longer exist in trunk and copying some that were missing in 3.0 (This used to be commit 6c6bf6ca5fd430a7a20bf20ed08050328660e570)
Diffstat (limited to 'source3/registry/reg_frontend.c')
-rw-r--r--source3/registry/reg_frontend.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index f5284e9e88..b0e713a882 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -110,7 +110,7 @@ BOOL init_registry( void )
int i;
- if ( !init_registry_db() ) {
+ if ( !regdb_init() ) {
DEBUG(0,("init_registry: failed to initialize the registry tdb!\n"));
return False;
}
@@ -132,6 +132,10 @@ BOOL init_registry( void )
svcctl_init_keys();
eventlog_init_keys();
+ /* close and let each smbd open up as necessary */
+
+ regdb_close();
+
return True;
}
@@ -348,10 +352,15 @@ WERROR regkey_open_internal( REGISTRY_KEY **regkey, const char *path,
REGSUBKEY_CTR *subkeys = NULL;
uint32 access_granted;
+ if ( !(W_ERROR_IS_OK(result = regdb_open()) ) )
+ return result;
+
DEBUG(7,("regkey_open_internal: name = [%s]\n", path));
- if ( !(*regkey = TALLOC_ZERO_P(NULL, REGISTRY_KEY)) )
+ if ( !(*regkey = TALLOC_ZERO_P(NULL, REGISTRY_KEY)) ) {
+ regdb_close();
return WERR_NOMEM;
+ }
keyinfo = *regkey;
@@ -399,8 +408,19 @@ WERROR regkey_open_internal( REGISTRY_KEY **regkey, const char *path,
done:
if ( !W_ERROR_IS_OK(result) ) {
- TALLOC_FREE( *regkey );
+ regkey_close_internal( *regkey );
}
return result;
}
+
+/*******************************************************************
+*******************************************************************/
+
+WERROR regkey_close_internal( REGISTRY_KEY *key )
+{
+ TALLOC_FREE( key );
+ regdb_close();
+
+ return WERR_OK;
+}