projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
772038d
)
add ldap-simple-attr from pmg
author
Dominik Csapak
<d.csapak@proxmox.com>
Fri, 6 Mar 2020 10:05:36 +0000
(11:05 +0100)
committer
Thomas Lamprecht
<t.lamprecht@proxmox.com>
Mon, 9 Mar 2020 11:34:06 +0000
(12:34 +0100)
we also need it in pve
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/JSONSchema.pm
patch
|
blob
|
blame
|
history
diff --git
a/src/PVE/JSONSchema.pm
b/src/PVE/JSONSchema.pm
index 599dd099b0441a4bb8fd0d41406f55b928afb0d1..fa405ac831a29bf4a03e0d958a46507cc9d7ef95 100644
(file)
--- a/
src/PVE/JSONSchema.pm
+++ b/
src/PVE/JSONSchema.pm
@@
-265,6
+265,19
@@
sub pve_verify_ip {
return $ip;
}
+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]+$/) {
+ return $attr;
+ }
+
+ die "value '$attr' does not look like a simple ldap attribute name\n" if !$noerr;
+
+ return undef;
+}
+
my $ipv4_mask_hash = {
'0.0.0.0' => 0,
'128.0.0.0' => 1,