/[smeserver]/rpms/e-smith-samba/sme10/e-smith-samba-2.6.0-bz10963-bz10576-minprot-SMB2.patch
ViewVC logotype

Annotation of /rpms/e-smith-samba/sme10/e-smith-samba-2.6.0-bz10963-bz10576-minprot-SMB2.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Jun 23 18:03:14 2020 UTC (3 years, 11 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-samba-2_6_0-8_el7_sme
* Tue Jun 23 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-8.sme
- set min server and client protocol SMB2 [SME: 10576]
  add check so max always greater than min
- add port 445 if min server protocol is SMB2 or SMB3 [SME: 10963]

1 jpp 1.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,24 @@
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     + if ($smb{ClientMinProtocol})
60     + {
61     + $OUT .= "client min protocol = $smb{ClientMinProtocol}\n";
62     + }
63     + if ($smb{ServerMinProtocol})
64     + {
65     + $OUT .= "server min protocol = $smb{ServerMinProtocol}";
66     + }
67     +}
68     +
69     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
70     --- e-smith-samba-2.6.0.old/root/etc/e-smith/templates/etc/smb.conf/11smbPorts 2007-12-15 10:53:08.000000000 -0500
71     +++ e-smith-samba-2.6.0/root/etc/e-smith/templates/etc/smb.conf/11smbPorts 2020-06-23 13:57:48.232000000 -0400
72     @@ -1,5 +1,7 @@
73     {
74     my $smb_ports = $smb{SMBPorts} || 139;
75    
76     + $smb_ports = "$smb_ports 445" unless ( $smb_ports =~ /445/ || $ProtocolOrder{$serverMinProt} <= 5 );# $ProtocolOrder{$serverMinProt} > 5
77     +
78     "smb ports = $smb_ports";
79     }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed