X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FAuth%2FPlugin.pm;h=6d59b720d5580d58805091041ad2ef53f89deadb;hb=8e23f9715654a6e62eaeae5f3475a9bdc9addf76;hp=5c11991b8735d3dd7cd084b460eebda5dd76ced9;hpb=9401be39cb6e9ba37b0939d65180cb4e3ae4f964;p=pve-access-control.git diff --git a/PVE/Auth/Plugin.pm b/PVE/Auth/Plugin.pm index 5c11991..6d59b72 100755 --- a/PVE/Auth/Plugin.pm +++ b/PVE/Auth/Plugin.pm @@ -27,7 +27,8 @@ sub lock_domain_config { } } -my $realm_regex = qr/[A-Za-z][A-Za-z0-9\.\-_]+/; +our $realm_regex = qr/[A-Za-z][A-Za-z0-9\.\-_]+/; +our $user_regex = qr![^\s:/]+!; PVE::JSONSchema::register_format('pve-realm', \&pve_verify_realm); sub pve_verify_realm { @@ -66,7 +67,7 @@ sub verify_username { # colon separated lists)! # slash is not allowed because it is used as pve API delimiter # also see "man useradd" - if ($username =~ m!^([^\s:/]+)\@(${realm_regex})$!) { + if ($username =~ m!^(${user_regex})\@(${realm_regex})$!) { return wantarray ? ($username, $1, $2) : $username; }