[pbs-devel] [PATCH proxmox-backup] api-types: ldap: properly anchor DN regex

Lukas Wagner l.wagner at proxmox.com
Wed Mar 29 11:22:41 CEST 2023


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

Reported-by: Friedrich Weber <f.weber at proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 pbs-api-types/src/ldap.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pbs-api-types/src/ldap.rs b/pbs-api-types/src/ldap.rs
index eabc5249..762f560a 100644
--- a/pbs-api-types/src/ldap.rs
+++ b/pbs-api-types/src/ldap.rs
@@ -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!(),
-        ")*"
+        ")*$"
     );
 }
 
-- 
2.30.2






More information about the pbs-devel mailing list