1 |
diff -Nur e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11maxProtocol e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11maxProtocol |
2 |
--- e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11maxProtocol 2016-02-05 12:16:12.000000000 -0500 |
3 |
+++ e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11maxProtocol 2020-06-23 13:57:15.530000000 -0400 |
4 |
@@ -1,12 +1,27 @@ |
5 |
{ |
6 |
# Normally this should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropiate protocol. |
7 |
$OUT = ""; |
8 |
- if ($smb{ClientMaxProtocol}) |
9 |
- { |
10 |
- $OUT .= "client max protocol = $smb{ClientMaxProtocol}\n"; |
11 |
- } |
12 |
- if ($smb{ServerMaxProtocol}) |
13 |
- { |
14 |
- $OUT .= "server max protocol = $smb{ServerMaxProtocol}"; |
15 |
- } |
16 |
-} |
17 |
+ our %ProtocolOrder = ( CORE => 1, # samba client default without explicit option; not available for server |
18 |
+ COREPLUS => 2, # not available for server |
19 |
+ LANMAN1 => 3, #samba server default without explicit option |
20 |
+ LANMAN2 => 4, |
21 |
+ NT1 => 5, # CIFS or SMB1 |
22 |
+ SMB2_02 => 6, |
23 |
+ SMB2_10 => 7, |
24 |
+ SMB2 => 7, # yes SMB2 default to 2_10 |
25 |
+ SMB2_22 => 8, |
26 |
+ SMB2_24 => 9, |
27 |
+ SMB3_00 => 10, |
28 |
+ SMB3_02 => 11, |
29 |
+ SMB3_10 => 12, |
30 |
+ SMB3_11 => 13, |
31 |
+ 'SMB3' => 13 # yes SMB3 default to SMB3_11 |
32 |
+ ); |
33 |
+ $clientMaxProt = $smb{ClientMaxProtocol} || "SMB3"; |
34 |
+ $serverMaxProt = $smb{ServerMaxProtocol} || "SMB3"; |
35 |
+ #checking option is possible |
36 |
+ $clientMaxProt = ( exists($ProtocolOrder{$clientMaxProt}) ) ? $clientMaxProt : "SMB3"; |
37 |
+ $serverMaxProt = ( exists($ProtocolOrder{$serverMaxProt}) && $ProtocolOrder{$serverMaxProt} >= 3) ? $serverMaxProt : "SMB3"; |
38 |
+ $OUT .= "client max protocol = $clientMaxProt\n"; |
39 |
+ $OUT .= "server max protocol = $serverMaxProt"; |
40 |
+} |
41 |
diff -Nur e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11minProtocol e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11minProtocol |
42 |
--- e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11minProtocol 1969-12-31 19:00:00.000000000 -0500 |
43 |
+++ e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11minProtocol 2020-06-23 13:57:34.819000000 -0400 |
44 |
@@ -0,0 +1,16 @@ |
45 |
+{ |
46 |
+# Normally this should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropiate protocol. |
47 |
+ $OUT = ""; |
48 |
+ $clientMinProt = $smb{ClientMinProtocol} || "SMB2"; |
49 |
+ $serverMinProt = $smb{ServerMinProtocol} || "SMB2"; |
50 |
+ $clientMinProt = ( exists($ProtocolOrder{$clientMinProt}) ) ? $clientMinProt : "SMB2"; |
51 |
+ $serverMinProt = ( exists($ProtocolOrder{$serverMinProt}) && $ProtocolOrder{$serverMinProt} >= 3) ? $serverMinProt : "SMB3"; |
52 |
+ #checking min prot is not higher |
53 |
+ $clientMinProt = ( $ProtocolOrder{$clientMaxProt} >= $ProtocolOrder{$clientMinProt} ) ? $clientMinProt : $clientMaxProt; |
54 |
+ $serverMinProt = ( $ProtocolOrder{$serverMaxProt} >= $ProtocolOrder{$serverMinProt} ) ? $serverMinProt : $serverMaxProt; |
55 |
+ |
56 |
+ $OUT .= "client min protocol = $clientMinProt\n"; |
57 |
+ $OUT .= "server min protocol = $serverMinProt"; |
58 |
+ |
59 |
+} |
60 |
+ |
61 |
diff -Nur e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11smbPorts e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11smbPorts |
62 |
--- e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11smbPorts 2007-12-15 10:53:08.000000000 -0500 |
63 |
+++ e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11smbPorts 2020-06-23 13:57:48.232000000 -0400 |
64 |
@@ -1,5 +1,7 @@ |
65 |
{ |
66 |
- my $smb_ports = $smb{SMBPorts} || 139; |
67 |
+ my $smb_ports = $smb{SMBPorts} || "139 445"; |
68 |
|
69 |
+ $smb_ports = "$smb_ports 445" unless ( $smb_ports =~ /445/ || $ProtocolOrder{$serverMaxProt} <= 5 ); |
70 |
+ |
71 |
"smb ports = $smb_ports"; |
72 |
} |