Fixed a couple of issues with the SMB_QUERY_FILE_ALL_INFO query.
authorJeremy Allison <jra@samba.org>
Mon, 26 Oct 1998 18:44:01 +0000 (18:44 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 26 Oct 1998 18:44:01 +0000 (18:44 +0000)
Ensured offset was being reported correctly for 64 bit file access,
ensured delete on close bit was being reported correctly.
Jeremy.
(This used to be commit 4332bc06c6604a3e14007eda4f40e6183a1f8526)

source3/smbd/trans2.c

index f0bd458798fc7a46319433b13c9352126d92c2cc..fdd3652cf746aac18b8995519602c3287f392a33 100644 (file)
@@ -1240,6 +1240,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
   int l;
   SMB_OFF_T pos = 0;
   BOOL bad_path = False;
+  BOOL delete_pending = False;
 
   if (tran_call == TRANSACT2_QFILEINFO) {
     files_struct *fsp = file_fsp(params,0);
@@ -1276,6 +1277,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
       }
       if((pos = sys_lseek(fsp->fd_ptr->fd,0,SEEK_CUR)) == -1)
         return(UNIXERROR(ERRDOS,ERRnoaccess));
+
+      delete_pending = fsp->fd_ptr->delete_on_close;
     }
   } else {
     /* qpathinfo */
@@ -1429,7 +1432,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
       SOFF_T(pdata,0,size);
       SOFF_T(pdata,8,size);
       SIVAL(pdata,16,sbuf.st_nlink);
-      CVAL(pdata,20) = 0;
+      CVAL(pdata,20) = delete_pending;
       CVAL(pdata,21) = (mode&aDIR)?1:0;
       pdata += 24;
       SINO_T(pdata,0,(SMB_INO_T)sbuf.st_ino); 
@@ -1440,7 +1443,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
       else
         SIVAL(pdata,0,0xd01BF);
       pdata += 4;
-      SIVAL(pdata,0,pos); /* current offset */
+      SOFF_T(pdata,0,pos); /* current offset */
       pdata += 8;
       SIVAL(pdata,0,mode); /* is this the right sort of mode info? */
       pdata += 4;