summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.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_frontend.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_frontend.c')
-rw-r--r--source3/registry/reg_frontend.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index 8b722ba1f5..440f108cc9 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -89,6 +89,9 @@ BOOL store_reg_keys( REGISTRY_KEY *key, REGSUBKEY_CTR *subkeys )
BOOL store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val )
{
+ if ( check_dynamic_reg_values( key ) )
+ return False;
+
if ( key->hook && key->hook->ops && key->hook->ops->store_values )
return key->hook->ops->store_values( key->name, val );
@@ -162,10 +165,8 @@ BOOL fetch_reg_keys_specific( REGISTRY_KEY *key, char** subkey, uint32 key_index
return True;
}
-
/***********************************************************************
High level wrapper function for enumerating registry values
- Initialize the TALLOC_CTX if necessary
***********************************************************************/
int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val )
@@ -174,7 +175,15 @@ int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val )
if ( key->hook && key->hook->ops && key->hook->ops->fetch_values )
result = key->hook->ops->fetch_values( key->name, val );
+
+ /* if the backend lookup returned no data, try the dynamic overlay */
+
+ if ( result == 0 ) {
+ result = fetch_dynamic_reg_values( key, val );
+ return ( result != -1 ) ? result : 0;
+ }
+
return result;
}
@@ -208,7 +217,7 @@ BOOL fetch_reg_values_specific( REGISTRY_KEY *key, REGISTRY_VALUE **val, uint32
ctr_init = True;
}
/* clear the cache when val_index == 0 or the path has changed */
- else if ( !val_index || StrCaseCmp(save_path, key->name) ) {
+ else if ( !val_index || !strequal(save_path, key->name) ) {
DEBUG(8,("fetch_reg_values_specific: Updating cache of values for [%s]\n", key->name));