summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-07-07 14:50:47 +0200
committerMichael Adam <obnox@samba.org>2011-10-12 22:45:53 +0200
commit85b145d7450fc9d9e9c93b0300c899dd94e2e861 (patch)
tree575777ba746b50e6f7fc7e4b338abc2174bf23a1
parent6648d906525cf27228145c8723e3dbef67dd77bd (diff)
downloadsamba-85b145d7450fc9d9e9c93b0300c899dd94e2e861.tar.gz
samba-85b145d7450fc9d9e9c93b0300c899dd94e2e861.tar.bz2
samba-85b145d7450fc9d9e9c93b0300c899dd94e2e861.zip
s3:utils change data_blob_dup_talloc() to take a DATA_BLOB by value
Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--lib/util/data_blob.h2
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/rpc_client/cli_pipe.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/operational.c2
-rw-r--r--source4/dsdb/schema/schema_prefixmap.c4
-rw-r--r--source4/dsdb/schema/schema_syntax.c4
6 files changed, 8 insertions, 8 deletions
diff --git a/lib/util/data_blob.h b/lib/util/data_blob.h
index 558ade9248..09a9292aed 100644
--- a/lib/util/data_blob.h
+++ b/lib/util/data_blob.h
@@ -50,7 +50,7 @@ struct data_blob_list_item {
#define data_blob(ptr, size) data_blob_named(ptr, size, "DATA_BLOB: "__location__)
#define data_blob_talloc(ctx, ptr, size) data_blob_talloc_named(ctx, ptr, size, "DATA_BLOB: "__location__)
-#define data_blob_dup_talloc(ctx, blob) data_blob_talloc_named(ctx, (blob)->data, (blob)->length, "DATA_BLOB: "__location__)
+#define data_blob_dup_talloc(ctx, blob) data_blob_talloc_named(ctx, (blob).data, (blob).length, "DATA_BLOB: "__location__)
/**
construct a data blob, must be freed with data_blob_free()
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 92c90146e3..bba7b0323a 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2707,7 +2707,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
GUID_from_data_blob(&blob1, &server_guid);
blob1 = data_blob_const(bytes+16, num_bytes-16);
- blob2 = data_blob_dup_talloc(state, &blob1);
+ blob2 = data_blob_dup_talloc(state, blob1);
if (blob1.length > 0 &&
tevent_req_nomem(blob2.data, req)) {
return;
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index ca24e0348d..ae5b88f02c 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3264,7 +3264,7 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
}
if (make_dup) {
- *session_key = data_blob_dup_talloc(mem_ctx, &sk);
+ *session_key = data_blob_dup_talloc(mem_ctx, sk);
} else {
*session_key = sk;
}
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c
index 1a13895a93..04b7461089 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -322,7 +322,7 @@ static int construct_parent_guid(struct ldb_module *module,
return LDB_SUCCESS;
}
- v = data_blob_dup_talloc(parent_res, parent_guid);
+ v = data_blob_dup_talloc(parent_res, *parent_guid);
if (!v.data) {
talloc_free(parent_res);
return ldb_oom(ldb_module_get_ctx(module));
diff --git a/source4/dsdb/schema/schema_prefixmap.c b/source4/dsdb/schema/schema_prefixmap.c
index aa30fc285b..4a895d9ab4 100644
--- a/source4/dsdb/schema/schema_prefixmap.c
+++ b/source4/dsdb/schema/schema_prefixmap.c
@@ -155,7 +155,7 @@ static WERROR _dsdb_schema_pfm_add_entry(struct dsdb_schema_prefixmap *pfm, DATA
struct dsdb_schema_prefixmap_oid * prefixes_new;
/* dup memory for bin-oid prefix to be added */
- bin_oid = data_blob_dup_talloc(pfm, &bin_oid);
+ bin_oid = data_blob_dup_talloc(pfm, bin_oid);
W_ERROR_HAVE_NO_MEMORY(bin_oid.data);
/* make room for new entry */
@@ -615,7 +615,7 @@ WERROR dsdb_drsuapi_pfm_from_schema_pfm(const struct dsdb_schema_prefixmap *pfm,
/* copy entries from schema_prefixMap */
for (i = 0; i < pfm->length; i++) {
- blob = data_blob_dup_talloc(ctr, &pfm->prefixes[i].bin_oid);
+ blob = data_blob_dup_talloc(ctr, pfm->prefixes[i].bin_oid);
if (!blob.data) {
talloc_free(ctr);
return WERR_NOMEM;
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index e909632920..0a5438ba97 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -836,7 +836,7 @@ static WERROR dsdb_syntax_DATA_BLOB_drsuapi_to_ldb(const struct dsdb_syntax_ctx
}
out->values[i] = data_blob_dup_talloc(out->values,
- in->value_ctr.values[i].blob);
+ *in->value_ctr.values[i].blob);
W_ERROR_HAVE_NO_MEMORY(out->values[i].data);
}
@@ -870,7 +870,7 @@ static WERROR dsdb_syntax_DATA_BLOB_ldb_to_drsuapi(const struct dsdb_syntax_ctx
for (i=0; i < in->num_values; i++) {
out->value_ctr.values[i].blob = &blobs[i];
- blobs[i] = data_blob_dup_talloc(blobs, &in->values[i]);
+ blobs[i] = data_blob_dup_talloc(blobs, in->values[i]);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
}