Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-497-g211e255

2009-03-18 Thread Stefan (metze) Metzmacher
Hi Zach,

   switch (transport-options.signing) {
   case SMB_SIGNING_OFF:
 @@ -187,7 +188,7 @@ static void continue_socket(struct composite_context 
 *creq)
   state-negprot.in.capabilities  = 0;
   unix_to_nt_time(state-negprot.in.start_time, time(NULL));
   dialects[0] = SMB2_DIALECT_REVISION;
 - dialects[1] = 0;
 + dialects[1] = SMB21_DIALECT_REVISION;
   state-negprot.in.dialects = dialects;

There was a reason to also provide dialect '0', as I want to work
against early longhorn beta versions.

I think the list should be:

dialects[0] = SMB21_DIALECT_REVISION;
dialects[1] = SMB2_DIALECT_REVISION;
dialects[2] = 0;

If we want SMB21_DIALECT_REVISION.

   req = smb2_negprot_send(transport, state-negprot);
 diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
 index d1d5b84..3cc3ec2 100644
 --- a/source4/libcli/smb2/smb2.h
 +++ b/source4/libcli/smb2/smb2.h
 @@ -35,6 +35,7 @@ struct smb2_negotiate {
   NTTIME system_time;
   NTTIME server_start_time;
   uint16_t security_mode;
 + uint16_t dialect_revision;
  };
  
  /* this is the context for the smb2 transport layer */
 @@ -226,8 +227,9 @@ struct smb2_request {
  
  #define SMB2_MAGIC 0x424D53FE /* 0xFE 'S' 'M' 'B' */
  
 -/* the dialect we support */
 +/* the dialects we support */
  #define SMB2_DIALECT_REVISION   0x202
 +#define SMB21_DIALECT_REVISION  0x210
  
  /* SMB2 negotiate security_mode */
  #define SMB2_NEGOTIATE_SIGNING_ENABLED   0x01
 diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c
 index 4e7cdf5..7f544b5 100644
 --- a/source4/libcli/util/nterr.c
 +++ b/source4/libcli/util/nterr.c
 @@ -549,6 +549,7 @@ static const nt_err_code_struct nt_errs[] =
   { NT_STATUS_OBJECTID_NOT_FOUND, NT_STATUS_OBJECTID_NOT_FOUND },
   { NT_STATUS_DOWNGRADE_DETECTED, NT_STATUS_DOWNGRADE_DETECTED },
   { NT_STATUS_DS_BUSY, NT_STATUS_DS_BUSY },
 + { XXX_INVALID_RANGE, NT_STATUS_WIN7_INVALID_RANGE },

Could you please fix this, and let us display the correct name?

metze



signature.asc
Description: OpenPGP digital signature


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-497-g211e255

2009-03-17 Thread Tim Prouty
The branch, master has been updated
   via  211e2555690afc0436c2bafb7ef8d426564cc680 (commit)
   via  7bf2a213cd589e1f0f80faab343aea30263046c2 (commit)
   via  6c08e329fa9396474b200fe7593d4a5c2082930a (commit)
  from  b29c69f45953bf099f1d4f6e6abd5726f5ac793e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 211e2555690afc0436c2bafb7ef8d426564cc680
Author: Zach Loafman zachary.loaf...@isilon.com
Date:   Mon Mar 16 09:24:06 2009 -0700

s4 torture: Win7 has a slightly different allowed access mask

Still investigating.

commit 7bf2a213cd589e1f0f80faab343aea30263046c2
Author: Zach Loafman zachary.loaf...@isilon.com
Date:   Fri Mar 13 09:04:33 2009 -0700

s4 torture: Add a string version for NT_STATUS_WIN7_INVALID_RANGE

Also submitted a request to cifs-protocol for a real name for this
thing. Use win7 target logic in smb2 lock test, SMB2-LOCK now passes
against Win7.

commit 6c08e329fa9396474b200fe7593d4a5c2082930a
Author: Zach Loafman zachary.loaf...@isilon.com
Date:   Thu Mar 12 08:32:58 2009 -0700

s4 libcli: Add SMB2.1 dialect to libcli

Negotiate 2.1 if possible, leave negotiate results in
transport-negotiate.dialect_revision.

---

Summary of changes:
 source4/libcli/smb2/connect.c |3 ++-
 source4/libcli/smb2/smb2.h|4 +++-
 source4/libcli/util/nterr.c   |1 +
 source4/torture/smb2/create.c |8 +++-
 source4/torture/smb2/lock.c   |   39 +--
 5 files changed, 42 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index 11bec42..3fd9a38 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -108,6 +108,7 @@ static void continue_negprot(struct smb2_request *req)
transport-negotiate.system_time = state-negprot.out.system_time;
transport-negotiate.server_start_time = 
state-negprot.out.server_start_time;
transport-negotiate.security_mode = state-negprot.out.security_mode;
+   transport-negotiate.dialect_revision = 
state-negprot.out.dialect_revision;
 
switch (transport-options.signing) {
case SMB_SIGNING_OFF:
@@ -187,7 +188,7 @@ static void continue_socket(struct composite_context *creq)
state-negprot.in.capabilities  = 0;
unix_to_nt_time(state-negprot.in.start_time, time(NULL));
dialects[0] = SMB2_DIALECT_REVISION;
-   dialects[1] = 0;
+   dialects[1] = SMB21_DIALECT_REVISION;
state-negprot.in.dialects = dialects;
 
req = smb2_negprot_send(transport, state-negprot);
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index d1d5b84..3cc3ec2 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -35,6 +35,7 @@ struct smb2_negotiate {
NTTIME system_time;
NTTIME server_start_time;
uint16_t security_mode;
+   uint16_t dialect_revision;
 };
 
 /* this is the context for the smb2 transport layer */
@@ -226,8 +227,9 @@ struct smb2_request {
 
 #define SMB2_MAGIC 0x424D53FE /* 0xFE 'S' 'M' 'B' */
 
-/* the dialect we support */
+/* the dialects we support */
 #define SMB2_DIALECT_REVISION   0x202
+#define SMB21_DIALECT_REVISION  0x210
 
 /* SMB2 negotiate security_mode */
 #define SMB2_NEGOTIATE_SIGNING_ENABLED   0x01
diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c
index 4e7cdf5..7f544b5 100644
--- a/source4/libcli/util/nterr.c
+++ b/source4/libcli/util/nterr.c
@@ -549,6 +549,7 @@ static const nt_err_code_struct nt_errs[] =
{ NT_STATUS_OBJECTID_NOT_FOUND, NT_STATUS_OBJECTID_NOT_FOUND },
{ NT_STATUS_DOWNGRADE_DETECTED, NT_STATUS_DOWNGRADE_DETECTED },
{ NT_STATUS_DS_BUSY, NT_STATUS_DS_BUSY },
+   { XXX_INVALID_RANGE, NT_STATUS_WIN7_INVALID_RANGE },
{ STATUS_MORE_ENTRIES, STATUS_MORE_ENTRIES },
{ STATUS_SOME_UNMAPPED, STATUS_SOME_UNMAPPED },
{ STATUS_NOTIFY_CLEANUP, STATUS_NOTIFY_CLEANUP },
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index 6d898a1..febfbe0 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -43,6 +43,8 @@
return false;   \
}} while (0)
 
+#define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, win7, false))
+
 /*
   test some interesting combinations found by gentest
  */
@@ -160,7 +162,11 @@ static bool test_create_gentest(struct torture_context 
*torture, struct smb2_tre
}
}
 
-   CHECK_EQUAL(access_mask, 0x0df0fe00);
+   if (TARGET_IS_WIN7(torture)) {
+   CHECK_EQUAL(access_mask, 0x0de0fe00);
+   } else {
+   CHECK_EQUAL(access_mask, 0x0df0fe00);
+   }