DOESN't work s3:smbd: detect w2k8 and win7 clients
authorStefan Metzmacher <metze@samba.org>
Fri, 20 Aug 2010 10:47:01 +0000 (12:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 26 Aug 2010 06:49:41 +0000 (08:49 +0200)
metze

source3/include/smb.h
source3/lib/util.c
source3/smbd/negprot.c

index 74f1eb535ad1bdabd771becf9cb45fca1c362c07..0c820a7515f46a7eafc82f9360ef0a2c2c30ef95 100644 (file)
@@ -1582,7 +1582,7 @@ enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PAS
 /* Remote architectures we know about. */
 enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
                        RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
-                       RA_SAMBA, RA_CIFSFS, RA_WINXP64};
+                       RA_SAMBA, RA_CIFSFS, RA_WINXP64, RA_WIN2K8, RA_WIN7};
 
 /* case handling */
 enum case_handling {CASE_LOWER,CASE_UPPER};
index 8bea36b870eccb58c4399d4403328de76ca90c9f..b255ad679f9ef457d4deca3716455e0953a596bf 100644 (file)
@@ -1900,6 +1900,12 @@ void set_remote_arch(enum remote_arch_types type)
        case RA_VISTA:
                remote_arch_str = "Vista";
                break;
+       case RA_WIN2K8:
+               remote_arch_str = "Win2K8";
+               break;
+       case RA_WIN7:
+               remote_arch_str = "Win7";
+               break;
        case RA_SAMBA:
                remote_arch_str = "Samba";
                break;
index 2908c2613e2158063452153d554f88cad484e597..dd4d66aa29b632bbb5138eb536bea274d16fbcac 100644 (file)
@@ -461,6 +461,26 @@ protocol [XENIX CORE]
 protocol [LANMAN1.0]
 protocol [LM1.2X002]
 protocol [LANMAN2.1]
+
+Win2k8:
+protocol [PC NETWORK PROGRAM 1.0]
+protocol [LANMAN1.0]
+protocol [Windows for Workgroups 3.1a]
+protocol [LM1.2X002]
+protocol [LANMAN2.1]
+protocol [NT LM 0.12]
+protocol [SMB 2.002]
+
+Win7:
+protocol [PC NETWORK PROGRAM 1.0]
+protocol [LANMAN1.0]
+protocol [Windows for Workgroups 3.1a]
+protocol [LM1.2X002]
+protocol [LANMAN2.1]
+protocol [NT LM 0.12]
+protocol [SMB 2.002]
+protocol [SMB 2.???]
+
 */
 
 /*
@@ -468,19 +488,21 @@ protocol [LANMAN2.1]
   *
   * This appears to be the matrix of which protocol is used by which
   * MS product.
-       Protocol                       WfWg    Win95   WinNT  Win2K  OS/2 Vista
-       PC NETWORK PROGRAM 1.0          1       1       1      1      1     1
-       XENIX CORE                                      2             2
-       MICROSOFT NETWORKS 3.0          2       2       
-       DOS LM1.2X002                   3       3       
-       MICROSOFT NETWORKS 1.03                         3
-       DOS LANMAN2.1                   4       4       
-       LANMAN1.0                                       4      2      3     2
-       Windows for Workgroups 3.1a     5       5       5      3            3
-       LM1.2X002                                       6      4      4     4
-       LANMAN2.1                                       7      5      5     5
-       NT LM 0.12                              6       8      6            6
-       SMB 2.001                                                           7
+       Protocol                    WfWg Win95 WinNT Win2K OS/2 Vista W2K8 Win7
+       PC NETWORK PROGRAM 1.0       1     1     1     1     1    1    1    1
+       XENIX CORE                               2           2
+       MICROSOFT NETWORKS 3.0       2     2
+       DOS LM1.2X002                3     3
+       MICROSOFT NETWORKS 1.03                  3
+       DOS LANMAN2.1                4     4
+       LANMAN1.0                                4     2     3    2    2    2
+       Windows for Workgroups 3.1a  5     5     5     3          3    3    3
+       LM1.2X002                                6     4     4    4    4    4
+       LANMAN2.1                                7     5     5    5    5    5
+       NT LM 0.12                         6     8     6          6    6    6
+       SMB 2.001                                                 7
+       SMB 2.002                                                      7    7
+       SMB 2.???                                                           8
   *
   *  tim@fsg.com 09/29/95
   *  Win2K added by matty 17/7/99
@@ -494,8 +516,10 @@ protocol [LANMAN2.1]
 #define ARCH_SAMBA    0x20
 #define ARCH_CIFSFS   0x40
 #define ARCH_VISTA    0x8C     /* Vista is like XP/2K */
+#define ARCH_W2K8     0x10C    /* W2K8 is like XP/2K */
+#define ARCH_WIN7     0x30C    /* Win7 is like W2K8 */
  
-#define ARCH_ALL      0x7F
+#define ARCH_ALL      0x3FF
  
 /* List of supported protocols, most desired first */
 static const struct {
@@ -607,7 +631,11 @@ void reply_negprot(struct smb_request *req)
                        arch &= ( ARCH_WIN95 | ARCH_WINNT | ARCH_WIN2K
                                  | ARCH_CIFSFS);
                else if (strcsequal(cliprotos[i], "SMB 2.001"))
-                       arch = ARCH_VISTA;              
+                       arch &= ( ARCH_VISTA );
+               else if (strcsequal(cliprotos[i], "SMB 2.002"))
+                       arch &= ( ARCH_W2K8 );
+               else if (strcsequal(cliprotos[i], "SMB 2.???"))
+                       arch &= ( ARCH_WIN7 );
                else if (strcsequal(cliprotos[i], "LANMAN2.1"))
                        arch &= ( ARCH_WINNT | ARCH_WIN2K | ARCH_OS2 );
                else if (strcsequal(cliprotos[i], "LM1.2X002"))
@@ -658,6 +686,12 @@ void reply_negprot(struct smb_request *req)
                case ARCH_VISTA:
                        set_remote_arch(RA_VISTA);
                        break;
+               case ARCH_W2K8:
+                       set_remote_arch(RA_WIN2K8);
+                       break;
+               case ARCH_WIN7:
+                       set_remote_arch(RA_WIN7);
+                       break;
                case ARCH_OS2:
                        set_remote_arch(RA_OS2);
                        break;