summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-05-27 12:42:19 +1000
committerAndrew Tridgell <tridge@samba.org>2008-05-27 12:42:19 +1000
commit2814868e93116bb967a7438d95b6fd407246acc1 (patch)
tree155ca3d3f2ef8b7169f842af113f72392f0a6cfd
parent0d8d6dbfd7f51500f393cf5a14a568a1271edf3f (diff)
downloadsamba-2814868e93116bb967a7438d95b6fd407246acc1.tar.gz
samba-2814868e93116bb967a7438d95b6fd407246acc1.tar.bz2
samba-2814868e93116bb967a7438d95b6fd407246acc1.zip
don't alter the in blobs in a SMB2 create, otherwise two calls in a
row will fail (This used to be commit 3b811a52fe9a8356337ad149d01a3498c09d900a)
-rw-r--r--source4/libcli/smb2/create.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index b1b8b0ccfa..1901cb4977 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -94,6 +94,7 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
NTSTATUS status;
DATA_BLOB blob = data_blob(NULL, 0);
uint32_t i;
+ struct smb2_create_blobs blobs = io->in.blobs;
req = smb2_request_init_tree(tree, SMB2_OP_CREATE, 0x38, true, 0);
if (req == NULL) return NULL;
@@ -119,7 +120,7 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
DATA_BLOB b = data_blob_talloc(req, NULL,
ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas, 4));
ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas, 4);
- status = smb2_create_blob_add(req, &io->in.blobs,
+ status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_EXTA, b);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
@@ -130,22 +131,22 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
/* an empty MxAc tag seems to be used to ask the server to
return the maximum access mask allowed on the file */
- status = smb2_create_blob_add(req, &io->in.blobs,
+ status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_MXAC, data_blob(NULL, 0));
if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
return NULL;
}
- for (i=0; i < io->in.blobs.num_blobs; i++) {
+ for (i=0; i < blobs.num_blobs; i++) {
bool last = false;
const struct smb2_create_blob *c;
- if ((i + 1) == io->in.blobs.num_blobs) {
+ if ((i + 1) == blobs.num_blobs) {
last = true;
}
- c = &io->in.blobs.blobs[i];
+ c = &blobs.blobs[i];
status = smb2_create_blob_push_one(req, &blob,
c, last);
if (!NT_STATUS_IS_OK(status)) {