summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-08-14 15:29:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:44 -0500
commit873bc06d95371e446de391a183db0b326ca529bd (patch)
treee9587f5eb4a6271d0403f7308dcbd78f2846c5d1
parent06ed827edf3fa210aebeea2e1e059fde090159fa (diff)
downloadsamba-873bc06d95371e446de391a183db0b326ca529bd.tar.gz
samba-873bc06d95371e446de391a183db0b326ca529bd.tar.bz2
samba-873bc06d95371e446de391a183db0b326ca529bd.zip
r24418: Adding reg_deleteallvalues().
Guenther (This used to be commit f7457c6173107f1730ae2e31c5377df3dbd2454e)
-rw-r--r--source3/registry/reg_api.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index b7f79c1519..1d863ec93e 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -618,6 +618,30 @@ WERROR reg_deletevalue(struct registry_key *key, const char *name)
return WERR_OK;
}
+WERROR reg_deleteallvalues(struct registry_key *key)
+{
+ WERROR err;
+ int i;
+
+ if (!(key->key->access_granted & SEC_RIGHTS_SET_VALUE)) {
+ return WERR_ACCESS_DENIED;
+ }
+
+ if (!W_ERROR_IS_OK(err = fill_value_cache(key))) {
+ return err;
+ }
+
+ for (i=0; i<key->values->num_values; i++) {
+ regval_ctr_delvalue(key->values, key->values->values[i]->valuename);
+ }
+
+ if (!store_reg_values(key->key, key->values)) {
+ TALLOC_FREE(key->values);
+ return WERR_REG_IO_FAILURE;
+ }
+
+ return WERR_OK;
+}
/*
* Utility function to open a complete registry path including the hive