public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] fix #5034 ldap attribute regex
@ 2023-11-15 12:23 Markus Frank
  2023-11-15 13:28 ` Stefan Sterz
  2023-11-15 13:30 ` Thomas Lamprecht
  0 siblings, 2 replies; 8+ messages in thread
From: Markus Frank @ 2023-11-15 12:23 UTC (permalink / raw)
  To: pve-devel

Change regex from "m/^[a-zA-Z0-9]+$/" to "m/^[a-zA-Z0-9\-]+$/"
to allow hyphen in ldap attribute names for pve & pmg.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
There does not seem to be a regex for LDAP attributes in pbs.
Should a regex be added for this?

 src/PVE/JSONSchema.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index 49e0d7a..ef58b62 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -408,7 +408,7 @@ PVE::JSONSchema::register_format('ldap-simple-attr', \&verify_ldap_simple_attr);
 sub verify_ldap_simple_attr {
     my ($attr, $noerr) = @_;
 
-    if ($attr =~ m/^[a-zA-Z0-9]+$/) {
+    if ($attr =~ m/^[a-zA-Z0-9\-]+$/) {
 	return $attr;
     }
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-21 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 12:23 [pve-devel] [PATCH common] fix #5034 ldap attribute regex Markus Frank
2023-11-15 13:28 ` Stefan Sterz
2023-11-15 14:49   ` Thomas Lamprecht
2023-11-15 15:12     ` Stefan Sterz
2023-11-15 15:48       ` Thomas Lamprecht
2023-11-15 15:02   ` Stefan Sterz
2023-11-15 13:30 ` Thomas Lamprecht
2023-11-21 12:55   ` Christoph Heiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal