s3: Make sure the andX chains are ended correctly
authorVolker Lendecke <vl@samba.org>
Sun, 26 Feb 2012 15:49:09 +0000 (16:49 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 10 Mar 2012 14:34:11 +0000 (15:34 +0100)
Normally chain_reply took care of this. This will go away soon.

source3/smbd/blocking.c
source3/smbd/nttrans.c
source3/smbd/pipes.c
source3/smbd/reply.c
source3/smbd/sesssetup.c

index 6496e4350544ff0adc43a9f44d18ed2e64ba3a17..ac878926d132ddce0cd99ba8de8694a60f3542bf 100644 (file)
@@ -271,6 +271,8 @@ static void reply_lockingX_success(struct blocking_lock_record *blr)
        struct smb_request *req = blr->req;
 
        reply_outbuf(req, 2, 0);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
 
        /*
         * As this message is a lockingX call we must handle
index cfa048ba19e84281173a23794331e7af6c8f8002..b03e0997a2ce09f26a0e0c45f72e5756c6a6294a 100644 (file)
@@ -352,6 +352,9 @@ static void do_ntcreate_pipe_open(connection_struct *conn,
                reply_outbuf(req, 34, 0);
        }
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        p = (char *)req->outbuf + smb_vwv2;
        p++;
        SSVAL(p,0,pnum);
@@ -634,6 +637,9 @@ void reply_ntcreate_and_X(struct smb_request *req)
                reply_outbuf(req, 34, 0);
        }
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        p = (char *)req->outbuf + smb_vwv2;
 
        SCVAL(p, 0, oplock_granted);
index 9e5dfc3018087a0e24369820c8eadfc3e47e3676..d567537ed6144b0dfc19c099883c174a404b7936 100644 (file)
@@ -146,6 +146,9 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
        /* Prepare the reply */
        reply_outbuf(req, 15, 0);
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        /* Mark the opened file as an existing named pipe in message mode. */
        SSVAL(req->outbuf,smb_vwv9,2);
        SSVAL(req->outbuf,smb_vwv10,0xc700);
@@ -354,6 +357,9 @@ static void pipe_write_andx_done(struct tevent_req *subreq)
 
        reply_outbuf(req, 6, 0);
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        nwritten = (state->pipe_start_message_raw ? nwritten + 2 : nwritten);
        SSVAL(req->outbuf,smb_vwv2,nwritten);
 
@@ -417,6 +423,9 @@ void reply_pipe_read_and_X(struct smb_request *req)
        state->smb_mincnt = SVAL(req->vwv+6, 0);
 
        reply_outbuf(req, 12, state->smb_maxcnt);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        data = (uint8_t *)smb_buf(req->outbuf);
 
        /*
index e3a3766239abd3dc40767bb199c5fbfdab16b9b0..1b156b2acc68c142399d14b1ef2e47045307975d 100644 (file)
@@ -860,6 +860,8 @@ void reply_tcon_and_X(struct smb_request *req)
                }
        }
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
 
        DEBUG(3,("tconX service=%s \n",
                 service));
@@ -2035,6 +2037,9 @@ void reply_open_and_X(struct smb_request *req)
                reply_outbuf(req, 15, 0);
        }
 
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        if (core_oplock_request && lp_fake_oplocks(SNUM(conn))) {
                SCVAL(req->outbuf, smb_flg,
                      CVAL(req->outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
@@ -2094,6 +2099,8 @@ void reply_ulogoffX(struct smb_request *req)
        invalidate_vuid(sconn, req->vuid);
 
        reply_outbuf(req, 2, 0);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
 
        DEBUG( 3, ( "ulogoffX vuid=%d\n", req->vuid ) );
 
@@ -3684,6 +3691,8 @@ normal_read:
 nosendfile_read:
 
        reply_outbuf(req, 12, smb_maxcnt);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
 
        nread = read_file(fsp, smb_buf(req->outbuf), startpos, smb_maxcnt);
        saved_errno = errno;
@@ -4628,6 +4637,8 @@ void reply_write_and_X(struct smb_request *req)
        }
 
        reply_outbuf(req, 6, 0);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
        SSVAL(req->outbuf,smb_vwv2,nwritten);
        SSVAL(req->outbuf,smb_vwv4,nwritten>>16);
 
@@ -7835,6 +7846,8 @@ void reply_lockingX(struct smb_request *req)
        }
 
        reply_outbuf(req, 2, 0);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
 
        DEBUG(3, ("lockingX fnum=%d type=%d num_locks=%d num_ulocks=%d\n",
                  fsp->fnum, (unsigned int)locktype, num_locks, num_ulocks));
index b2e1f2421fc8d2a6b97d7151cb936b125f3288f0..cc801364cd7f023908e1a7a7c0ad92c6bdcbaf1f 100644 (file)
@@ -736,6 +736,9 @@ void reply_sesssetup_and_X(struct smb_request *req)
 
        /* it's ok - setup a reply */
        reply_outbuf(req, 3, 0);
+       SSVAL(req->outbuf, smb_vwv0, 0xff); /* andx chain ends */
+       SSVAL(req->outbuf, smb_vwv1, 0);    /* no andx offset */
+
        if (get_Protocol() >= PROTOCOL_NT1) {
                push_signature(&req->outbuf);
                /* perhaps grab OS version here?? */