s3: Remove "req_wct_ofs()"
authorVolker Lendecke <vl@samba.org>
Fri, 2 Mar 2012 23:33:15 +0000 (00:33 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 10 Mar 2012 14:34:12 +0000 (15:34 +0100)
This is fixed up in construct_reply_chain

source3/smbd/pipes.c
source3/smbd/process.c
source3/smbd/proto.h
source3/smbd/reply.c

index b39c0f0e5959313d7afc0a26987d0ea3315f11fb..c21b635bfb66b2d18ef2a6fac8876b0225163225 100644 (file)
@@ -479,7 +479,7 @@ static void pipe_read_andx_done(struct tevent_req *subreq)
 
        SSVAL(req->outbuf,smb_vwv5,nread);
        SSVAL(req->outbuf,smb_vwv6,
-             req_wct_ofs(req)
+             (smb_wct - 4)     /* offset from smb header to wct */
              + 1               /* the wct field */
              + 12 * sizeof(uint16_t) /* vwv */
              + 2);             /* the buflen field */
index c163212bc0dd5c901d3f95a3fd78e5f45f6c099c..c3304c7114d27a46d0e4650eecd3d635a7f669f4 100644 (file)
@@ -1833,25 +1833,6 @@ void construct_reply_common_req(struct smb_request *req, char *outbuf)
        construct_reply_common(req, (const char *)req->inbuf, outbuf);
 }
 
-/*
- * 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;
-}
-
 /**
  * @brief Find the smb_cmd offset of the last command pushed
  * @param[in] buf      The buffer we're building up
index f4aa06b0610ef4ba9249e2d16bf5210dc3e0d4ec..a467202ff4f8918fa258efe409125967963e8127 100644 (file)
@@ -784,7 +784,6 @@ const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
 void remove_from_common_flags2(uint32 v);
 void construct_reply_common_req(struct smb_request *req, char *outbuf);
-size_t req_wct_ofs(struct smb_request *req);
 bool smb1_is_chain(const uint8_t *buf);
 bool smb1_walk_chain(const uint8_t *buf,
                     bool (*fn)(uint8_t cmd,
index 8b94396578697dfedce442ae9543408a6ec3b7ed..6e4bcab7741e467770a8a911d994283db4af1c29 100644 (file)
@@ -3508,7 +3508,7 @@ static int setup_readX_header(struct smb_request *req, char *outbuf,
        SSVAL(outbuf,smb_vwv2,0xFFFF); /* Remaining - must be -1. */
        SSVAL(outbuf,smb_vwv5,smb_maxcnt);
        SSVAL(outbuf,smb_vwv6,
-             req_wct_ofs(req)
+             (smb_wct - 4)     /* offset from smb header to wct */
              + 1               /* the wct field */
              + 12 * sizeof(uint16_t) /* vwv */
              + 2);             /* the buflen field */