mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
MAC addresses must have a :, - or . in them
This commit is contained in:
@@ -12,11 +12,13 @@ $conf = &get_config();
|
||||
@hosts = &find_recursive("host", $conf);
|
||||
|
||||
# Check to see if the host contains 6 hex bytes for a Mac address
|
||||
(my $justbytes = $in{'host'}) =~ s/[^A-Fa-f0-9]//g;
|
||||
if ($justbytes =~ /^[0-9a-f]{12}$/i) {
|
||||
# Treat this host as a mac address with arbitrary formatting
|
||||
$in{'host'} = join(':', unpack("(A2)*", $justbytes) );
|
||||
}
|
||||
if ($in{'host'} =~ /:|\-|\./) {
|
||||
(my $justbytes = $in{'host'}) =~ s/[^A-Fa-f0-9]//g;
|
||||
if ($justbytes =~ /^[0-9a-f]{12}$/i) {
|
||||
# Treat this host as a mac address with arbitrary formatting
|
||||
$in{'host'} = join(':', unpack("(A2)*", $justbytes) );
|
||||
}
|
||||
}
|
||||
|
||||
# Look for a match
|
||||
%access = &get_module_acl();
|
||||
|
||||
Reference in New Issue
Block a user