diff options
author | Gregor Beck <gbeck@sernet.de> | 2013-03-28 10:28:21 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-04-18 13:15:11 +0200 |
commit | 49cd31e39d70c090c448df5a9b6c50ca83e06f9b (patch) | |
tree | 8f57b94cfff433e66b9c199e54dcd801d3051a74 /source3/utils | |
parent | 037f57e12fb7b87e0c5c035ae85cb698bca64f4d (diff) | |
download | samba-49cd31e39d70c090c448df5a9b6c50ca83e06f9b.tar.gz samba-49cd31e39d70c090c448df5a9b6c50ca83e06f9b.tar.bz2 samba-49cd31e39d70c090c448df5a9b6c50ca83e06f9b.zip |
s3:net registry check: use tdb_data_string()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_registry_check.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c index 45a01f20f5..8cdb8fac59 100644 --- a/source3/utils/net_registry_check.c +++ b/source3/utils/net_registry_check.c @@ -214,23 +214,6 @@ static bool tdb_data_is_cstr(TDB_DATA d) { return strlen((char *)d.dptr) == d.dsize-1; } -static char* tdb_data_print(TALLOC_CTX *mem_ctx, TDB_DATA d) -{ - if (!tdb_data_is_empty(d)) { - char *ret = NULL; - cbuf *ost = cbuf_new(mem_ctx); - int len = cbuf_print_quoted(ost, (const char*)d.dptr, d.dsize); - if (len != -1) { - cbuf_swapptr(ost, &ret, 0); - talloc_steal(mem_ctx, ret); - } - talloc_free(ost); - return ret; - } - return talloc_strdup(mem_ctx, "<NULL>"); -} - - static TDB_DATA cbuf_make_tdb_data(cbuf *b) { return make_tdb_data((void*)cbuf_gets(b, 0), cbuf_getpos(b)); @@ -902,12 +885,12 @@ dbwrap_store_verbose(struct db_context *db, const char *key, TDB_DATA nval) 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)); + tdb_data_string(mem_ctx, oval), + tdb_data_string(mem_ctx, nval)); } else if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { printf("store %s:\n write: %s\n", key, - tdb_data_print(mem_ctx, nval)); + tdb_data_string(mem_ctx, nval)); } else { printf ("store %s:\n failed to fetch old value: %s\n", key, nt_errstr(status)); |