summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-10-24 10:25:29 +0200
committerMichael Adam <obnox@samba.org>2011-11-29 18:20:06 +0100
commitbca2677afe0646e5436356d73c4acee7844e8056 (patch)
treeb258877c921410f2c1a9517716446f898f0ce241 /source3/utils
parentefb993b686e397e06ba647089535c92ec08c4345 (diff)
downloadsamba-bca2677afe0646e5436356d73c4acee7844e8056.tar.gz
samba-bca2677afe0646e5436356d73c4acee7844e8056.tar.bz2
samba-bca2677afe0646e5436356d73c4acee7844e8056.zip
s3:net registry check: adapt to new semantic of dbwrap_fetch
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_registry_check.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 2c278319f5..c51a2f02b9 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -893,18 +893,21 @@ dbwrap_store_verbose(struct db_context *db, const char *key, TDB_DATA nval)
NTSTATUS status;
status = dbwrap_fetch_bystring(db, mem_ctx, key, &oval);
- if (!NT_STATUS_IS_OK(status)) {
- printf ("store %s failed to fetch old value: %s\n", key,
- nt_errstr(status));
- goto done;
- }
+ if (NT_STATUS_IS_OK(status)) {
+ if (tdb_data_equal(nval, oval)) {
+ goto done;
+ }
+ printf("store %s:\n overwrite: %s\n with: %s\n", key,
+ tdb_data_print(mem_ctx, oval),
+ tdb_data_print(mem_ctx, nval));
- if (!tdb_data_is_empty(oval) && !tdb_data_equal(nval, oval)) {
- printf("store %s:\n"
- " overwrite: %s\n"
- " with: %s\n",
- key, tdb_data_print(mem_ctx, oval),
+ } else if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+ printf("store %s:\n write: %s\n", key,
tdb_data_print(mem_ctx, nval));
+ } else {
+ printf ("store %s:\n failed to fetch old value: %s\n", key,
+ nt_errstr(status));
+ goto done;
}
status = dbwrap_store_bystring(db, key, nval, 0);