Magellan Linux

Contents of /trunk/samba/patches/samba-3.0.24-variable-os-expansion.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years ago) by niro
File size: 5116 byte(s)
-import

1 Index: samba-3.0.24/source/include/smb.h
2 ===================================================================
3 --- samba-3.0.24.orig/source/include/smb.h 2007-02-08 15:27:50.000000000 -0600
4 +++ samba-3.0.24/source/include/smb.h 2007-02-08 15:31:14.000000000 -0600
5 @@ -1436,6 +1436,7 @@
6 #define FLAGS2_LONG_PATH_COMPONENTS 0x0001
7 #define FLAGS2_EXTENDED_ATTRIBUTES 0x0002
8 #define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004
9 +#define FLAGS2_UNKNOWN_BIT4 0x0010
10 #define FLAGS2_IS_LONG_NAME 0x0040
11 #define FLAGS2_EXTENDED_SECURITY 0x0800
12 #define FLAGS2_DFS_PATHNAMES 0x1000
13 @@ -1499,7 +1500,8 @@
14
15 /* Remote architectures we know about. */
16 enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
17 - RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_SAMBA, RA_CIFSFS};
18 + RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
19 + RA_SAMBA, RA_CIFSFS};
20
21 /* case handling */
22 enum case_handling {CASE_LOWER,CASE_UPPER};
23 Index: samba-3.0.24/source/smbd/negprot.c
24 ===================================================================
25 --- samba-3.0.24.orig/source/smbd/negprot.c 2007-02-08 15:27:50.000000000 -0600
26 +++ samba-3.0.24/source/smbd/negprot.c 2007-02-08 15:42:10.000000000 -0600
27 @@ -263,6 +263,16 @@
28
29 global_encrypted_passwords_negotiated = lp_encrypted_passwords();
30
31 + /* Check the flags field to see if this is Vista.
32 + WinXP sets it and Vista does not. But we have to
33 + distinguish from NT which doesn't set it either. */
34 +
35 + if ( (SVAL(inbuf, smb_flg2) & FLAGS2_EXTENDED_SECURITY) &&
36 + ((SVAL(inbuf, smb_flg2) & FLAGS2_UNKNOWN_BIT4) == 0) )
37 + {
38 + set_remote_arch( RA_VISTA );
39 + }
40 +
41 /* do spnego in user level security if the client
42 supports it and we can do encrypted passwords */
43
44 @@ -393,6 +403,15 @@
45 protocol [LANMAN2.1]
46 protocol [NT LM 0.12]
47
48 +Vista:
49 +protocol [PC NETWORK PROGRAM 1.0]
50 +protocol [LANMAN1.0]
51 +protocol [Windows for Workgroups 3.1a]
52 +protocol [LM1.2X002]
53 +protocol [LANMAN2.1]
54 +protocol [NT LM 0.12]
55 +protocol [SMB 2.001]
56 +
57 OS/2:
58 protocol [PC NETWORK PROGRAM 1.0]
59 protocol [XENIX CORE]
60 @@ -406,18 +425,19 @@
61 *
62 * This appears to be the matrix of which protocol is used by which
63 * MS product.
64 - Protocol WfWg Win95 WinNT Win2K OS/2
65 - PC NETWORK PROGRAM 1.0 1 1 1 1 1
66 + Protocol WfWg Win95 WinNT Win2K OS/2 Vista
67 + PC NETWORK PROGRAM 1.0 1 1 1 1 1 1
68 XENIX CORE 2 2
69 MICROSOFT NETWORKS 3.0 2 2
70 DOS LM1.2X002 3 3
71 MICROSOFT NETWORKS 1.03 3
72 DOS LANMAN2.1 4 4
73 - LANMAN1.0 4 2 3
74 - Windows for Workgroups 3.1a 5 5 5 3
75 - LM1.2X002 6 4 4
76 - LANMAN2.1 7 5 5
77 - NT LM 0.12 6 8 6
78 + LANMAN1.0 4 2 3 2
79 + Windows for Workgroups 3.1a 5 5 5 3 3
80 + LM1.2X002 6 4 4 4
81 + LANMAN2.1 7 5 5 5
82 + NT LM 0.12 6 8 6 6
83 + SMB 2.001 7
84 *
85 * tim@fsg.com 09/29/95
86 * Win2K added by matty 17/7/99
87 @@ -430,6 +450,7 @@
88 #define ARCH_OS2 0x14 /* Again OS/2 is like NT */
89 #define ARCH_SAMBA 0x20
90 #define ARCH_CIFSFS 0x40
91 +#define ARCH_VISTA 0x8C /* Vista is like XP/2K */
92
93 #define ARCH_ALL 0x7F
94
95 @@ -493,6 +514,8 @@
96 arch &= ( ARCH_WFWG | ARCH_WIN95 );
97 else if (strcsequal(p,"NT LM 0.12"))
98 arch &= ( ARCH_WIN95 | ARCH_WINNT | ARCH_WIN2K | ARCH_CIFSFS);
99 + else if (strcsequal(p,"SMB 2.001"))
100 + arch = ARCH_VISTA;
101 else if (strcsequal(p,"LANMAN2.1"))
102 arch &= ( ARCH_WINNT | ARCH_WIN2K | ARCH_OS2 );
103 else if (strcsequal(p,"LM1.2X002"))
104 @@ -537,7 +560,13 @@
105 set_remote_arch(RA_WINNT);
106 break;
107 case ARCH_WIN2K:
108 - set_remote_arch(RA_WIN2K);
109 + /* Vista may have been set in the negprot so don't
110 + override it here */
111 + if ( get_remote_arch() != RA_VISTA )
112 + set_remote_arch(RA_WIN2K);
113 + break;
114 + case ARCH_VISTA:
115 + set_remote_arch(RA_VISTA);
116 break;
117 case ARCH_OS2:
118 set_remote_arch(RA_OS2);
119 Index: samba-3.0.24/source/lib/util.c
120 ===================================================================
121 --- samba-3.0.24.orig/source/lib/util.c 2007-02-08 15:27:50.000000000 -0600
122 +++ samba-3.0.24/source/lib/util.c 2007-02-08 15:31:14.000000000 -0600
123 @@ -2182,6 +2182,9 @@
124 case RA_WIN2K3:
125 fstrcpy(remote_arch, "Win2K3");
126 break;
127 + case RA_VISTA:
128 + fstrcpy(remote_arch, "Vista");
129 + break;
130 case RA_SAMBA:
131 fstrcpy(remote_arch,"Samba");
132 break;