api-types: ldap: properly anchor DN regex

Otherwise, a substring match is enough to fulfill the constraint.

Fixes: c001aca0 ("api-types: ldap: add verification regex for LDAP DNs")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-03-29 11:22:41 +02:00 committed by Thomas Lamprecht
parent 3da94f2e74
commit 072b0e9cf9

View File

@ -150,11 +150,11 @@ macro_rules! DOMAIN_PART_REGEX {
const_regex! {
pub LDAP_DOMAIN_REGEX = concat!(
r#"\w+="#,
r#"^\w+="#,
DOMAIN_PART_REGEX!(),
r#"(,\s*\w+="#,
DOMAIN_PART_REGEX!(),
")*"
")*$"
);
}