Fix parse_dn: trim key and value

This commit is contained in:
thooge
2020-11-03 11:02:10 +01:00
committed by GitHub
parent 29f3b8fe51
commit 480ab5a07b

View File

@@ -112,6 +112,9 @@ sub parse_dn {
s/\s+$//; s/\s+$//;
($k, $v) = split(/=/); ($k, $v) = split(/=/);
next if(not defined($k)); next if(not defined($k));
# trim key and value
$k = s/^\s+|\s+$//g;
$v = s/^\s+|\s+$//g;
if($k =~ /ou/i) { if($k =~ /ou/i) {
$tmp->{'OU'} or $tmp->{'OU'} = []; $tmp->{'OU'} or $tmp->{'OU'} = [];
push(@{$tmp->{'OU'}}, $v); push(@{$tmp->{'OU'}}, $v);