summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-25 14:19:36 +0200
committerStefan Metzmacher <metze@samba.org>2013-04-30 14:14:44 +0200
commitb8c1e30a6f2213c0dbb43a55bd5e1f498a610cab (patch)
treef7372dea2f920bcc21904645521b9c95c301faa3
parenta8edad3743a60b9521b2cd759e22e6350c41cc06 (diff)
downloadsamba-b8c1e30a6f2213c0dbb43a55bd5e1f498a610cab.tar.gz
samba-b8c1e30a6f2213c0dbb43a55bd5e1f498a610cab.tar.bz2
samba-b8c1e30a6f2213c0dbb43a55bd5e1f498a610cab.zip
libsmb: Use smb2_lease_push in smb2_create_send
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/libcli/smb2/create.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index 7267f92126..552ac931c4 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -212,10 +212,11 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
if (io->in.lease_request) {
uint8_t data[32];
- memcpy(&data[0], &io->in.lease_request->lease_key, 16);
- SIVAL(data, 16, io->in.lease_request->lease_state);
- SIVAL(data, 20, io->in.lease_request->lease_flags);
- SBVAL(data, 24, io->in.lease_request->lease_duration);
+ if (!smb2_lease_push(io->in.lease_request, data,
+ sizeof(data))) {
+ TALLOC_FREE(req);
+ return NULL;
+ }
status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_RQLS,
@@ -227,16 +228,13 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
}
if (io->in.lease_request_v2) {
- struct smb2_lease *ls = io->in.lease_request_v2;
uint8_t data[52];
- memcpy(&data[0], &ls->lease_key, 16);
- SIVAL(data, 16, ls->lease_state);
- SIVAL(data, 20, ls->lease_flags);
- SBVAL(data, 24, ls->lease_duration);
- memcpy(&data[32], &ls->parent_lease_key, 16);
- SSVAL(data, 48, ls->lease_epoch);
- SSVAL(data, 50, 0); /* reserved */
+ if (!smb2_lease_push(io->in.lease_request_v2, data,
+ sizeof(data))) {
+ TALLOC_FREE(req);
+ return NULL;
+ }
status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_RQLS,