mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Handle ACL DNs with spaces
This commit is contained in:
@@ -26,7 +26,7 @@ else {
|
||||
$p->{'what'} = '*';
|
||||
}
|
||||
else {
|
||||
$in{'what_dn'} =~ /^\S+=\S+$/ || &error($text{'eacl_edn'});
|
||||
$in{'what_dn'} =~ /^\S+=\S.*$/ || &error($text{'eacl_edn'});
|
||||
$p->{'what'} =
|
||||
'dn'.($in{'what_style'} ? '.'.$in{'what_style'} : '').
|
||||
'='.$in{'what_dn'};
|
||||
@@ -53,7 +53,7 @@ else {
|
||||
# Who are we granting
|
||||
if ($in{"wmode_$i"} eq "other") {
|
||||
# Other DN
|
||||
$in{"who_$i"} =~ /^\S+=\S+$/ ||
|
||||
$in{"who_$i"} =~ /^\S+=\S.*$/ ||
|
||||
&error(&text('eacl_ewho', $i+1));
|
||||
$by->{'who'} = $in{"who_$i"};
|
||||
}
|
||||
|
||||
@@ -486,7 +486,12 @@ sub store_ldap_access
|
||||
{
|
||||
local ($a, $p) = @_;
|
||||
local @v = ( 'to' );
|
||||
push(@v, $p->{'what'});
|
||||
if ($p->{'what'} =~ /^\S+$/) {
|
||||
push(@v, $p->{'what'});
|
||||
}
|
||||
else {
|
||||
push(@v, "\"$p->{'what'}\"");
|
||||
}
|
||||
if ($p->{'filter'}) {
|
||||
push(@v, "filter=$p->{'filter'}");
|
||||
}
|
||||
@@ -495,7 +500,12 @@ if ($p->{'attrs'}) {
|
||||
}
|
||||
foreach my $b (@{$p->{'by'}}) {
|
||||
push(@v, "by");
|
||||
push(@v, $b->{'who'});
|
||||
if ($b->{'who'} =~ /^\S+$/) {
|
||||
push(@v, $b->{'who'});
|
||||
}
|
||||
else {
|
||||
push(@v, "\"$b->{'who'}\"");
|
||||
}
|
||||
push(@v, $b->{'access'});
|
||||
push(@v, @{$b->{'control'}});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user