summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index acce7ab1b4..7c2e01dccc 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -659,6 +659,7 @@ done:
WERROR reg_setvalue(struct registry_key *key, const char *name,
const struct registry_value *val)
{
+ struct regval_blob *existing;
WERROR err;
int res;
@@ -670,6 +671,15 @@ WERROR reg_setvalue(struct registry_key *key, const char *name,
return err;
}
+ existing = regval_ctr_getvalue(key->values, name);
+
+ if ((existing != NULL) &&
+ (regval_size(existing) == val->data.length) &&
+ (memcmp(regval_data_p(existing), val->data.data,
+ val->data.length) == 0)) {
+ return WERR_OK;
+ }
+
res = regval_ctr_addvalue(key->values, name, val->type,
val->data.data, val->data.length);