Closed Bug 378218 Opened 19 years ago Closed 19 years ago

Need to re-implement bug fix in FIRSTKEY subroutine of Entry.pm for relicensing

Categories

(Directory Graveyard :: PerLDAP, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nkinder, Assigned: leif)

Details

Attachments

(6 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070313 Fedora/1.5.0.10-5.fc6 Firefox/1.5.0.10 Build Identifier: We are trying to relicense PerLDAP (as detailed in bug 368747), but there are a few individual contributors that we are unable to track down for re-licensing permission. In order to relicense PerLDAP, we will need to have someone re-implement the bug fixes contributed by these people we are unable to contact. This bug will be used to track this re-implementation effort for a bug fix in the FIRSTKEY subroutine implemented in mozilla/directory/perldap/Entry.pm Reproducible: Always
Adding Noriko to the cc list. Noriko will be re-implementing the bug fix detailed in this bug report.
This is a copy of the Entry.pm source file with all encumbered bug-fixes removed from it.
This comment will describe the bug that needs to have a fix re-implemented. The previous fix for this issue was contributed by Wolfram Schmidt (wschmidt@decefix.iao.fhg.de), who we have been unable to contact. I was unable to find an original bug for this issue. The bug is a problem in the way that the FIRSTKEY subroutine behaves for an entry that has had all of it's attributes deleted (aside from the DN which is treated differently). In this case, the FIRSTKEY subroutine should return nothing, as there are no keys (the key would be a present attribute name). Without the fix, the name of an attribute that was deleted is returned.
This test program will demonstrate the bug that needs to be fixed.
Attached file Test program output
This file shows both the broken and fixed output from the previously attached test program. The good output in this file should match the output that the new fix results in.
Updated FIRSTKEY: ############################################################################# # Reset the each()/key() session, and return the first key. This honors # the oc_order, i.e. the order the attributes were returned in. # sub FIRSTKEY { my ($self, $idx) = ($_[$[], 0); my (@attrs, $key); return unless defined($self->{"_oc_order_"}); @attrs = @{$self->{"_oc_order_"}}; while ($idx < $self->{"_oc_numattr_"}) { $key = $attrs[$idx++]; next if ($key =~ /^_.+_$/); next if defined($self->{"_${key}_deleted_"}); $self->{"_oc_keyidx_"} = $idx; return $key; } $self->{"_oc_keyidx_"} = $idx; return; } Change description: if the valid key is found in the loop, you can just set the index to _oc_keyidx_ and return the key. Otherwise, just set the last index and return NULL.
test378218-0.pl: entry with 2 attributes; remove the first attribute; the second attribute is found and returned. test378218-1.pl: entry with 2 attributes; remove the second attribute; the first attribute is returned. test378218-2.pl: entry with 2 attributes; remove both attributes; nothing is returned. test378218-3.pl: entry with 4 attributes; remove 1st and 3rd attributes; 2nd attribute is returned as a first key and 4th is as second key. test378218-4.pl: entry with 4 attributes; remove all attributes; nothing is returned.
Looks good.
Checked Noriko's new fix into the devel-branch-1_4_2 branch. Thanks for the review Rich. Checking in Entry.pm; /cvsroot/mozilla/directory/perldap/Entry.pm,v <-- Entry.pm new revision: 1.13.2.8; previous revision: 1.13.2.7 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attached patch Diffs from HEADSplinter Review
I want to apply these changes to the trunk as well. This will allow us to relicense the source on the trunk and devel-branch-1_4_2. This attachment is the diffs for porting this fix to the trunk.
Checked in diffs from attachment to the trunk. Thanks to Noriko for doing the re-implementation work. Checking in Entry.pm; /cvsroot/mozilla/directory/perldap/Entry.pm,v <-- Entry.pm new revision: 1.14; previous revision: 1.13 done
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: