summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-16 00:54:16 +0000
committerJeremy Allison <jra@samba.org>1998-10-16 00:54:16 +0000
commit070b33489179d07ed76530ad52b828e6e708789d (patch)
treed5c58264420d93421d0caa1522514ab02b4a38ba
parent1bcbc67767e68ae12533c1ea44e2c0a567e4c93c (diff)
downloadsamba-070b33489179d07ed76530ad52b828e6e708789d.tar.gz
samba-070b33489179d07ed76530ad52b828e6e708789d.tar.bz2
samba-070b33489179d07ed76530ad52b828e6e708789d.zip
trans2.h: Added Thursby MAC extension.
smbd/trans2.c: Added Thursby MAX extension. libsmb/clientgen.c: Fixed smbtorture lock code. Jeremy. (This used to be commit 514e52e4b4d6c7db7ebe2265e60c77b4f18d11b3)
-rw-r--r--source3/include/trans2.h6
-rw-r--r--source3/libsmb/clientgen.c8
-rw-r--r--source3/smbd/trans2.c7
3 files changed, 21 insertions, 0 deletions
diff --git a/source3/include/trans2.h b/source3/include/trans2.h
index 894823602e..634244a193 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -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
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index a6ffb57834..3c2ad3e0ea 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -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);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index c075ae6c1b..550be0df41 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -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));
}