diff --git a/Proxmox/Sys/Net.pm b/Proxmox/Sys/Net.pm index 2d29116..c2f3e9c 100644 --- a/Proxmox/Sys/Net.pm +++ b/Proxmox/Sys/Net.pm @@ -7,7 +7,7 @@ use base qw(Exporter); our @EXPORT_OK = qw(parse_ip_address parse_ip_mask parse_fqdn); our $HOSTNAME_RE = "(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,61}?[a-zA-Z0-9])?)"; -our $FQDN_RE = "(?:${HOSTNAME_RE}\.)*${HOSTNAME_RE}"; +our $FQDN_RE = "(?:${HOSTNAME_RE}\\.)*${HOSTNAME_RE}"; my $IPV4OCTET = "(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])"; my $IPV4RE = "(?:(?:$IPV4OCTET\\.){3}$IPV4OCTET)"; diff --git a/proxmox-installer-common/src/utils.rs b/proxmox-installer-common/src/utils.rs index 0ed7438..ddfd7a1 100644 --- a/proxmox-installer-common/src/utils.rs +++ b/proxmox-installer-common/src/utils.rs @@ -309,6 +309,12 @@ mod tests { Fqdn::from(&format!("{}.com", "a".repeat(64))), Err(InvalidPart("a".repeat(64))), ); + + // https://bugzilla.proxmox.com/show_bug.cgi?id=5230 + assert_eq!( + Fqdn::from("123@foo.com"), + Err(InvalidPart("123@foo".to_owned())) + ); } #[test] diff --git a/test/parse-fqdn.pl b/test/parse-fqdn.pl index 3009984..6638fbe 100755 --- a/test/parse-fqdn.pl +++ b/test/parse-fqdn.pl @@ -51,4 +51,7 @@ is_parsed('a' x 63 . '.com', ['a' x 63, 'com']); is_invalid('a' x 250 . '.com', ERR_TOOLONG); is_invalid('a' x 64 . '.com', ERR_ALPHANUM); +# https://bugzilla.proxmox.com/show_bug.cgi?id=5230 +is_invalid('123@foo.com', ERR_ALPHANUM); + done_testing();