5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-09 05:17:35 +03:00

remove 'name' to the list of utf8 encoded parameters.

Revert previous change. Add dns-name format instead.
This commit is contained in:
Dietmar Maurer 2012-03-13 06:56:31 +01:00
parent 490aade412
commit 34ebb22690
3 changed files with 15 additions and 2 deletions

View File

@ -174,6 +174,19 @@ sub pve_verify_email {
return $email;
}
register_format('dns-name', \&pve_verify_dns_name);
sub pve_verify_dns_name {
my ($name, $noerr) = @_;
my $namere = "([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])";
if ($name !~ /^(${namere}\.)*${namere}$/) {
return undef if $noerr;
die "value does not look like a valid DNS name\n";
}
return $name;
}
# network interface name
register_format('pve-iface', \&pve_verify_iface);
sub pve_verify_iface {

View File

@ -733,7 +733,7 @@ sub decode_text {
sub decode_utf8_parameters {
my ($param) = @_;
foreach my $p (qw(name comment description firstname lastname)) {
foreach my $p (qw(comment description firstname lastname)) {
$param->{$p} = decode('utf8', $param->{$p}) if $param->{$p};
}

2
debian/changelog vendored
View File

@ -1,6 +1,6 @@
libpve-common-perl (1.0-19) unstable; urgency=low
* add 'name' to the list of utf8 encoded parameters
* add dns-name format
-- Proxmox Support Team <support@proxmox.com> Mon, 12 Mar 2012 12:31:27 +0100