- fix a bug handling readraw packets that caused the timeout to be 30
[kai/samba.git] / source3 / smbd / trans2.c
index 36dd5eba3e46fd07f5615fe1ec94d28b7603733d..9b5419010e2d68a5a09089c4e8b07ff11df6feb0 100644 (file)
@@ -22,7 +22,6 @@
 */
 
 #include "includes.h"
-#include "loadparm.h"
 #include "trans2.h"
 
 extern int DEBUGLEVEL;
@@ -325,11 +324,11 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l
 
          mode = dos_mode(cnum,pathreal,&sbuf);
 
-         if (((mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0)
-           {         
-             DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype));
-             continue;
-           }
+         if (!dir_check_ftype(cnum,mode,&sbuf,dirtype)) {
+           DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype));
+           continue;
+         }
+
          size = sbuf.st_size;
          mdate = sbuf.st_mtime;
          adate = sbuf.st_atime;
@@ -1555,10 +1554,8 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
 
       while( num_data_sofar < total_data || num_params_sofar < total_params)
        {
-         receive_smb(Client,inbuf, 0);
-         
-         /* Ensure this is still a trans2 packet (sanity check) */
-         if(CVAL(inbuf, smb_com) != SMBtranss2)
+         if(!receive_smb(Client,inbuf, SMB_SECONDARY_WAIT) ||
+            CVAL(inbuf, smb_com) != SMBtranss2)
            {
              outsize = set_message(outbuf,0,0,True);
              DEBUG(2,("Invalid secondary trans2 packet\n"));