diff -Nur e-smith-hosts-2.4.0.old8723/root/etc/e-smith/db/hosts/migrate/30sanitise_host_comment e-smith-hosts-2.4.0.bz8723/root/etc/e-smith/db/hosts/migrate/30sanitise_host_comment
--- e-smith-hosts-2.4.0.old8723/root/etc/e-smith/db/hosts/migrate/30sanitise_host_comment 1970-01-01 01:00:00.000000000 +0100
+++ e-smith-hosts-2.4.0.bz8723/root/etc/e-smith/db/hosts/migrate/30sanitise_host_comment 2015-01-21 22:49:42.441035251 +0100
@@ -0,0 +1,13 @@
+{
+ #Added for bug 8723 & bug 8806
+ my @hosts = $DB->keys;
+ foreach my $host (@hosts)
+ {
+ my $comment = $DB->get_prop("$host",'Comment')||'';
+ if ($comment ne '')
+ {
+ $comment =~ s/['"]//g;
+ $DB->set_prop("$host",'Comment',"$comment");
+ }
+ }
+}
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
--- 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
+++ 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
@@ -128,7 +128,7 @@
HOSTNAME_DESCRIPTION
- The hostname must contain only letters, numbers, and hyphens,
+ The hostname and the comment must contain only letters, numbers, and hyphens,
and must start with a letter or number.
@@ -271,4 +271,18 @@
MUST_BE_VALID_HOSTNAME_OR_IP
Must be a valid hostname or IP number
+
+ HOSTNAME_COMMENT_ERROR
+
+ Error: unexpected characters in the comment of "{$hostname}.{$domain}".
+ The comment must contain only letters, numbers and hyphens, and must start with a letter or number.
+
+
+
+ HOSTNAME_VALIDATOR_ERROR
+
+ Error: unexpected characters in host name: "{$hostname}.{$domain}". The host name should contain only
+ letters, numbers, and hyphens and must start with a letter or a number.
+
+
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
--- 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
+++ 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
@@ -420,11 +420,17 @@
my $hostname = lc $q->param('name');
my $domain = lc $q->param('domain');
my $fqdn = "$hostname.$domain";
+ my $comment = lc $q->param('comment');
$self->cgi->param(-name=>'name', -value=>$hostname);
unless ( $hostname =~ /^[a-z0-9][a-z0-9-]*$/ )
{
- return $self->error('HOSTNAME_DESCRIPTION');
+ return $self->error('HOSTNAME_VALIDATOR_ERROR');
+ }
+
+ unless ( $comment =~ /^[a-z0-9][a-z0-9-]*$/ )
+ {
+ return $self->error('HOSTNAME_COMMENT_ERROR');
}
# Look for duplicate hosts.
my $hostrec = undef;