summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-25 21:59:54 +0100
committerMichael Adam <obnox@samba.org>2009-02-26 13:22:54 +0100
commit602bfeb3605767c2d938f547ddebe5693776028c (patch)
tree6c0cf9714c1c051f42c91485e879da32737cab77
parent51795b723eedecbbcb89c822c68ee51151bc6592 (diff)
downloadsamba-602bfeb3605767c2d938f547ddebe5693776028c.tar.gz
samba-602bfeb3605767c2d938f547ddebe5693776028c.tar.bz2
samba-602bfeb3605767c2d938f547ddebe5693776028c.zip
s3:registry: add a create_subkey method to the backend ops.
This is to provide a more atomic means of adding a subkey of a key. Michael
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/include/reg_objects.h1
-rw-r--r--source3/registry/reg_dispatcher.c9
3 files changed, 11 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2a99b4af62..a4187dc2c6 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5095,6 +5095,7 @@ void reghook_dump_cache( int debuglevel );
bool store_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkeys );
bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
+WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey);
int fetch_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkey_ctr );
int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted,
diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h
index 421db72d29..29cd4c563d 100644
--- a/source3/include/reg_objects.h
+++ b/source3/include/reg_objects.h
@@ -131,6 +131,7 @@ typedef struct {
int (*fetch_subkeys)( const char *key, struct regsubkey_ctr *subkeys);
int (*fetch_values) ( const char *key, REGVAL_CTR *val );
bool (*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys );
+ WERROR (*create_subkey)(const char *key, const char *subkey);
bool (*store_values)( const char *key, REGVAL_CTR *val );
bool (*reg_access_check)( const char *keyname, uint32 requested,
uint32 *granted,
diff --git a/source3/registry/reg_dispatcher.c b/source3/registry/reg_dispatcher.c
index 0db9e1b146..555e821bf1 100644
--- a/source3/registry/reg_dispatcher.c
+++ b/source3/registry/reg_dispatcher.c
@@ -100,6 +100,15 @@ bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val )
return false;
}
+WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey)
+{
+ if (key->ops && key->ops->create_subkey) {
+ return key->ops->create_subkey(key->name, subkey);
+ }
+
+ return WERR_NOT_SUPPORTED;
+}
+
/***********************************************************************
High level wrapper function for enumerating registry subkeys
Initialize the TALLOC_CTX if necessary