From 05193b39deeb4ace801a28ed8a1b6f2d51594b78 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 12 Feb 2014 12:11:51 +0100 Subject: [PATCH] s4:torture/rpc: use dcerpc_binding_dup() before modifying the given binding Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- source4/torture/rpc/backupkey.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source4/torture/rpc/backupkey.c b/source4/torture/rpc/backupkey.c index 89257fc977c..1c8f07f0936 100644 --- a/source4/torture/rpc/backupkey.c +++ b/source4/torture/rpc/backupkey.c @@ -493,7 +493,7 @@ static DATA_BLOB *encrypt_blob_pk(struct torture_context *tctx, static struct bkrp_BackupKey *createRetreiveBackupKeyGUIDStruct(struct torture_context *tctx, struct dcerpc_pipe *p, int version, DATA_BLOB *out) { - struct dcerpc_binding *binding = p->binding; + struct dcerpc_binding *binding; struct bkrp_client_side_wrapped data; struct GUID *g = talloc(tctx, struct GUID); struct bkrp_BackupKey *r = talloc_zero(tctx, struct bkrp_BackupKey); @@ -505,7 +505,13 @@ static struct bkrp_BackupKey *createRetreiveBackupKeyGUIDStruct(struct torture_c return NULL; } + binding = dcerpc_binding_dup(tctx, p->binding); + if (binding == NULL) { + return NULL; + } + binding->flags = binding->flags & (DCERPC_SEAL|DCERPC_AUTH_SPNEGO); + ZERO_STRUCT(data); status = GUID_from_string(BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID, g); if (!NT_STATUS_IS_OK(status)) {