Skip Menu |

This queue is for tickets about the DBD-LDAP CPAN distribution.

Report information
The Basics
Id: 12269
Status: resolved
Priority: 0/
Queue: DBD-LDAP

People
Owner: turnerjw784 [...] yahoo.com
Requestors: jmorano [...] moretrix.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.06
Fixed in: (no value)



Subject: Make DBD::LDAP work with Class::DBI and a Netscape LDAP server (JLdap.pm patch)
This patch contains: - some dereferencing of some references (mostly in "wantarray"-constructs - more code consistency ( if @{$var} is used once in the code, use it everywhere .. and not @$var or ($var) ) - more case insenstive matching and substitutes. This patch was tested on a OpenLDAP server but was mostly created to make DBD::LDAP work correctly with Class::DBI and with a Netscape LDAP server. If you want the patch differently or more information, feedback.. don't hestitate to mail me.
--- my_version/JLdap.pm 2005-04-13 13:58:15.241964392 +0200 +++ installed_version/JLdap.pm 2005-04-13 13:55:52.120722128 +0200 @@ -111,7 +111,7 @@ } else { #SQL RETURNED OK. - return wantarray ? @$status : $status; + return wantarray ? ($status) : $status; } } } @@ -163,8 +163,8 @@ $descorder = ($ordercols[$#ordercols] =~ s/(\w+\W+)desc(?:end|ending)?$/$1/i); #MODIFIED 20000721 TO ALLOW "desc|descend|descending"! for $i (0..$#ordercols) { - $ordercols[$i] =~ s/\s//ig; - $ordercols[$i] =~ s/[\(\)]+//ig; + $ordercols[$i] =~ s/\s//g; + $ordercols[$i] =~ s/[\(\)]+//g; } } $tablehash = $dbh->FETCH('ldap_tables'); @@ -216,8 +216,7 @@ while (my $entry = $data->shift_entry()) { $dn = $entry->dn(); - - next unless ($dn =~ /$base$/i); + next unless ($dn =~ /$base$/); @attributes = $entry->attributes; unless ($attbcnt) { @@ -245,7 +244,7 @@ } else { - $varlist[$j][$fieldnamehash{$attr}] = join($self->{ldap_outseparator}, @{$valuesref}) || ''; + $varlist[$j][$fieldnamehash{$attr}] = join($self->{ldap_outseparator}, @$valuesref) || ''; } unless ($valuesref[0]) { @@ -459,6 +458,7 @@ $s =~ s/^\s+//; return unless ($s); + my $relop = '(?:<|=|>|<=|>=|!=|like|not\s+like|is\s+not|is)'; my %boolopsym = ('and' => '&', 'or' => '|'); @@ -469,7 +469,7 @@ my @QS = (); $s=~s|\\\'|\x04|g; #PROTECT "\'" IN QUOTES. - $s=~s|\\\"|\x02|g; #PROTECT "\"" IN QUOTES. + $s=~s|\\\"|\x02|g; #PROTECT "\"" IN QUOTES. #THIS NEXT LOOP STRIPS OUT AND SAVES ALL QUOTED STRING LITERALS #TO PREVENT THEM FROM INTERFEARING WITH OTHER REGICES, IE. DON'T @@ -526,7 +526,7 @@ $QS[$qsindx] = '*' unless (length($QS[$qsindx])); } "\$P\[$indx]"; - /ei); + /e); $tindx = 0; $s = &parseParins($s); @@ -546,7 +546,7 @@ } $s =~ s/AND/and/ig; $s =~ s/OR/or/ig; - 1 while ($s =~ s/(.+?)\s*\band\b\s*(.+)/\(\&\($1\)\($2\)\)/i); + 1 while ($s =~ s/(.+?)\s*\band\b\s*(.+)/\(\&\($1\)\($2\)\)/); @l = (); @l = split(/\s*\bor\b\s*/i, $s); if ($#l > 0)
Patches applied except for: 1) AT 631, $resv[0] should have the number of rows, is this not correct (not changed). 2) The change at JLdap line 116 will not work. It is returned this way at line 108 because in that case $status points to an array so return the array referenced by $status (@$status). In 116, $status is a scalar containing a single integer >= 0, so if an array is requested, we return an array containing a single element (the status value) (not changed). All other changes made. New version 0.07 released to CPAN 7/15/05 Jim Turner