From: Graham B. <gb...@po...> - 2001-05-12 07:27:02
|
----- Forwarded message from Scott Bruce <sc...@te...> ----- Date: Fri, 11 May 2001 22:14:27 -0700 To: gb...@po... From: Scott Bruce <sc...@te...> Subject: Net::LDAP patch X-Mailer: Microsoft Outlook Express 6.00.2465.0000 Hi Graham, attached is the diff output from a quick patch I had to hack into Net::LDAP to get the schema stuff working with openldap 2.0.7 :-). by default openldap only returns attribute data for 'objectclass' and 'cn' if you request the subschema object, weird, so appending the other attribute names is neccessary if you want to do anything with the subschema object (like use it with Net::LDAP::Schema..). I found a small problem with Net::LDAP::Schema too; if an objectclass is missing MUST or MAY tokens (?) in the schema then Net::LDAP::Schema will barf when trying to construct a list of attributes for that objectclass.... thanks for the great module. -Scott *** Net/LDAP.pm Fri May 11 20:57:31 2001 --- /usr/local/lib/perl5/site_perl/5.6.0/Net/LDAP.pm Thu Sep 14 11:53:39 2000 *************** *** 664,681 **** } $mesg = $self->search( base => $base, scope => 'base', - ## 2001-05-11 ; openldap 2.0.x only returns cn && objectclass by default, - ## so explicitly request other attributes plus the defaults - attrs => [ - 'dITStructureRules', 'nameForms', 'ditContentRules', - 'attributeTypes', 'objectClasses', 'matchingRules', - 'matchingRuleUse', '*' - ], - ## filter => '(objectClass=*)', ); $mesg->code ? undef --- 664,673 ---- *** Net/LDAP/Schema.pm Fri May 11 20:31:05 2001 --- /usr/local/lib/perl5/site_perl/5.6.0/Net/LDAP/Schema.pm Wed Sep 13 08:08:05 2000 *************** *** 28,38 **** unless ($arg) { $schema->{error} = "Bad argument"; return undef; } ! %$schema = (); my $entry; if( ref $arg ) { if (UNIVERSAL::isa($arg, 'Net::LDAP::Entry')) { --- 28,38 ---- unless ($arg) { $schema->{error} = "Bad argument"; return undef; } ! %$schema = (); my $entry; if( ref $arg ) { if (UNIVERSAL::isa($arg, 'Net::LDAP::Entry')) { *************** *** 202,214 **** my %res; # Use hash to get uniqueness foreach my $oc ( @oc ) { my $oid = $self->is_objectclass( $oc ); if( $oid ) { ! ## 2001-05-11 patch to avoid errors if MUST or MAY are undefined :-) ! my $res = $self->{oid}->{$oid}->{$must_or_may} || []; ! ## my $res = $self->{oid}->{$oid}->{$must_or_may}; @res{ @$res } = (); # Add in, getting uniqueness } } return wantarray ? (keys %res) : [ keys %res ]; --- 202,212 ---- my %res; # Use hash to get uniqueness foreach my $oc ( @oc ) { my $oid = $self->is_objectclass( $oc ); if( $oid ) { ! my $res = $self->{oid}->{$oid}->{$must_or_may}; @res{ @$res } = (); # Add in, getting uniqueness } } return wantarray ? (keys %res) : [ keys %res ]; ----- End forwarded message ----- |