/[smeserver]/rpms/e-smith-base/sme9/e-smith-base-5.6.0_added_verification_of_pptp_clients_against_dhcp.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme9/e-smith-base-5.6.0_added_verification_of_pptp_clients_against_dhcp.patch

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


Revision 1.1 - (show annotations) (download)
Sun Apr 6 16:03:59 2014 UTC (10 years, 1 month ago) by stephdl
Branch: MAIN
CVS Tags: e-smith-base-5_6_0-13_el6_sme, e-smith-base-5_6_0-36_el6_sme, e-smith-base-5_6_0-27_el6_sme, e-smith-base-5_6_0-22_el6_sme, e-smith-base-5_6_0-12_el6_sme, e-smith-base-5_6_0-33_el6_sme, e-smith-base-5_6_0-31_el6_sme, e-smith-base-5_6_0-10_el6_sme, e-smith-base-5_6_0-34_el6_sme, e-smith-base-5_6_0-16_el6_sme, e-smith-base-5_6_0-19_el6_sme, e-smith-base-5_6_0-28_el6_sme, e-smith-base-5_6_0-5_el6_sme, e-smith-base-5_6_0-11_el6_sme, e-smith-base-5_6_0-25_el6_sme, e-smith-base-5_6_0-21_el6_sme, e-smith-base-5_6_0-30_el6_sme, e-smith-base-5_6_0-35_el6_sme, e-smith-base-5_6_0-6_el6_sme, e-smith-base--, e-smith-base-5_6_0-32_el6_sme, e-smith-base-5_6_0-8_el6_sme, e-smith-base-5_6_0-7_el6_sme, e-smith-base-5_6_0-4_el6_sme, e-smith-base-5_6_0-26_el6_sme, e-smith-base-5_6_0-9_el6_sme, e-smith-base-5_6_0-23_el6_sme, e-smith-base-5_6_0-20_el6_sme, e-smith-base-5_6_0-29_el6_sme, e-smith-base-5_6_0-24_el6_sme, e-smith-base-5_6_0-17_el6_sme, e-smith-base-5_6_0-15_el6_sme, e-smith-base-5_6_0-18_el6_sme, HEAD
push to cvs a patch to solve [SME: 8312]

1 diff -Nur e-smith-base-5.6.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess e-smith-base-5.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess
2 --- e-smith-base-5.6.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess 2008-08-20 23:17:24.000000000 +0200
3 +++ e-smith-base-5.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess 2014-04-06 09:42:16.882174082 +0200
4 @@ -47,6 +47,10 @@
5 <base>LABEL_PPTP</base>
6 <trans>Number of PPTP clients</trans>
7 </entry>
8 + <entry>
9 + <base>NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE</base>
10 + <trans>The number of pptp clients is greater than the number of reserved IP for DHCP. You should take a smaller number.</trans>
11 + </entry>
12 <entry>
13 <base>LABEL_SSH_PORT</base>
14 <trans>TCP Port for secure shell access</trans>
15 diff -Nur e-smith-base-5.6.0-old/root/etc/e-smith/web/functions/remoteaccess e-smith-base-5.6.0/root/etc/e-smith/web/functions/remoteaccess
16 --- e-smith-base-5.6.0-old/root/etc/e-smith/web/functions/remoteaccess 2008-08-20 23:17:24.000000000 +0200
17 +++ e-smith-base-5.6.0/root/etc/e-smith/web/functions/remoteaccess 2014-04-06 09:38:59.938125057 +0200
18 @@ -113,7 +113,7 @@
19
20 <subroutine src="show_ipsecrw_section()"/>
21
22 - <field type="text" id="pptpSessions" size="3" validation="zero_or_positive()"
23 + <field type="text" id="pptpSessions" size="3" validation="zero_or_positive(), pptp_and_dhcp_range ()"
24 value="get_pptp_sessions()">
25 <label>LABEL_PPTP</label>
26 <description>DESC_PPTP</description>
27 diff -Nur e-smith-base-5.6.0-old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/remoteaccess.pm e-smith-base-5.6.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/remoteaccess.pm
28 --- e-smith-base-5.6.0-old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/remoteaccess.pm 2008-08-20 23:17:24.000000000 +0200
29 +++ e-smith-base-5.6.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/remoteaccess.pm 2014-04-06 09:46:59.510074838 +0200
30 @@ -31,6 +31,7 @@
31 use File::Basename;
32 use Exporter;
33 use Carp;
34 +use Socket qw( inet_aton );
35
36 our @ISA = qw(esmith::FormMagick Exporter);
37
38 @@ -40,7 +41,7 @@
39 show_valid_from_list add_new_valid_from remove_valid_from
40 validate_network_and_mask ip_number_or_blank subnet_mask_or_blank
41 show_telnet_section get_serial_console show_ftp_section
42 - get_ipsecrw_sessions show_ipsecrw_section
43 + get_ipsecrw_sessions show_ipsecrw_section pptp_and_dhcp_range
44 );
45
46
47 @@ -370,6 +371,36 @@
48
49 =pod
50
51 +=head2 pptp_and_dhcp_range
52 +
53 +Validate the input of pptp session if it is not superior than the maximum number of ip between dhcpd_start and dhcpd_end
54 +
55 +=cut
56 +
57 +sub pptp_and_dhcp_range
58 +{
59 + my $self = shift;
60 + my $val = shift || 0;
61 + my $dhcp_status = $db->get_prop('dhcpd','status') || 'disabled';
62 + my $dhcp_end = $db->get_prop('dhcpd','end') || '';
63 + my $dhcp_start = $db->get_prop('dhcpd','start') || '';
64 +
65 + if ( $dhcp_status eq 'enabled' )
66 + {
67 + my $ip_start = unpack 'N', inet_aton($dhcp_start);
68 + my $ip_end = unpack 'N', inet_aton($dhcp_end);
69 + my $ip_count = $ip_end - $ip_start;
70 + return 'OK' if( $val < $ip_count );
71 + return $self->localise('NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE');
72 + }
73 + else
74 + {
75 + return 'OK';
76 + }
77 +}
78 +
79 +=pod
80 +
81 =head2 _get_valid_from
82
83 Reads the ValidFrom property of config entry httpd-admin and returns a list

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