summaryrefslogtreecommitdiff
path: root/source3/registry/reg_db.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-27 03:40:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:03 -0500
commitab0033d40a369a7fc16496cb9773f3436cb268ae (patch)
tree2d2d3ed68a84d4a81edac7049517c9a963cf90cd /source3/registry/reg_db.c
parentbd509a81cb6c295988a1626adfe394c9778c005e (diff)
downloadsamba-ab0033d40a369a7fc16496cb9773f3436cb268ae.tar.gz
samba-ab0033d40a369a7fc16496cb9773f3436cb268ae.tar.bz2
samba-ab0033d40a369a7fc16496cb9773f3436cb268ae.zip
r7938: * move the hardcoded registry value names from _reg_query_value()
to a thin layer in fetch_reg_values(). Not entirely efficient seeing as the the dynamic value paths are stored in an unsorted array but it is one strequal() per path. If this was really big it should be worked into the reghook_cache(). (This used to be commit 63b81ad3cb484090a181fbd13e04922a5c17e7d9)
Diffstat (limited to 'source3/registry/reg_db.c')
-rw-r--r--source3/registry/reg_db.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/source3/registry/reg_db.c b/source3/registry/reg_db.c
index 3f618fbba4..884949375b 100644
--- a/source3/registry/reg_db.c
+++ b/source3/registry/reg_db.c
@@ -217,18 +217,6 @@ BOOL init_registry_db( void )
return True;
}
-/**********************************************************************
- The full path to the registry key is used as database after the
- \'s are converted to /'s. Key string is also normalized to UPPER
- case.
-**********************************************************************/
-
-static void normalize_reg_path( pstring keyname )
-{
- pstring_sub( keyname, "\\", "/" );
- strupper_m( keyname );
-}
-
/***********************************************************************
Add subkey strings to the registry tdb under a defined key
fmt is the same format as tdb_pack except this function only supports
@@ -308,7 +296,7 @@ static BOOL regdb_store_reg_keys( const char *key, REGSUBKEY_CTR *ctr )
REGSUBKEY_CTR subkeys, old_subkeys;
char *oldkeyname;
- /* fetch a list of the old subkeys so we can difure out if any were deleted */
+ /* fetch a list of the old subkeys so we can determine if any were deleted */
regsubkey_ctr_init( &old_subkeys );
regdb_fetch_reg_keys( key, &old_subkeys );
@@ -331,6 +319,8 @@ static BOOL regdb_store_reg_keys( const char *key, REGSUBKEY_CTR *ctr )
tdb_delete_bystring( tdb_reg, path );
}
}
+
+ regsubkey_ctr_destroy( &old_subkeys );
/* now create records for any subkeys that don't already exist */
@@ -491,8 +481,10 @@ static int regdb_fetch_reg_values( const char* key, REGVAL_CTR *values )
data = tdb_fetch_bystring( tdb_reg, keystr );
- if ( !data.dptr )
+ if ( !data.dptr ) {
+ /* all keys have zero values by default */
return 0;
+ }
len = regdb_unpack_values( values, data.dptr, data.dsize );