/[smeserver]/rpms/e-smith-hosts/sme8/e-smith-hosts-2.2.0.comment_hostname_validator.patch
ViewVC logotype

Contents of /rpms/e-smith-hosts/sme8/e-smith-hosts-2.2.0.comment_hostname_validator.patch

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


Revision 1.1 - (show annotations) (download)
Sun Jan 18 13:06:53 2015 UTC (9 years, 4 months ago) by stephdl
Branch: MAIN
CVS Tags: e-smith-hosts-2_2_0-9_el5_sme
* Sun Jan 18 2014 stephane de Labrusse <stephdl@de-labrusse.fr> 2.2.0-9.sme
- Add a validator for the comment and the hostname field [SME: 8806]

1 diff -Nur e-smith-hosts-2.4.0.old8723/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/hostentries e-smith-hosts-2.4.0.bz8723/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/hostentries
2 --- e-smith-hosts-2.4.0.old8723/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/hostentries 2015-01-18 11:25:40.356221775 +0100
3 +++ e-smith-hosts-2.4.0.bz8723/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/hostentries 2015-01-18 12:57:12.694843190 +0100
4 @@ -128,7 +128,7 @@
5 <entry>
6 <base>HOSTNAME_DESCRIPTION</base>
7 <trans>
8 - The hostname must contain only letters, numbers, and hyphens,
9 + The hostname and the comment must contain only letters, numbers, and hyphens,
10 and must start with a letter or number.
11 </trans>
12 </entry>
13 @@ -271,4 +271,18 @@
14 <base>MUST_BE_VALID_HOSTNAME_OR_IP</base>
15 <trans>Must be a valid hostname or IP number</trans>
16 </entry>
17 + <entry>
18 + <base>HOSTNAME_COMMENT_ERROR</base>
19 + <trans>
20 + Error: unexpected characters in the comment of "{$hostname}.{$domain}".
21 + The comment must contain only letters, numbers and hyphens, and must start with a letter or number.
22 + </trans>
23 + </entry>
24 + <entry>
25 + <base>HOSTNAME_VALIDATOR_ERROR</base>
26 + <trans>
27 + Error: unexpected characters in host name: "{$hostname}.{$domain}". The host name should contain only
28 + letters, numbers, and hyphens and must start with a letter or a number.
29 + </trans>
30 + </entry>
31 </lexicon>
32 diff -Nur e-smith-hosts-2.4.0.old8723/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/hostentries.pm e-smith-hosts-2.4.0.bz8723/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/hostentries.pm
33 --- e-smith-hosts-2.4.0.old8723/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/hostentries.pm 2015-01-18 11:25:40.356221775 +0100
34 +++ e-smith-hosts-2.4.0.bz8723/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/hostentries.pm 2015-01-18 12:56:12.236214717 +0100
35 @@ -420,11 +420,17 @@
36 my $hostname = lc $q->param('name');
37 my $domain = lc $q->param('domain');
38 my $fqdn = "$hostname.$domain";
39 + my $comment = lc $q->param('comment');
40 $self->cgi->param(-name=>'name', -value=>$hostname);
41
42 unless ( $hostname =~ /^[a-z0-9][a-z0-9-]*$/ )
43 {
44 - return $self->error('HOSTNAME_DESCRIPTION');
45 + return $self->error('HOSTNAME_VALIDATOR_ERROR');
46 + }
47 +
48 + unless ( $comment =~ /^[a-z0-9][a-z0-9-]*$/ )
49 + {
50 + return $self->error('HOSTNAME_COMMENT_ERROR');
51 }
52 # Look for duplicate hosts.
53 my $hostrec = undef;

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