trans2.h: Added Thursby MAC extension.
authorJeremy Allison <jra@samba.org>
Fri, 16 Oct 1998 00:54:16 +0000 (00:54 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 16 Oct 1998 00:54:16 +0000 (00:54 +0000)
smbd/trans2.c: Added Thursby MAX extension.
libsmb/clientgen.c: Fixed smbtorture lock code.
Jeremy.

source/include/trans2.h
source/libsmb/clientgen.c
source/smbd/trans2.c

index 894823602eecf801b8603be1a7a84baa90b8c60b..634244a1932e8370a5a17a5d8eefcf558a86a97c 100644 (file)
@@ -231,6 +231,12 @@ Byte offset   Type     name                description
 #define SMB_SET_FILE_ALLOCATION_INFO   0x103
 #define SMB_SET_FILE_END_OF_FILE_INFO  0x104
 
+/*
+ * Thursby MAC extensions....
+ */
+
+#define SMB_MAC_QUERY_FS_INFO           0x301
+
 #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName))
 
 #endif
index a6ffb57834e3328bbb53e736d8661feb9a0bd1d2..3c2ad3e0eaa5da8e18ff21cc50656eb4b181135f 100644 (file)
@@ -1126,6 +1126,7 @@ BOOL cli_close(struct cli_state *cli, int fnum)
 BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout)
 {
        char *p;
+        int saved_timeout = cli->timeout;
 
        bzero(cli->outbuf,smb_size);
        bzero(cli->inbuf,smb_size);
@@ -1149,10 +1150,16 @@ BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int ti
        SIVAL(p, 6, len);
 
        send_smb(cli->fd,cli->outbuf);
+
+        cli->timeout = (timeout == -1) ? 0x7FFFFFFF : timeout;
+
        if (!client_receive_smb(cli->fd,cli->inbuf,cli->timeout)) {
+                cli->timeout = saved_timeout;
                return False;
        }
 
+       cli->timeout = saved_timeout;
+
        if (CVAL(cli->inbuf,smb_rcls) != 0) {
                return False;
        }
@@ -1315,6 +1322,7 @@ static void cli_issue_write(struct cli_state *cli, int fnum, off_t offset, uint1
        
        CVAL(cli->outbuf,smb_vwv0) = 0xFF;
        SSVAL(cli->outbuf,smb_vwv2,fnum);
+
        SIVAL(cli->outbuf,smb_vwv3,offset);
        SIVAL(cli->outbuf,smb_vwv5,IS_BITS_SET_ALL(mode, 0x0008) ? 0xFFFFFFFF : 0);
        SSVAL(cli->outbuf,smb_vwv7,mode);
index c075ae6c1be936aede74a993f8697f9c45291afd..550be0df41103744321c5444579999309f666ae6 100644 (file)
@@ -1170,6 +1170,13 @@ static int call_trans2qfsinfo(connection_struct *conn,
       SIVAL(pdata,0,0); /* dev type */
       SIVAL(pdata,4,0); /* characteristics */
       break;
+    case SMB_MAC_QUERY_FS_INFO:
+      /*
+       * Thursby MAC extension...
+       */
+      data_len = 88;
+      SIVAL(pdata,84,0x100); /* Don't support mac... */
+      break;
     default:
       return(ERROR(ERRDOS,ERRunknownlevel));
   }