diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-11 10:26:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:28 -0500 |
commit | 61ee2d37200f8cc00d4b0291683f4b3fb8992457 (patch) | |
tree | a87c198c7a4f92750d656a7daed1f8482c95f61e | |
parent | 02c21aa207be1316f4fcbb5d42b851bcf9abeb50 (diff) | |
download | samba-61ee2d37200f8cc00d4b0291683f4b3fb8992457.tar.gz samba-61ee2d37200f8cc00d4b0291683f4b3fb8992457.tar.bz2 samba-61ee2d37200f8cc00d4b0291683f4b3fb8992457.zip |
r24322: Wrap reply_read_and_X in reply_prep_legacy
(This used to be commit 7926b5dfb8d05ad2fe40c3f7658a492f0450e505)
-rw-r--r-- | source3/smbd/process.c | 2 | ||||
-rw-r--r-- | source3/smbd/reply.c | 29 |
2 files changed, 29 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index d0531bdfd9..2946eb878f 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -736,7 +736,7 @@ static const struct smb_message_struct { /* 0x2b */ { "SMBecho",NULL,reply_echo,0}, /* 0x2c */ { "SMBwriteclose",reply_writeclose,NULL,AS_USER}, /* 0x2d */ { "SMBopenX",NULL,reply_open_and_X,AS_USER | CAN_IPC }, -/* 0x2e */ { "SMBreadX",reply_read_and_X,NULL,AS_USER | CAN_IPC }, +/* 0x2e */ { "SMBreadX",NULL,reply_read_and_X,AS_USER | CAN_IPC }, /* 0x2f */ { "SMBwriteX",NULL,reply_write_and_X,AS_USER | CAN_IPC }, /* 0x30 */ { NULL, NULL, NULL, 0 }, /* 0x31 */ { NULL, NULL, NULL, 0 }, diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 3e35c0064b..7cfcecbf2f 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2858,7 +2858,9 @@ normal_read: Reply to a read and X. ****************************************************************************/ -int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize) +static int reply_read_and_X_old(connection_struct *conn, + char *inbuf, char *outbuf, + int length,int bufsize) { files_struct *fsp; SMB_OFF_T startpos; @@ -2956,6 +2958,31 @@ int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt return nread; } +void reply_read_and_X(connection_struct *conn, struct smb_request *req) +{ + char *inbuf, *outbuf; + int length, bufsize; + int outsize; + + if (!reply_prep_legacy(req, &inbuf, &outbuf, &length, &bufsize)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + return; + } + + outsize = reply_read_and_X_old(conn, inbuf, outbuf, length, bufsize); + + DEBUG(10, ("outsize = %d\n", outsize)); + + /* + * Can't use reply_post_legacy here, setup_readX_header has set up its + * size itself already. + */ + + if (outsize == -1) { + TALLOC_FREE(req->outbuf); + } +} + /**************************************************************************** Reply to a writebraw (core+ or LANMAN1.0 protocol). ****************************************************************************/ |