diff options
author | Volker Lendecke <vl@samba.org> | 2008-11-21 23:17:31 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-01-16 13:00:44 +0100 |
commit | ddaa65ef6e049a185281c4d5deca4045e3b085e2 (patch) | |
tree | f44b5ea5130fb4de174fa505957d748767be40ce /source3/smbd/process.c | |
parent | ba981128ac0ba5b6b6f865d72a26509fb52a4a3e (diff) | |
download | samba-ddaa65ef6e049a185281c4d5deca4045e3b085e2.tar.gz samba-ddaa65ef6e049a185281c4d5deca4045e3b085e2.tar.bz2 samba-ddaa65ef6e049a185281c4d5deca4045e3b085e2.zip |
Correctly calculate the offset for read&x
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 3547bfcc3a..1701cd33da 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1823,6 +1823,25 @@ void chain_reply(struct smb_request *req) #else /* + * How many bytes have we already accumulated up to the current wct field + * offset? + */ + +size_t req_wct_ofs(struct smb_request *req) +{ + size_t buf_size; + + if (req->chain_outbuf == NULL) { + return smb_wct - 4; + } + buf_size = talloc_get_size(req->chain_outbuf); + if ((buf_size % 4) != 0) { + buf_size += (4 - (buf_size % 4)); + } + return buf_size - 4; +} + +/* * Hack around reply_nterror & friends not being aware of chained requests, * generating illegal (i.e. wct==0) chain replies. */ |