Author: jra
Date: 2007-04-08 00:47:49 +0000 (Sun, 08 Apr 2007)
New Revision: 22128

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22128

Log:
Fix the pipe open response with EXTENDED_RESPONSE_REQUIRED
set. Only the NTTrans create left to fix for csc.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0_25/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/nttrans.c    2007-04-07 21:13:29 UTC (rev 
22127)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c    2007-04-08 00:47:49 UTC (rev 
22128)
@@ -374,6 +374,7 @@
        int ret;
        int pnum = -1;
        char *p = NULL;
+       uint32 flags = IVAL(inbuf,smb_ntcreate_Flags);
 
        srvstr_pull_buf(inbuf, fname, smb_buf(inbuf), sizeof(fname), 
STR_TERMINATE);
 
@@ -385,7 +386,17 @@
         * Deal with pipe return.
         */  
 
-       set_message(outbuf,34,0,True);
+       if (flags & EXTENDED_RESPONSE_REQUIRED) {
+               /* This is very strange. We
+                * return 50 words, but only set
+                * the wcnt to 42 ? It's definately
+                * what happens on the wire....
+                */
+               set_message(outbuf,50,0,True);
+               SCVAL(outbuf,smb_wct,42);
+       } else {
+               set_message(outbuf,34,0,True);
+       }
 
        p = outbuf + smb_vwv2;
        p++;
@@ -400,7 +411,19 @@
        SSVAL(p,0,FILE_TYPE_MESSAGE_MODE_PIPE);
        /* Device state. */
        SSVAL(p,2, 0x5FF); /* ? */
+       p += 4;
 
+       if (flags & EXTENDED_RESPONSE_REQUIRED) {
+               p += 26;
+               SIVAL(p,0,FILE_GENERIC_ALL);
+               /* 
+                * For pipes W2K3 seems to return
+                * 0x12019B next.
+                * This is ((FILE_GENERIC_READ|FILE_GENERIC_WRITE) & 
~FILE_APPEND_DATA)
+                */
+               
SIVAL(p,4,(FILE_GENERIC_READ|FILE_GENERIC_WRITE)&~FILE_APPEND_DATA);
+       }
+
        DEBUG(5,("do_ntcreate_pipe_open: open pipe = %s\n", fname));
 
        return chain_reply(inbuf,outbuf,length,bufsize);

Modified: branches/SAMBA_3_0_25/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/nttrans.c 2007-04-07 21:13:29 UTC (rev 
22127)
+++ branches/SAMBA_3_0_25/source/smbd/nttrans.c 2007-04-08 00:47:49 UTC (rev 
22128)
@@ -374,6 +374,7 @@
        int ret;
        int pnum = -1;
        char *p = NULL;
+       uint32 flags = IVAL(inbuf,smb_ntcreate_Flags);
 
        srvstr_pull_buf(inbuf, fname, smb_buf(inbuf), sizeof(fname), 
STR_TERMINATE);
 
@@ -385,7 +386,17 @@
         * Deal with pipe return.
         */  
 
-       set_message(outbuf,34,0,True);
+       if (flags & EXTENDED_RESPONSE_REQUIRED) {
+               /* This is very strange. We
+                * return 50 words, but only set
+                * the wcnt to 42 ? It's definately
+                * what happens on the wire....
+                */
+               set_message(outbuf,50,0,True);
+               SCVAL(outbuf,smb_wct,42);
+       } else {
+               set_message(outbuf,34,0,True);
+       }
 
        p = outbuf + smb_vwv2;
        p++;
@@ -400,7 +411,19 @@
        SSVAL(p,0,FILE_TYPE_MESSAGE_MODE_PIPE);
        /* Device state. */
        SSVAL(p,2, 0x5FF); /* ? */
+       p += 4;
 
+       if (flags & EXTENDED_RESPONSE_REQUIRED) {
+               p += 26;
+               SIVAL(p,0,FILE_GENERIC_ALL);
+               /* 
+                * For pipes W2K3 seems to return
+                * 0x12019B next.
+                * This is ((FILE_GENERIC_READ|FILE_GENERIC_WRITE) & 
~FILE_APPEND_DATA)
+                */
+               
SIVAL(p,4,(FILE_GENERIC_READ|FILE_GENERIC_WRITE)&~FILE_APPEND_DATA);
+       }
+
        DEBUG(5,("do_ntcreate_pipe_open: open pipe = %s\n", fname));
 
        return chain_reply(inbuf,outbuf,length,bufsize);

Reply via email to