summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-11 11:20:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:29 -0500
commitbb373dbd6c1d68d42d664351ee36f5ca4a9272c6 (patch)
treef011aee23d5ab7bee7b58c3d397c51d5969864b3
parent8e146e4b7b284a4e89eea11272407c57090af395 (diff)
downloadsamba-bb373dbd6c1d68d42d664351ee36f5ca4a9272c6.tar.gz
samba-bb373dbd6c1d68d42d664351ee36f5ca4a9272c6.tar.bz2
samba-bb373dbd6c1d68d42d664351ee36f5ca4a9272c6.zip
r24325: Push down reply_prep_legacy in reply_read_and_X
(This used to be commit 9d2354129dad1d4d015d463f138a196f9f72af2f)
-rw-r--r--source3/smbd/reply.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index cf30c183fa..7b981e1c8a 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2900,20 +2900,12 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req)
return;
}
- if (!reply_prep_legacy(req, &inbuf, &outbuf, &length, &bufsize)) {
- reply_nterror(req, NT_STATUS_NO_MEMORY);
- END_PROFILE(SMBreadX);
- return;
- }
-
- set_message(inbuf,outbuf,12,0,True);
-
if (global_client_caps & CAP_LARGE_READX) {
- size_t upper_size = SVAL(inbuf,smb_vwv7);
+ size_t upper_size = SVAL(req->inbuf,smb_vwv7);
smb_maxcnt |= (upper_size<<16);
if (upper_size > 1) {
/* Can't do this on a chained packet. */
- if ((CVAL(inbuf,smb_vwv0) != 0xFF)) {
+ if ((CVAL(req->inbuf,smb_vwv0) != 0xFF)) {
reply_nterror(req, NT_STATUS_NOT_SUPPORTED);
END_PROFILE(SMBreadX);
return;
@@ -2935,12 +2927,12 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req)
}
}
- if(CVAL(inbuf,smb_wct) == 12) {
+ if (req->wct == 12) {
#ifdef LARGE_SMB_OFF_T
/*
* This is a large offset (64 bit) read.
*/
- startpos |= (((SMB_OFF_T)IVAL(inbuf,smb_vwv10)) << 32);
+ startpos |= (((SMB_OFF_T)IVAL(req->inbuf,smb_vwv10)) << 32);
#else /* !LARGE_SMB_OFF_T */
@@ -2948,10 +2940,10 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req)
* Ensure we haven't been sent a >32 bit offset.
*/
- if(IVAL(inbuf,smb_vwv10) != 0) {
+ if(IVAL(req->inbuf,smb_vwv10) != 0) {
DEBUG(0,("reply_read_and_X - large offset (%x << 32) "
"used and we don't support 64 bit offsets.\n",
- (unsigned int)IVAL(inbuf,smb_vwv10) ));
+ (unsigned int)IVAL(req->inbuf,smb_vwv10) ));
END_PROFILE(SMBreadX);
reply_doserror(req, ERRDOS, ERRbadaccess);
return;
@@ -2968,6 +2960,14 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req)
return;
}
+ if (!reply_prep_legacy(req, &inbuf, &outbuf, &length, &bufsize)) {
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ END_PROFILE(SMBreadX);
+ return;
+ }
+
+ set_message(inbuf,outbuf,12,0,True);
+
if (!big_readX
&& schedule_aio_read_and_X(conn, inbuf, outbuf, length, bufsize,
fsp, startpos, smb_maxcnt)) {