You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(4) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(23) |
Feb
(18) |
Mar
(11) |
Apr
(3) |
May
(23) |
Jun
(13) |
Jul
(16) |
Aug
(11) |
Sep
(5) |
Oct
(4) |
Nov
(2) |
Dec
(4) |
2003 |
Jan
(18) |
Feb
(13) |
Mar
(56) |
Apr
(3) |
May
(124) |
Jun
(21) |
Jul
(2) |
Aug
(8) |
Sep
(1) |
Oct
(23) |
Nov
(4) |
Dec
(2) |
2004 |
Jan
(18) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Graham B. <gb...@us...> - 2003-10-08 12:28:15
|
Update of /cvsroot/perl-ldap/asn/lib/Convert In directory sc8-pr-cvs1:/tmp/cvs-serv15157/Convert Modified Files: ASN1.pm Log Message: Fix bug in encoding BIT STRINGS where chr() was causing an upgrade to UTF8 Index: ASN1.pm =================================================================== RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ASN1.pm 12 May 2003 17:45:57 -0000 1.27 +++ ASN1.pm 8 Oct 2003 12:28:09 -0000 1.28 @@ -21,7 +21,7 @@ } @ISA = qw(Exporter); - $VERSION = '0.17'; + $VERSION = '0.18'; %EXPORT_TAGS = ( io => [qw(asn_recv asn_send asn_read asn_write asn_get asn_ready)], |
From: Graham B. <gb...@us...> - 2003-10-08 12:28:15
|
Update of /cvsroot/perl-ldap/asn/lib/Convert/ASN1 In directory sc8-pr-cvs1:/tmp/cvs-serv15157/Convert/ASN1 Modified Files: _encode.pm Log Message: Fix bug in encoding BIT STRINGS where chr() was causing an upgrade to UTF8 Index: _encode.pm =================================================================== RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/_encode.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- _encode.pm 6 May 2003 21:29:07 -0000 1.18 +++ _encode.pm 8 Oct 2003 12:28:09 -0000 1.19 @@ -106,21 +106,27 @@ sub _enc_bitstring { # 0 1 2 3 4 5 6 # $optn, $op, $stash, $var, $buf, $loop, $path + my $vref = ref($_[3]) ? \($_[3]->[0]) : \$_[3]; + + if (CHECK_UTF8 and Encode::is_utf8($$vref)) { + utf8::encode(my $tmp = $$vref); + $vref = \$tmp; + } if (ref($_[3])) { my $less = (8 - ($_[3]->[1] & 7)) & 7; my $len = ($_[3]->[1] + 7)/8; $_[4] .= asn_encode_length(1+$len); $_[4] .= chr($less); - $_[4] .= substr($_[3]->[0], 0, $len); + $_[4] .= substr($$vref, 0, $len); if ($less && $len) { - substr($_[4],-1) &= chr(0xff << $less); + substr($_[4],-1) &= chr((0xff << $less) & 0xff); } } else { - $_[4] .= asn_encode_length(1+length $_[3]); + $_[4] .= asn_encode_length(1+length $$vref); $_[4] .= chr(0); - $_[4] .= $_[3]; + $_[4] .= $$vref; } } |
From: Chris R. <chr...@us...> - 2003-09-11 10:44:57
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv26186 Modified Files: Filter.pod Log Message: Remove leftover documentation for asn() Index: Filter.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Filter.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Filter.pod 7 May 2003 12:01:41 -0000 1.5 +++ Filter.pod 11 Sep 2003 10:44:54 -0000 1.6 @@ -32,11 +32,6 @@ Parse FILTER. The next call to ber will return this filter encoded. -=item asn - -Return the data structure suitable for passing directly to L<Convert::ASN1> -to encode a filter object. - =item as_string Return the filter in text form. |
From: Chris R. <chr...@us...> - 2003-08-16 08:55:41
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv28185/lib/Net/LDAP Modified Files: Schema.pod Log Message: Rearranged description of HASHes Index: Schema.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Schema.pod,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Schema.pod 5 Aug 2003 13:33:04 -0000 1.13 +++ Schema.pod 16 Aug 2003 08:44:26 -0000 1.14 @@ -32,27 +32,11 @@ or raw oid (object identifier, in dotted numeric string form, e.g. 2.5.4.0) may be supplied. -=over 4 - -=item all_attributes ( ) - -=item all_ditcontentrules ( ) - -=item all_ditstructurerules ( ) - -=item all_matchingrules ( ) - -=item all_matchingruleuses ( ) - -=item all_nameforms ( ) - -=item all_objectclasses ( ) - -=item all_syntaxes ( ) - -Returns a list of all the requested types in the schema. Each item in -the list is a reference to a HASH; the various keys in each HASH are -named after the keys defined in RFC 2252: +Each returned item of schema (eg an attribute definition) is returned +in a HASH. The keys in the returned HASH are lowercased versions of +the keys read from the server. Here's a partial list (not all HASHes +define all keys) although note that RFC 2252 permits other keys as +well: name desc @@ -77,6 +61,26 @@ oc form +=over 4 + +=item all_attributes ( ) + +=item all_ditcontentrules ( ) + +=item all_ditstructurerules ( ) + +=item all_matchingrules ( ) + +=item all_matchingruleuses ( ) + +=item all_nameforms ( ) + +=item all_objectclasses ( ) + +=item all_syntaxes ( ) + +Returns a list of all the requested types in the schema. + =item attribute ( NAME ) =item ditcontentrule ( NAME ) @@ -113,19 +117,22 @@ =item error ( ) -Returns the last error encountered. +Returns the last error encountered when parsing the schema. =item may ( OBJECTCLASS ) Given an argument which is the name or oid of a known object class, -returns the names of the attributes which are optional in the class. +returns a list of HASHes describing the attributes which are optional +in the class. @may = $schema->may ( $oc ); + # First optional attr has the name '$may[0]->{name}' =item must ( OBJECTCLASS ) Given an argument which is the name or oid of a known object class, -returns the names of the attributes which are mandatory in the class +returns a list of HASHes describing the attributes which are mandatory +in the class. @must = $schema->must ( $oc ); |
From: Chris R. <chr...@us...> - 2003-08-05 14:09:55
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv17340 Modified Files: Examples.pod Log Message: Updated documentation style, corrected schema code etc Index: Examples.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Examples.pod,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Examples.pod 18 Jun 2003 18:23:31 -0000 1.7 +++ Examples.pod 5 Aug 2003 14:09:52 -0000 1.8 @@ -52,390 +52,359 @@ =head2 PACKAGE - Definitions - use Net::LDAP; - - use Net::LDAP::Util qw(ldap_error_name - ldap_error_text) ; # use for Error handling - + use Net::LDAP; =head2 INITIALIZING - $ldap = Net::LDAP->new("yourLDAPhost.yourCompany.com") or die "$@"; + $ldap = Net::LDAP->new ( "yourLDAPhost.yourCompany.com" ) or die "$@"; =head2 BINDING - $mesg = $ldap->bind( version => 3 ); # use for searches + $mesg = $ldap->bind ( version => 3 ); # use for searches - $mesg = $ldap->bind("$userToAuthenticate", - password => "$passwd", - version => 3 ); # use for changes/edits + $mesg = $ldap->bind ( "$userToAuthenticate", + password => "$passwd", + version => 3 ); # use for changes/edits - # see your LDAP administrator for information concerning the - # user authentication setup at your site. + # see your LDAP administrator for information concerning the + # user authentication setup at your site. =head2 OPERATION - Generating a SEARCH - sub LDAPsearch - { - my ($ldap,$searchString,$attrs,$base) = @_ ; + sub LDAPsearch + { + my ($ldap,$searchString,$attrs,$base) = @_; - # if they don't pass a base... set it for them + # if they don't pass a base... set it for them - if (!$base ) { $base = "o=mycompany, c=mycountry"; } + if (!$base ) { $base = "o=mycompany, c=mycountry"; } - # if they don't pass an array of attributes... - # set up something for them + # if they don't pass an array of attributes... + # set up something for them - if (!$attrs ) { $attrs = ['cn','mail' ]; } + if (!$attrs ) { $attrs = [ 'cn','mail' ]; } - my $result = $ldap->search ( - base => "$base", - scope => "sub", - filter => "$searchString", - attrs => $attrs - ); + my $result = $ldap->search ( base => "$base", + scope => "sub", + filter => "$searchString", + attrs => $attrs + ); - } +} - my @Attrs = (); # request all available attributes + my @Attrs = ( ); # request all available attributes # to be returned. - my $result = LDAPsearch($ldap,"sn=*",\@Attrs); + my $result = LDAPsearch ( $ldap, "sn=*", \@Attrs ); =head2 PROCESSING - Displaying SEARCH Results - #------------ - # - # Accessing the data as if in a structure - # i.e. Using the "as_struct" method - # - - my $href = $result->as_struct; + #------------ + # + # Accessing the data as if in a structure + # i.e. Using the "as_struct" method + # - # get an array of the DN names + my $href = $result->as_struct; - my @arrayOfDNs = keys %$href ; # use DN hashes + # get an array of the DN names - # process each DN using it as a key + my @arrayOfDNs = keys %$href; # use DN hashes - foreach (@arrayOfDNs) { - print $_,"\n"; - my $valref = $$href{$_}; + # process each DN using it as a key - # get an array of the attribute names - # passed for this one DN. - my @arrayOfAttrs = sort keys %$valref; #use Attr hashes + foreach ( @arrayOfDNs ) { + print $_, "\n"; + my $valref = $$href{$_}; - my $attrName; - foreach $attrName (@arrayOfAttrs) { + # get an array of the attribute names + # passed for this one DN. + my @arrayOfAttrs = sort keys %$valref; #use Attr hashes - # skip any binary data: yuck! - next if ( $attrName =~ /;binary$/ ); + my $attrName; + foreach $attrName (@arrayOfAttrs) { - # get the attribute value (pointer) using the - # attribute name as the hash - my $attrVal = @$valref{$attrName} ; - print "\t $attrName: @$attrVal \n"; - } - print "#-------------------------------\n"; - # End of that DN - } - # - # end of as_struct method - # - #-------- + # skip any binary data: yuck! + next if ( $attrName =~ /;binary$/ ); + # get the attribute value (pointer) using the + # attribute name as the hash + my $attrVal = @$valref{$attrName}; + print "\t $attrName: @$attrVal \n"; + } + print "#-------------------------------\n"; + # End of that DN + } + # + # end of as_struct method + # + #-------- - #------------ - # - # handle each of the results independently - # ... i.e. using the walk through method - # - my @entries = $result->entries; - my $entr ; - foreach $entr ( @entries ) - { - print "DN: ",$entr->dn,"\n"; - #my @attrs = sort $entr->attributes; + #------------ + # + # handle each of the results independently + # ... i.e. using the walk through method + # + my @entries = $result->entries; - my $attr; - foreach $attr ( sort $entr->attributes ){ - #skip binary we can't handle - next if ( $attr =~ /;binary$/ ); - print " $attr : ",$entr->get_value($attr),"\n"; - } + my $entr; + foreach $entr ( @entries ) { + print "DN: ", $entr->dn, "\n"; + my $attr; + foreach $attr ( sort $entr->attributes ) { + # skip binary we can't handle + next if ( $attr =~ /;binary$/ ); + print " $attr : ", $entr->get_value ( $attr ) ,"\n"; + } - #print "@attrs\n"; - print "#-------------------------------\n"; - } + print "#-------------------------------\n"; + } - # - # end of walk through method - #------------ + # + # end of walk through method + #------------ =head2 OPERATION - Modifying entries - # - # Modify - # - # for each of the modifies below you'll need to supply - # a full DN (Distinguished Name) for the $dn variable. - # example: - # cn=Jo User,ou=person,o=mycompany,c=mycountry - # - # I would recommend doing a search (listed above) - # then use the dn returned to populate the $dn variable. - - - # - # Do we only have one result returned from the search? - - if ( $result->count != 1 ) { exit ; } # Nope.. exit - - my $dn = $entries[0]->dn; # yes.. get the DN - - - ####################################### - # - # MODIFY using a HASH - # - - my %ReplaceHash = ( keyword => "x", proxy => "x" ); - - my $result = LDAPmodifyUsingHash($ldap,$dn, \%ReplaceHash ); - - sub LDAPmodifyUsingHash - { - my ($ldap,$dn,$whatToChange ) = @_ ; - my $result = $ldap->modify($dn, - replace => { %$whatToChange } - ); - return ($result ); - } - - - ####################################### - # - # MODIFY using a ARRAY List - # - - my @ReplaceArrayList = [ 'keyword', "xxxxxxxxxx" , - 'proxy' , "yyyyyyyyyy" ]; + # + # Modify + # + # for each of the modifies below you'll need to supply + # a full DN (Distinguished Name) for the $dn variable. + # example: + # cn=Jo User,ou=person,o=mycompany,c=mycountry + # + # I would recommend doing a search (listed above) + # then use the dn returned to populate the $dn variable. - my $result = LDAPmodifyUsingArrayList($ldap,$dn, \@ReplaceArrayList ); + # + # Do we only have one result returned from the search? - sub LDAPmodifyUsingArrayList - { - my ($ldap,$dn,$whatToChange ) = @_ ; - my $result = $ldap->modify($dn, - changes => [ - replace => @$whatToChange - ] - ); - return ($result ); - } + if ( $result->count != 1 ) { exit; } # Nope.. exit + my $dn = $entries[0]->dn; # yes.. get the DN - ####################################### - # - # MODIFY using a ARRAY - # + ####################################### + # + # MODIFY using a HASH + # - my @ReplaceArray = ( 'keyword', "xxxxxxxxxx" , - 'proxy' , "yyyyyyyyyy" ); + my %ReplaceHash = ( keyword => "x", proxy => "x" ); - my $result = LDAPmodifyUsingArray($ldap,$dn, \@ReplaceArray ); + my $result = LDAPmodifyUsingHash ( $ldap, $dn, \%ReplaceHash ); - sub LDAPmodifyUsingArray - { - my ($ldap,$dn,$whatToChange ) = @_ ; - my $result = $ldap->modify($dn, - changes => [ - replace => [ @$whatToChange ] - ] - ); - return ($result ); - } + sub LDAPmodifyUsingHash + { + my ($ldap, $dn, $whatToChange ) = @_; + my $result = $ldap->modify ( $dn, + replace => { %$whatToChange } + ); + return $result; + } + ####################################### + # + # MODIFY using a ARRAY List + # - ####################################### - # - # MODIFY an existing record using 'Changes' - # (or combination of add/delete/replace) - # + my @ReplaceArrayList = [ 'keyword', "xxxxxxxxxx", + 'proxy' , "yyyyyyyyyy" ]; + my $result = LDAPmodifyUsingArrayList ( $ldap, $dn, \@ReplaceArrayList ); - my @whatToChange ; - my @ReplaceArray ; - my @DeleteArray ; - my @AddArray ; + sub LDAPmodifyUsingArrayList + { + my ($ldap, $dn, $whatToChange ) = @_; + my $result = $ldap->modify ( $dn, + changes => [ + replace => @$whatToChange + ] + ); + return $result; + } - push @AddArray, 'cn',"me myself"; - push @ReplaceArray, 'sn','!@#$%^&*()__+Hello THere'; - push @ReplaceArray, 'cn',"me myself I"; - push @DeleteArray, 'cn',"me myself"; + ####################################### + # + # MODIFY using a ARRAY + # + my @ReplaceArray = ( 'keyword', "xxxxxxxxxx" , + 'proxy' , "yyyyyyyyyy" ); + my $result = LDAPmodifyUsingArray ( $ldap, $dn, \@ReplaceArray ); + sub LDAPmodifyUsingArray + { + my ($ldap, $dn, $whatToChange ) = @_; + my $result = $ldap->modify ( $dn, + changes => [ + replace => [ @$whatToChange ] + ] + ); + return $result; + } - if ( $#ReplaceArray > 0 ) { - push @whatToChange, 'replace' ; - push @whatToChange, \@ReplaceArray ; - } - if ( $#DeleteArray > 0 ) { - push @whatToChange, 'delete' ; - push @whatToChange, \@DeleteArray ; - } - if ( $#AddArray > 0 ) { - push @whatToChange, 'add' ; - push @whatToChange, \@AddArray ; - } + ####################################### + # + # MODIFY an existing record using 'Changes' + # (or combination of add/delete/replace) + # - $result = LDAPmodify($ldap,$dn, \@whatToChange ); + my @whatToChange; + my @ReplaceArray; + my @DeleteArray; + my @AddArray; + push @AddArray, 'cn', "me myself"; + push @ReplaceArray, 'sn', '!@#$%^&*()__+Hello THere'; + push @ReplaceArray, 'cn', "me myself I"; + push @DeleteArray, 'cn', "me myself"; - sub LDAPmodify - { - my ($ldap,$dn,$whatToChange) = @_ ; + if ( $#ReplaceArray > 0 ) { + push @whatToChange, 'replace'; + push @whatToChange, \@ReplaceArray; + } + if ( $#DeleteArray > 0 ) { + push @whatToChange, 'delete'; + push @whatToChange, \@DeleteArray; + } + if ( $#AddArray > 0 ) { + push @whatToChange, 'add'; + push @whatToChange, \@AddArray; + } - my $result = $ldap->modify($dn, - changes => [ - @$whatToChange - ] - ); - return ($result ); - } + $result = LDAPmodify ( $ldap, $dn, \@whatToChange ); + sub LDAPmodify + { + my ($ldap, $dn, $whatToChange) = @_; + my $result = $ldap->modify ( $dn, + changes => [ + @$whatToChange + ] + ); + return $result; + } =head2 OPERATION - Changing the RDN - my $newRDN = "cn=Joseph User"; + my $newRDN = "cn=Joseph User"; - my $result = LDAPrdnChange($ldap,$dn,$newRDN,"archive"); + my $result = LDAPrdnChange ( $ldap, $dn, $newRDN, "archive" ); - sub LDAPrdnChange - { - my ($ldap,$dn,$whatToChange,$action) = @_ ; + sub LDAPrdnChange + { + my ($ldap,$dn,$whatToChange,$action) = @_; - my $branch ; + my $branch; - # - # if the archive action is selected, move this - # entry to another place in the directory. - # - if ( $action =~ /archive/i ) { - $branch = "ou=newbranch,o=mycompany,c=mycountry"; - } + # + # if the archive action is selected, move this + # entry to another place in the directory. + # + if ( $action =~ /archive/i ) { + $branch = "ou=newbranch, o=mycompany, c=mycountry"; + } - # - # use the 'deleteoldrdn' to keep from getting - # multivalues in the NAMING attribute. - # in most cases that would be the 'CN' attribute - # - my $result = $ldap->moddn($dn, - newrdn => $whatToChange, - deleteoldrdn => '1', - newsuperior => $branch - ); + # + # use the 'deleteoldrdn' to keep from getting + # multivalues in the NAMING attribute. + # in most cases that would be the 'CN' attribute + # + my $result = $ldap->moddn ( $dn, + newrdn => $whatToChange, + deleteoldrdn => '1', + newsuperior => $branch + ); - return ($result ); + return $result; - } + } =head2 OPERATION - Adding a new Record + my $DNbranch = "ou=bailiwick, o=mycompany, c=mycountry"; - my $DNbranch = "ou=bailiwick, o=mycompany, c=mycountry"; - - # - # check with your Directory Schema or Administrator - # for the correct objectClass... I'm sure it'll be different - # - my $CreateArray = [ - objectClass => ["top","person","organizationalPerson"], - cn => "Jane User", - uid => "0000001", - sn => "User", - mail => "Jan...@my..." - ]; - - # - # create the new DN to look like this - # " cn=Jo User + uid=0000001 , ou=bailiwick, o=mycompany, c=mycountry " - # - # NOTE: this DN MUST be changed to meet your implementation - # - - my $NewDN = "@$CreateArray[2]=". - "@$CreateArray[3]+". - "@$CreateArray[4]=". - "@$CreateArray[5],". - $DNbranch; - - LDAPentryCreate($ldap,$NewDN,$CreateArray); + # + # check with your Directory Schema or Administrator + # for the correct objectClass... I'm sure it'll be different + # + my $CreateArray = [ + objectClass => [ "top", "person", "organizationalPerson", "inetOrgPerson" ], + cn => "Jane User", + uid => "0000001", + sn => "User", + mail => "Jan...@my..." + ]; - # - # CreateArray is a reference to an anonymous array - # you have to dereference it in the subroutine it's - # passed to. - # + # + # create the new DN to look like this + # " cn=Jo User + uid=0000001 , ou=bailiwick, o=mycompany, c=mycountry " + # + # NOTE: this DN MUST be changed to meet your implementation + # - sub LDAPentryCreate - { + my $NewDN = "@$CreateArray[2]=". + "@$CreateArray[3]+". + "@$CreateArray[4]=". + "@$CreateArray[5],". + $DNbranch; - my ($ldap,$dn,$whatToCreate) = @_ ; - my $result = $ldap->add( $dn, attrs => [ @$whatToCreate ] ); - return ($result ); + LDAPentryCreate($ldap, $NewDN, $CreateArray); - } + # + # CreateArray is a reference to an anonymous array + # you have to dereference it in the subroutine it's + # passed to. + # + sub LDAPentryCreate + { + my ($ldap, $dn, $whatToCreate) = @_; + my $result = $ldap->add ( $dn, attrs => [ @$whatToCreate ] ); + return $result; + } =head2 ERROR - Retrieving and Displaying ERROR information - use Net::LDAP::Util qw( ldap_error_name - ldap_error_text) ; - - if ( $result->code ) { - # - # if we've got an error... record it - # - LDAPerror("Searching",$result); - } - - - - sub LDAPerror - { - my ($from,$mesg) = @_; - print "Return code: ",$mesg->code ; - print "\tMessage: ", ldap_error_name($mesg->code); - print " :", ldap_error_text($mesg->code); - print "MessageID: ",$mesg->mesg_id; - print "\tDN: ",$mesg->dn; + if ( $result->code ) { + # + # if we've got an error... record it + # + LDAPerror ( "Searching", $result ); + } - #--- - # Programmer note: - # - # "$mesg->error" DOESN'T work!!! - # - #print "\tMessage: ", $mesg->error; - #----- + sub LDAPerror + { + my ($from, $mesg) = @_; + print "Return code: ", $mesg->code; + print "\tMessage: ", $mesg->error_name; + print " :", $mesg->error_text; + print "MessageID: ", $mesg->mesg_id; + print "\tDN: ", $mesg->dn; - } + #--- + # Programmer note: + # + # "$mesg->error" DOESN'T work!!! + # + #print "\tMessage: ", $mesg->error; + #----- + } =head2 UNBIND - $ldap->unbind; + $ldap->unbind; =head1 LDAP SCHEMA RETRIEVAL @@ -452,7 +421,7 @@ After a successful bind you are ready to retrieve the schema information. You do this by initializing a schema object. - $schema = $ldap->schema(); + $schema = $ldap->schema ( ); In this case Net::LDAP will attempt to determine the dn under which the schema can be found. First it will look for the attribute @@ -462,15 +431,14 @@ Alternatively you can specify the dn where the schema is to be found with - $schema = $ldap->schema(dn => $dn); + $schema = $ldap->schema ( dn => $dn ); Once we have a dn to search for, Net::LDAP will fetch the schema entry with - $mesg = $self->search( - base => $dn, - scope => 'base', - filter => '(objectClass=subschema)', - ); + $mesg = $self->search ( base => $dn, + scope => 'base', + filter => '(objectClass=subschema)', + ); Once the schema object has been initialized, schema methods are used to retrieve the data. There are a number of ways this @@ -480,34 +448,29 @@ The following is a code snippet showing how to get and display information about returned attributes. - # - # Get the attributes - # + # + # Get the attributes + # - @attributes = $schema->all_attributes(); - # - # Display the attributes - # + @attributes = $schema->all_attributes ( ); - foreach ( @attributes) - { - print "attributeType $_\n"; + # + # Display the attributes + # - # - # Get a reference to the attribute details - # - $ar = $schema->attribute( $_ ); + foreach $ar ( @attributes ) { + print "attributeType: ", $ar->{name}, "\n"; - # - # Print all the details - # - foreach $key ( keys $ar ) - { - print join("\n\t\t", "\t$key:", - ref($ar->{$key}) ? @{$ar->{$key}} : $ar->{$key}), - "\n"; - } - } + # + # Print all the details + # + + foreach $key ( keys %{$ar} ) { + print join ( "\n\t\t", "\t$key:", + ref ( $ar->{$key} ) ? @{$ar->{$key}} : $ar->{$key} + ), "\n"; + } + } The process is the basically the same for getting objectClass information. Where schema-E<gt>all_attributes() is used, substitute |
From: Chris R. <chr...@us...> - 2003-08-05 13:33:08
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv9503 Modified Files: Schema.pod Log Message: Updated documentation style, corrected return type of all_attributes etc Index: Schema.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Schema.pod,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Schema.pod 7 May 2003 11:15:33 -0000 1.12 +++ Schema.pod 5 Aug 2003 13:33:04 -0000 1.13 @@ -10,19 +10,19 @@ # # Read schema from server # - $ldap = Net::LDAP->new( $server ); - $ldap->bind(); - $schema = $ldap->schema(); + $ldap = Net::LDAP->new ( $server ); + $ldap->bind ( ); + $schema = $ldap->schema ( ); # # Load from LDIF # $schema = Net::LDAP::Schema->new; - $schema->parse( "schema.ldif" ) or die $schema->error; + $schema->parse ( "schema.ldif" ) or die $schema->error; =head1 DESCRIPTION -B<Net::LDAP::Schema> provides a means to load an LDAP schema and query it +C<Net::LDAP::Schema> provides a means to load an LDAP schema and query it for information regarding supported objectclasses, attributes and syntaxes. =head1 METHODS @@ -34,105 +34,121 @@ =over 4 -=item all_attributes - -=item all_ditcontentrules +=item all_attributes ( ) -=item all_ditstructurerules +=item all_ditcontentrules ( ) -=item all_matchingrules +=item all_ditstructurerules ( ) -=item all_matchingruleuses +=item all_matchingrules ( ) -=item all_nameforms +=item all_matchingruleuses ( ) -=item all_objectclasses +=item all_nameforms ( ) -=item all_syntaxes +=item all_objectclasses ( ) -Returns a list of the names all the requested type in the schema +=item all_syntaxes ( ) - @attrs = $schema->all_attributes(); +Returns a list of all the requested types in the schema. Each item in +the list is a reference to a HASH; the various keys in each HASH are +named after the keys defined in RFC 2252: -=item attribute NAME_OR_OID + name + desc + obsolete + sup + equality + ordering + substr + syntax + single-value + collective + no-user-modification + usage + abstract + structural + auxiliary + must + may + applies + aux + not + oc + form -=item ditcontentrule NAME_OR_OID +=item attribute ( NAME ) -=item ditstructurerule NAME_OR_OID +=item ditcontentrule ( NAME ) -=item matchingrule NAME_OR_OID +=item ditstructurerule ( NAME ) -=item matchingruleuse NAME_OR_OID +=item matchingrule ( NAME ) -=item nameform NAME_OR_OID +=item matchingruleuse ( NAME ) -=item objectclass NAME_OR_OID +=item nameform ( NAME ) -=item syntax NAME_OR_OID +=item objectclass ( NAME ) -Returns a reference to a hash, or undef if the attribute does not exist. +=item syntax ( NAME ) - $attr_href = $schema->attribute( "attrname" ); +Returns a reference to a hash, or C<undef> if the schema item does not +exist. C<NAME> can be a name or an OID. -=item dump + $attr_href = $schema->attribute( "attrname" ); -=item dump FILENAME +=item dump ( ) -Given an argument which is the name of a file, and the file or -directory has write permission, will dump the raw schema -information to a file. If no argument is given the raw schema -information is dumped to standard out. +Dump the raw schema information to standard out. - $result = $schema->dump( "./schema.dump" ); +=item dump ( FILENAME ) - or +Dump the raw schema information to a file. - $result = $schema->dump(); + $result = $schema->dump ( "./schema.dump" ); -If no schema data is returned from directory server, the method -will return undefined. Otherwise a value of 1 is always returned. +If no schema data is returned from directory server, the method will +return undefined. Otherwise a value of 1 is always returned. -=item error +=item error ( ) Returns the last error encountered. -Given the name or oid of a schema item (matchingruleuse, ditstructurerule, -ditcontentrule or nameform respectively) returns the assoicated OID -or undef if the name or oid is not of the appropriate type. - -=item may +=item may ( OBJECTCLASS ) -Given an argument which is the name or oid of a known object class, returns -the names of the attributes which are optional in the class. +Given an argument which is the name or oid of a known object class, +returns the names of the attributes which are optional in the class. - @may = $schema->may( $oc ); + @may = $schema->may ( $oc ); -=item must +=item must ( OBJECTCLASS ) -Given an argument which is the name or oid of a known object class, returns -the names of the attributes which are mandatory in the class +Given an argument which is the name or oid of a known object class, +returns the names of the attributes which are mandatory in the class - @must = $schema->must( $oc ); + @must = $schema->must ( $oc ); -=item parse MESG +=item parse ( MESG ) -=item parse ENTRY +=item parse ( ENTRY ) -=item parse FILENAME +=item parse ( FILENAME ) -Takes a single argument which can be any of, A message objected returned from -an LDAP search, a Net::LDAP::Entry object or the name of a file containing -an LDIF form of the schema. +Takes a single argument which can be any of, a message object returned +from an LDAP search, a C<Net::LDAP::Entry> object or the name of a +file containing an LDIF form of the schema. -If the argument is a message result from a search, Net::LDAP::Schema will parse -the schema from the first entry returned. +If the argument is a message result from a search, +C<Net::LDAP::Schema> will parse the schema from the first entry +returned. Returns true on success and C<undef> on error. -=item superclass +=item superclass ( NAME ) -Given an argument which is the name or oid of a known objectclass, returns -the list of names of the immediate superclasses. +Given an argument which is the name or oid of a known objectclass, +returns the list of names of the immediate superclasses. =back |
From: Chris R. <chr...@us...> - 2003-08-02 18:50:21
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv30529 Modified Files: Search.pod Log Message: Fix typo Index: Search.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Search.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Search.pod 1 Aug 2003 16:34:42 -0000 1.6 +++ Search.pod 2 Aug 2003 18:50:18 -0000 1.7 @@ -28,7 +28,7 @@ Returns a reference to a HASH, where the keys are the DNs of the results and the values are HASH references. These second level HASHes hold the attributes such that the keys are the attribute names, in -lowercase, and the values are references to and ARRAY holding the +lowercase, and the values are references to an ARRAY holding the values. This method will block until the whole search request has finished. |
From: Chris R. <chr...@us...> - 2003-08-02 10:03:18
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv23040 Modified Files: LDIF.pod Log Message: Updated documentation style. Index: LDIF.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/LDIF.pod,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- LDIF.pod 7 May 2003 11:09:47 -0000 1.7 +++ LDIF.pod 2 Aug 2003 10:03:15 -0000 1.8 @@ -4,77 +4,90 @@ =head1 SYNOPSIS - use Net::LDAP::LDIF; + use Net::LDAP::LDIF; - $ldif = Net::LDAP::LDIF->new( "file.ldif", "r", onerror => 'undef' ); - while( not $ldif->eof() ) { - $entry = $ldif->read_entry(); - if ( $ldif->error() ) { - print "Error msg: ",$ldif->error(),"\n"; - print "Error lines:\n",$ldif->error_lines(),"\n"; - } - else { - # do stuff - } - } - $ldif->done(); + $ldif = Net::LDAP::LDIF->new( "file.ldif", "r", onerror => 'undef' ); + while( not $ldif->eof ( ) ) { + $entry = $ldif->read_entry ( ); + if ( $ldif->error ( ) ) { + print "Error msg: ", $ldif->error ( ), "\n"; + print "Error lines:\n", $ldif->error_lines ( ), "\n"; + } else { + # do stuff + } + } + $ldif->done ( ); =head1 DESCRIPTION B<Net::LDAP::LDIF> provides a means to convert between -L<Net::LDAP::Entry> objects and LDAP entries represented -in LDIF format files. Reading and writing are supported and may manipulate +L<Net::LDAP::Entry> objects and LDAP entries represented in LDIF +format files. Reading and writing are supported and may manipulate single entries or lists of entries. -As when reading an entire file into memory with perl normally, take into -account the possibility of memory use when loading an LDIF file in one go. +As when reading an entire file into memory with perl normally, take +into account the possibility of memory use when loading an LDIF file +in one go. =head1 CONSTRUCTOR =over 4 -=item new ( [ FILE [, MODE [,OPTIONS ]]] ) +=item new ( FILE ) -FILE may be the name of a file or an already open filehandle. If a filename -is passed in then it will be opened with the mode specified. If FILE begins -or ends with a C<|> then FILE will be passed directly to C<open> +Open the file read-only. C<FILE> may be the name of a file or an +already open filehandle. If C<FILE> begins or ends with a C<|> then +C<FILE> will be passed directly to C<open>. -MODE defaults to "r" for read. You may specify "w" to for write+truncate or -"a" for write+append. +=item new ( FILE, MODE, OPTIONS ) -OPTIONS is a list of key-value pairs. Valid options are: +Open the file with the given C<MODE>, eg "w" or "a". C<FILE> may be +the name of a file or an already open filehandle. If C<FILE> begins or +ends with a C<|> then C<FILE> will be passed directly to C<open>. =over 4 -=item encode +=item encode =E<gt> 'none' | 'canonical' | 'base64' Some values in LDIF cannot be written verbatim and have to be encoded -in some way. This option lets you specify how. Valid encoding options -are 'none' (the default), 'canonical' (see -L<Net::LDAP::Util/canonical_dn>), or 'base64'. +in some way: + +=over 4 + +=item 'none' + +The default. + +=item 'canonical' + +See L<Net::LDAP::Util/canonical_dn>. + +=item 'base64' + +Use base64. =back -=item onerror +=back -If set then Net::LDAP::LDIF will check all responses for errors on all methods. -If an error is detected then the specified action will be taken. Valid values -and their actions are. +=item onerror =E<gt> 'die' | 'warn' | undef + +Specify what happens when an error is detected. =over 4 -=item die +=item 'die' -Net::LDAP::LDIF will croak with an appropriate message. +C<Net::LDAP::LDIF> will croak with an appropriate message. -=item warn +=item 'warn' -Net::LDAP::LDIF will warn with an appropriate message. +C<Net::LDAP::LDIF> will warn with an appropriate message. =item undef -Net::LDAP::LDIF will warn with an appropriate message if C<-w> is in effect. -The method that was called will return C<undef> +C<Net::LDAP::LDIF> will warn with an appropriate message if C<-w> is +in effect. The method that was called will return C<undef>. =back @@ -84,43 +97,47 @@ =over 4 -=item read_entry +=item read_entry ( ) -Read one entry from the file and return it as a Net::LDAP::Entry object. +Read one entry from the file and return it as a C<Net::LDAP::Entry> +object. -=item eof +=item eof ( ) -Returns true when the end of the file is reached. +Returns I<true> when the end of the file is reached. =item write_entry ( ENTRIES ) +Write the entries to the LDIF file. +=item done ( ) -=item done - -This method signals that the LDIF object is no longer needed. If a file was -opened automatically when the object was created it will be closed. This -method is called automatically via DESTROY when the object goes out of scope. +This method signals that the LDIF object is no longer needed. If a +file was opened automatically when the object was created it will be +closed. This method is called automatically via DESTROY when the +object goes out of scope. -=item error +=item error ( ) Returns error message if error was found. -=item error_lines +=item error_lines ( ) Returns lines that resulted in error. -=item current_entry +=item current_entry ( ) -Returns the current Net::LDAP::Entry object. +Returns the current C<Net::LDAP::Entry> object. -=item current_lines +=item current_lines ( ) -Returns the lines that generated the current Net::LDAP::Entry object. +Returns the lines that generated the current C<Net::LDAP::Entry> +object. -=item next_lines +=item next_lines ( ) -Returns the lines that will generate the next Net::LDAP::Entry object. +Returns the lines that will generate the next C<Net::LDAP::Entry> +object. =back @@ -128,14 +145,14 @@ Graham Barr E<lt>gb...@po...E<gt>. -Please report any bugs, or post any suggestions, to the perl-ldap mailing list -E<lt>per...@pe...E<gt>. +Please report any bugs, or post any suggestions, to the perl-ldap +mailing list E<lt>per...@pe...E<gt>. =head1 COPYRIGHT -Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program is -free software; you can redistribute it and/or modify it under the same -terms as Perl itself. +Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program +is free software; you can redistribute it and/or modify it under the +same terms as Perl itself. =for html <hr> |
From: Chris R. <chr...@us...> - 2003-08-01 19:00:42
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv17959 Modified Files: Entry.pod Log Message: Updated documentation style. Index: Entry.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Entry.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Entry.pod 7 May 2003 10:57:16 -0000 1.11 +++ Entry.pod 1 Aug 2003 19:00:39 -0000 1.12 @@ -4,64 +4,64 @@ =head1 SYNOPSIS - use Net::LDAP; + use Net::LDAP; - $ldap = Net::LDAP->new($host); - $mesg = $ldap->search(@search_args); + $ldap = Net::LDAP->new ( $host ); + $mesg = $ldap->search ( @search_args ); - my $max = $mesg->count; - for($i = 0 ; $i < $max ; $i++) { - my $entry = $mesg->entry($i); - foreach my $attr ($entry->attributes) { - print join("\n ",$attr, $entry->get_value($attr)),"\n"; - } - } + my $max = $mesg->count; + for ( $i = 0 ; $i < $max ; $i++ ) { + my $entry = $mesg->entry ( $i ); + foreach my $attr ( $entry->attributes ) { + print join( "\n ", $attr, $entry->get_value( $attr ) ), "\n"; + } + } - # or + # or - use Net::LDAP::Entry; + use Net::LDAP::Entry; - $entry = Net::LDAP::Entry->new; + $entry = Net::LDAP::Entry->new; - $entry->add( - attr1 => 'value1', - attr2 => [qw(value1 value2)] - ); + $entry->add ( + attr1 => 'value1', + attr2 => [ qw(value1 value2) ] + ); - $entry->delete( 'unwanted' ); + $entry->delete ( 'unwanted' ); - $entry->replace( - attr1 => 'newvalue' - attr2 => [qw(new values)] - ); + $entry->replace ( + attr1 => 'newvalue' + attr2 => [ qw(new values) ] + ); - $entry->update( $ldap ); # update directory server + $entry->update ( $ldap ); # update directory server - $entry2 = $entry->clone; # copies entry + $entry2 = $entry->clone; # copies entry =head1 DESCRIPTION -The B<Net::LDAP::Entry> object represents a single entry in the directory. -It is a container for attribute-value pairs. +The B<Net::LDAP::Entry> object represents a single entry in the +directory. It is a container for attribute-value pairs. -A B<Net::LDAP::Entry> object can be used in two situations. The first and -probably most common use is in the result of a search to the directory -server. +A B<Net::LDAP::Entry> object can be used in two situations. The first +and probably most common use is in the result of a search to the +directory server. The other is where a new object is created locally and then a single command is sent to the directory server to add, modify or replace an -entry. Entries for this purpose can also be created by reading an -LDIF file with the L<Net::LDAP::LDIF> module. +entry. Entries for this purpose can also be created by reading an LDIF +file with the L<Net::LDAP::LDIF> module. =head1 CONSTRUCTORS =over 4 -=item new +=item new ( ) Create a new entry object with the changetype set to C<'add'> -=item clone +=item clone ( ) Returns a copy of the B<Net::LDAP::Entry> object. @@ -71,36 +71,31 @@ =over 4 +=item add ( ATTR =E<gt> VALUE, ... ) +Add more attributes or values to the entry. Each C<VALUE> should be a +string if only a single value is wanted in the attribute, or a +reference to an array of strings if multiple values are wanted. The +values given will be added to the values which already exist for the +given attributes. -=item add ( ATTR =E<gt> VALUE [, ATTR2 =E<gt> VALUE2 ... ] ) - -Add one or more new attributes to the entry. Each value -must be a scalar variable or a reference to an array. The -values given will be added to the values which already exist -for the given attributes. - - $entry->add( 'sn' => 'Barr'); - - $entry->add( 'street' => [ '1 some road','nowhere']); - -B<NOTE>: these changes are local to the client and will not -appear on the directory server until the C<update> method -is called. - + $entry->add ( 'sn' => 'Barr' ); + $entry->add ( 'street' => [ '1 some road','nowhere' ] ); -=item attributes ( [ OPTIONS ] ) +B<NOTE>: these changes are local to the client and will not appear on +the directory server until the C<update> method is called. -Return a list of attributes that this entry has. +=item attributes ( OPTIONS ) -OPTIONS is a list of name/value pairs, valid options are :- +Return a list of attributes in this entry =over 4 -=item nooptions +=item nooptions =E<gt> 1 -If TRUE, return a list of the attribute names excluding any options. For example for the entry +Return a list of the attribute names excluding any options. For +example for the entry name: Graham Barr name;en-us: Bob @@ -108,10 +103,10 @@ then - @values = $entry->attributes() + @values = $entry->attributes; print "default: @values\n"; - @values = $entry->attributes( nooptions => 1); + @values = $entry->attributes ( nooptions => 1 ); print "nooptions: @values\n"; will output @@ -121,15 +116,17 @@ =back +=item changetype ( ) +Returns the type of operation that would be performed when the update +method is called. -=item changetype ( [ TYPE ] ) +=item changetype ( TYPE ) -If called without arguments it returns the type of operation that would -be performed when the update method is called. If called with an argument -it will set the changetype to TYPE. +Set the type of operation that will be performed when the update +method is called to C<TYPE>. -Possible values for TYPE are +Possible values for C<TYPE> are =over 4 @@ -140,144 +137,134 @@ =item delete -The update method will call the delete method on the client object, which -will result in the entry being removed from the directory server. +The update method will call the delete method on the client object, +which will result in the entry being removed from the directory +server. =item modify -The update method will call the modify method on the client object, which -will result in any changes that have been made locally being made to the -entry on the directory server. +The update method will call the modify method on the client object, +which will result in any changes that have been made locally being +made to the entry on the directory server. =item moddn/modrdn -The update method will call the moddn method on the client object, which -will result in any DN changes that have been made locally being made -to the entry on the directory server. These DN changes are specified by -setting the entry attributes newrdn, deleteoldrdn, and (optionally) newsuperior. +The update method will call the moddn method on the client object, +which will result in any DN changes that have been made locally being +made to the entry on the directory server. These DN changes are +specified by setting the entry attributes newrdn, deleteoldrdn, and +(optionally) newsuperior. =back +=item delete ( ) +Delete the entry from the server on the next call to C<update>. -=item delete ( ATTR [ =E<gt> VALUE [, ATTR2 =E<gt> VALUE2... ]] ) +=item delete ( ATTR =E<gt> [ VALUE, ... ], ... ) Delete the values of given attributes from the entry. Values are references to arrays; passing a reference to an empty array is the -same as passing undef, and will result in the entire attribute being -deleted. If no attributes are passed then the next call to update will -cause the entry to be deleted from the server. For example: - - $entry->delete( 'mail' => [ 'fo...@ex...' ] ); - $entry->delete( 'description' => [ ], 'streetAddress' => [ ] ); - -B<NOTE>: these changes are local to the client and will not -appear on the directory server until the C<update> method -is called. +same as passing C<undef>, and will result in the entire attribute +being deleted. For example: + $entry->delete ( 'mail' => [ 'fo...@ex...' ] ); + $entry->delete ( 'description' => [ ], 'streetAddress' => [ ] ); +B<NOTE>: these changes are local to the client and will not appear on +the directory server until the C<update> method is called. -=item dn ( [ DN ] ) +=item dn ( ) -Set or get the DN for the entry. With no arguments C<dn> will return -the current DN. If an argument is given then it will change the DN -for the entry and return the previous value. +Get the DN of the entry. -B<NOTE>: these changes are local to the client and will not -appear on the directory server until the C<update> method -is called. +=item dn ( DN ) +Set the DN for the entry, and return the previous value. +B<NOTE>: these changes are local to the client and will not appear on +the directory server until the C<update> method is called. =item exists ( ATTR ) -Returns TRUE if the entry has an attribute called ATTR. - - - -=item get_value ( ATTR [, OPTIONS ] ) +Returns C<TRUE> if the entry has an attribute called C<ATTR>. -Get the values for the attribute ATTR. In a list context returns all -values for the given attribute, or the empty list if the attribute does -not exist. In a scalar context returns the first value for the attribute -or undef if the attribute does not exist. +=item get_value ( ATTR, OPTIONS ) -The return value may be changed by OPTIONS, which is a list of name -=E<gt> value pairs, valid options are :- +Get the values for the attribute C<ATTR>. In a list context returns +all values for the given attribute, or the empty list if the attribute +does not exist. In a scalar context returns the first value for the +attribute or undef if the attribute does not exist. =over 4 -=item alloptions +=item alloptions =E<gt> 1 -If TRUE then the result will be a hash reference. The keys of the hash -will be the options and the hash value will be the values for those attributes. -For example if an entry had +The result will be a hash reference. The keys of the hash will be the +options and the hash value will be the values for those attributes. +For example if an entry had: - name: Graham Barr - name;en-us: Bob + name: Graham Barr + name;en-us: Bob Then a get for attribute "name" with alloptions set to a true value - $ref = $entry->get_value( 'name', alloptions => 1); + $ref = $entry->get_value ( 'name', alloptions => 1 ); will return a hash reference that would be like - { - '' => [ 'Graham Barr' ], - ';en-us' => [ 'Bob' ] - } + { + '' => [ 'Graham Barr' ], + ';en-us' => [ 'Bob' ] + } -=item asref +=item asref =E<gt> 1 -If TRUE then the result will be a reference to an array containing all the -values for the attribute, or undef if the attribute does not exist. +The result will be a reference to an array containing all the values +for the attribute, or C<undef> if the attribute does not exist. - $scalar = $entry->get_value('name'); + $scalar = $entry->get_value ( 'name' ); -$scalar will be the first value for the C<name> attribute, or C<undef> if the -entry does not contain a C<name> attribute. +$scalar will be the first value for the C<name> attribute, or C<undef> +if the entry does not contain a C<name> attribute. - $ref = $entry->get_value('name', asref => 1); + $ref = $entry->get_value ( 'name', asref => 1 ); -$ref will be a reference to an array, which will have all the values for -the C<name> attribute. If the entry does not have an attribute called C<name> -then $ref will be C<undef> +$ref will be a reference to an array, which will have all the values +for the C<name> attribute. If the entry does not have an attribute +called C<name> then $ref will be C<undef>. =back -B<NOTE>: In the interest of performance the array references returned by C<get_value> -are references to structures held inside the entry object. These values and -thier contents should B<NOT> be modified directly. - - - -=item replace ( ATTR =E<gt> VALUE [, ATTR2 =E<gt> VALUE2 ... ] ) - -Similar to add, except that the values given will replace -any values that already exist for the given attributes. +B<NOTE>: In the interest of performance the array references returned +by C<get_value> are references to structures held inside the entry +object. These values and thier contents should B<NOT> be modified +directly. -B<NOTE>: these changes are local to the client and will not -appear on the directory server until the C<update> method -is called. +=item replace ( ATTR =E<gt> VALUE, ... ) +Similar to C<add>, except that the values given will replace any +values that already exist for the given attributes. +B<NOTE>: these changes are local to the client and will not appear on +the directory server until the C<update> method is called. =item update ( CLIENT ) -Update the directory server with any changes that have been made locally -to the attributes of this entry. This means any calls that have been -made to add, replace or delete since the last call to changetype or -update was made. +Update the directory server with any changes that have been made +locally to the attributes of this entry. This means any calls that +have been made to add, replace or delete since the last call to +changetype or update was made. -This method can also be used to modify the DN of the entry on the server, -by specifying moddn or modrdn as the changetype, and setting the entry -attributes newrdn, deleteoldrdn, and (optionally) newsuperior. +This method can also be used to modify the DN of the entry on the +server, by specifying moddn or modrdn as the changetype, and setting +the entry attributes newrdn, deleteoldrdn, and (optionally) +newsuperior. -CLIENT is a C<Net::LDAP> object where the update will be sent to. +C<CLIENT> is a C<Net::LDAP> object where the update will be sent to. -The result will be an object of type -L<Net::LDAP::Message> as returned by the add, modify -or delete method called on CLIENT. +The result will be an object of type L<Net::LDAP::Message> as returned +by the add, modify or delete method called on CLIENT. =back @@ -290,14 +277,14 @@ Graham Barr E<lt>gb...@po...E<gt>. -Please report any bugs, or post any suggestions, to the perl-ldap mailing list -E<lt>per...@pe...E<gt>. +Please report any bugs, or post any suggestions, to the perl-ldap +mailing list E<lt>per...@pe...E<gt>. =head1 COPYRIGHT -Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program is -free software; you can redistribute it and/or modify it under the same -terms as Perl itself. +Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program +is free software; you can redistribute it and/or modify it under the +same terms as Perl itself. =for html <hr> |
From: Chris R. <chr...@us...> - 2003-08-01 18:42:50
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv14432 Modified Files: Message.pod Log Message: Updated documentation style. Index: Message.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Message.pod,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Message.pod 20 May 2003 14:56:04 -0000 1.7 +++ Message.pod 1 Aug 2003 18:42:47 -0000 1.8 @@ -4,7 +4,7 @@ =head1 SYNOPSIS - use Net::LDAP; + use Net::LDAP; =head1 DESCRIPTION @@ -20,80 +20,85 @@ L<search|Net::LDAP/item_search> and L<unbind|Net::LDAP/item_unbind>. -The sub-class L<Net::LDAP::Search> returned by L<search|Net::LDAP/item_search> also -defines many methods. +The sub-class L<Net::LDAP::Search> returned by +L<search|Net::LDAP/item_search> also defines many methods. -If the L<Net::LDAP> object is in async mode then all these methods, except -C<done>, will cause a wait until the request is completed. +If the L<Net::LDAP> object is in async mode then all these methods, +except C<done>, will cause a wait until the request is completed. =head1 METHODS =over 4 -=item code +=item code ( ) -The code value in the result message from the server. Normally for -a success zero will be returned. Constants for the result codes -can be imported from the L<Net::LDAP> or L<Net::LDAP::Constant> module. +The code value in the result message from the server. Normally for a +success zero will be returned. Constants for the result codes can be +imported from the L<Net::LDAP> or L<Net::LDAP::Constant> module. -=item control [ OID ] +=item control ( ) -Return a list of controls returned from the server. If OID is given -then only controls with type equal to OID will be returned. +Return a list of controls that were returned from the server. -=item dn +=item control ( OID, ... ) + +Return a list of controls with the given OIDs that were returned from +the server. + +=item dn ( ) The DN in the result message from the server. -=item done +=item done ( ) Returns I<true> if the request has been completed. -=item error +=item error ( ) Returns the error message in the result message from the server. If the server did not include an error message, then the result of L<ldap_error_desc|Net::LDAP::Util/ldap_error_desc> with the error code from the result message. -=item error_name +=item error_name ( ) Returns the name of the error code in the result message from the server. See L<ldap_error_name|Net::LDAP::Util::ldap_error_name> for a detailed description of the return value. -=item error_text +=item error_text ( ) Returns the short text description of the error code in the result message from the server. See L<ldap_error_text|Net::LDAP::Util::ldap_error_text> for a detailed description of the return value. -=item error_desc +=item error_desc ( ) Returns a long text description of the error code in the result message from the server. See L<ldap_error_desc|Net::LDAP::Util::ldap_error_desc> for a detailed description of the return value. -=item is_error +=item is_error ( ) -Returns I<true> if the result code is considered to be an error for the operation. +Returns I<true> if the result code is considered to be an error for +the operation. -=item mesg_id +=item mesg_id ( ) The message id of the request message sent to the server. -=item referrals +=item referrals ( ) Returns a list of referrals from the result message. -=item server_error +=item server_error ( ) -The error message returned by the server, or undef if the server did not provide -a message. +The error message returned by the server, or C<undef> if the server +did not provide a message. -=item sync +=item sync ( ) Wait for the server to complete the request. @@ -108,21 +113,21 @@ =head1 ACKNOWLEDGEMENTS -This document is based on a document originally written by Russell Fulton -E<lt>r.f...@au...E<gt>. +This document is based on a document originally written by Russell +Fulton E<lt>r.f...@au...E<gt>. =head1 AUTHOR Graham Barr E<lt>gb...@po...E<gt> -Please report any bugs, or post any suggestions, to the perl-ldap mailing list -E<lt>per...@pe...E<gt>. +Please report any bugs, or post any suggestions, to the perl-ldap +mailing list E<lt>per...@pe...E<gt>. =head1 COPYRIGHT -Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program is -free software; you can redistribute it and/or modify it under the same -terms as Perl itself. +Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program +is free software; you can redistribute it and/or modify it under the +same terms as Perl itself. =for html <hr> |
From: Chris R. <chr...@us...> - 2003-08-01 17:17:06
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv18169 Modified Files: Search.pod Log Message: Updated documentation style. Index: Search.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Search.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Search.pod 7 May 2003 11:17:06 -0000 1.5 +++ Search.pod 1 Aug 2003 16:34:42 -0000 1.6 @@ -4,35 +4,36 @@ =head1 SYNOPSIS - use Net::LDAP; + use Net::LDAP; - $mesg = $ldap->search( @search_args ); + $mesg = $ldap->search( @search_args ); - @entries = $mesg->entries; + @entries = $mesg->entries; =head1 DESCRIPTION A B<Net::LDAP::Search> object is returned from the -L<search|Net::LDAP/item_search> method of a L<Net::LDAP> -object. It is a container object which holds the results of the search. +L<search|Net::LDAP/item_search> method of a L<Net::LDAP> object. It is +a container object which holds the results of the search. =head1 METHODS -B<Net::LDAP::Search> inherits from L<Net::LDAP::Message>, and so supports -all methods defined in L<Net::LDAP::Message>. +B<Net::LDAP::Search> inherits from L<Net::LDAP::Message>, and so +supports all methods defined in L<Net::LDAP::Message>. =over 4 -=item as_struct +=item as_struct ( ) -Returns a reference to a HASH, where the keys are the DN's of the results -and the values are HASH references. These second level HASH's hold the -attributes such that the keys are the attribute names, in lowercase, and -the values are references to and ARRAY holding the values. +Returns a reference to a HASH, where the keys are the DNs of the +results and the values are HASH references. These second level HASHes +hold the attributes such that the keys are the attribute names, in +lowercase, and the values are references to and ARRAY holding the +values. This method will block until the whole search request has finished. -=item count +=item count ( ) Returns the number of entries returned by the server. @@ -42,45 +43,48 @@ Return the N'th entry, which will be a L<Net::LDAP::Entry> object. If INDEX is greater than the total number of entries returned then -undef will be returned. +C<undef> will be returned. This method will block until the search request has returned enough entries. -=item entries +=item entries ( ) -Return an array of L<Net::LDAP::Entry> objects hat were returned from the -server. +Return an array of L<Net::LDAP::Entry> objects that were returned from +the server. This method will block until the whole search request has finished. -=item pop_entry +=item pop_entry ( ) -Pop an entry from the internal list of L<Net::LDAP::Entry> objects for this -search. If there are not more entries then undef is returned. +Pop an entry from the internal list of L<Net::LDAP::Entry> objects for +this search. If there are no more entries then C<undef> is returned. -This call will block, if the list is empty, until the server returns +This call will block if the list is empty, until the server returns another entry. -=item references +=item references ( ) -Return a list of references that the server returned. This will be a list -of L<Net::LDAP::Reference> objects. +Return a list of references that the server returned. This will be a +list of L<Net::LDAP::Reference> objects. -=item sorted ( [ ATTR_LIST ] ) +=item sorted ( ) -Return a list of L<Net::LDAP::Entry> objects, -sorted by the attributes given in ATTR_LIST. The attributes are -compared in the order specified, each only being compared if all -the prior attributes compare equal. If all the specified attributes -compare equal then the DN is used to determine order. +Return a list L<Net::LDAP:Entry> objects, sorted by their DNs. -=item shift_entry +=item sorted ( ATTR, ... ) -Shift an entry from the internal list of L<Net::LDAP::Entry> objects for this -search. If there are not more entries then undef is returned. +Return a list of L<Net::LDAP::Entry> objects, sorted by the specified +attributes. The attributes are compared in the order specified, each +only being compared if all the prior attributes compare equal. -This call will block, if the list is empty, until the server returns +=item shift_entry ( ) + +Shift an entry from the internal list of L<Net::LDAP::Entry> objects +for this search. If there are no more entries then C<undef> is +returned. + +This call will block if the list is empty, until the server returns another entry. =back @@ -94,21 +98,21 @@ =head1 ACKNOWLEDGEMENTS -This document is based on a document originally written by Russell Fulton -E<lt>r.f...@au...E<gt>. +This document is based on a document originally written by Russell +Fulton E<lt>r.f...@au...E<gt>. =head1 AUTHOR Graham Barr E<lt>gb...@po...E<gt> -Please report any bugs, or post any suggestions, to the perl-ldap mailing list -E<lt>per...@pe...E<gt>. +Please report any bugs, or post any suggestions, to the perl-ldap +mailing list E<lt>per...@pe...E<gt>. =head1 COPYRIGHT -Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program is -free software; you can redistribute it and/or modify it under the same -terms as Perl itself. +Copyright (c) 1997-2000 Graham Barr. All rights reserved. This program +is free software; you can redistribute it and/or modify it under the +same terms as Perl itself. =for html <hr> |
From: Graham B. <gb...@us...> - 2003-07-09 20:27:35
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Control In directory sc8-pr-cvs1:/tmp/cvs-serv2217/lib/Net/LDAP/Control Modified Files: SortResult.pm Log Message: Add $VERSION Index: SortResult.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Control/SortResult.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SortResult.pm 7 May 2003 11:56:48 -0000 1.6 +++ SortResult.pm 9 Jul 2003 20:27:32 -0000 1.7 @@ -8,6 +8,7 @@ use Net::LDAP::ASN qw(SortResult); use Net::LDAP::Control; +$VERSION = "0.01"; @ISA = qw(Net::LDAP::Control); sub init { |
From: Graham B. <gb...@us...> - 2003-07-09 20:27:35
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Extension In directory sc8-pr-cvs1:/tmp/cvs-serv2217/lib/Net/LDAP/Extension Modified Files: SetPassword.pm Log Message: Add $VERSION Index: SetPassword.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Extension/SetPassword.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SetPassword.pm 18 Jul 2002 12:58:39 -0000 1.1 +++ SetPassword.pm 9 Jul 2003 20:27:32 -0000 1.2 @@ -3,6 +3,7 @@ require Net::LDAP::Extension; +$VERSION = "0.01"; @ISA = qw(Net::LDAP::Extension); use Convert::ASN1; |
From: Kartik S. <kar...@us...> - 2003-06-24 21:59:01
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv18847 Modified Files: ldifdiff.pl Log Message: Added options to specify DN attributes, as well as "shared" attributes. Converted to Getopt::Long. Index: ldifdiff.pl =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/ldifdiff.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ldifdiff.pl 3 Nov 2002 01:47:45 -0000 1.2 +++ ldifdiff.pl 24 Jun 2003 21:58:58 -0000 1.3 @@ -13,29 +13,41 @@ =head1 SYNOPSIS -ldifdiff.pl B<-k keyattr> [B<-a attr1,attr2,...>] [B<-c attr1,attr2,...>] B<sourcefile> B<targetfile> +ldifdiff.pl B<-k|--keyattr keyattr> [B<-a|--sourceattrs attr1,attr2,...>] [B<-c|--ciscmp attr1,...>] [B<--dnattrs attr1,...>] [B<--sharedattrs attr1,...>] B<sourcefile> B<targetfile> =head1 OPTIONS =over 4 -=item B<-k> keyattr +=item B<-k|--keyattr> keyattr Specifies the key attribute to use when comparing source and target entries. Entries in both LDIF files must be sorted by this attribute for comparisons to be meaningful. F<ldifsort.pl> can be used to sort LDIF files by a given attribute. -=item B<-a attr1,attr2,...> +=item B<-a|--sourceattrs attr1,attr2,...> (Optional) Specifies a list of attributes to consider when comparing source and target entries. By default, all attributes are considered. -=item B<-c attr1,attr2,...> +=item B<-c|--ciscmp attr1,...> (Optional) Compare values of the specified attributes case-insensitively. By default, comparisons are case-sensitive. +=item B<--dnattrs attr1,...> + +(Optional) Specifies a list of attributes to be treated as DNs when being +compared. The default set is manager, member, owner and uniqueMember. + +=item B<--sharedattrs attr1,...> + +(Optional) Specifies a list of attribues to be treated as "shared" attributes, +where the source may not be a sole authoritative source. When modifying +these attributes, separate "delete" and "add" LDIF changes are generated, +instead of a single "replace" change. The default set is objectClass. + =item B<sourcefile> Specifies the source LDIF file. @@ -51,17 +63,25 @@ use Net::LDAP; use Net::LDAP::LDIF; use Net::LDAP::Util qw(canonical_dn); -use Getopt::Std; +use Getopt::Long; use strict; -my %args; -getopts("a:c:k:", \%args); - -my $keyattr = $args{k}; -my @sourceattrs = split(/,/, $args{a}); -my %ciscmp = (objectclass => 1, manager => 1, owner => 1, uniquemember => 1); -foreach (split(/,/, $args{c})) { $ciscmp{$_} = 1 } +my @sourceattrs; +my (%ciscmp, %dnattrs, %sharedattrs); +my $keyattr; +GetOptions('a|sourceattrs=s' => sub { @sourceattrs = split(/,/, $_[1]) }, + 'c|ciscmp=s' => sub { my @a = split(/,/,$_[1]); @ciscmp{@a} = (1) x @a }, + 'dnattrs=s' => sub { my @a = split(/,/,$_[1]); @dnattrs{@a} = (1) x @a }, + 'k|keyattr=s' => \$keyattr, + 'sharedattrs=s' => sub { my @a=split(/,/,$_[1]); @sharedattrs{@a}=(1)x @a } + ); +%ciscmp = (objectclass => 1, manager => 1, owner => 1, uniquemember => 1) + unless keys %ciscmp; +%dnattrs = (manager => 1, member => 1, owner => 1, uniquemember => 1) + unless keys %dnattrs; +%sharedattrs = (objectclass => 1) + unless keys %sharedattrs; my ($sourcefile, $targetfile); @@ -189,8 +209,6 @@ my ($source, $target, @attrs) = @_; my ($attr, $val, $ldifstr); - my %sharedattrs = (objectclass => 1); - unless (@attrs) { # add all source entry attributes @attrs = $source->attributes; @@ -211,13 +229,19 @@ my @sourcevals = $source->get_value($attr); my @targetvals = $target->get_value($attr); my (%sourceuniqvals, %targetuniqvals); - if ($ciscmp{$lcattr}) { - @sourceuniqvals{map { lc($_) } @sourcevals} = (); - @targetuniqvals{map { lc($_) } @targetvals} = (); + foreach (@sourcevals) { + my $val = $_; + $val = lc $val if $ciscmp{$lcattr}; + # Get rid of spaces after non-escaped commas in DN attrs + $val =~ s/(?<!\\),\s+/,/g if $dnattrs{$lcattr}; + $sourceuniqvals{$val} = undef; } - else { - @sourceuniqvals{@sourcevals} = (); - @targetuniqvals{@targetvals} = (); + foreach (@targetvals) { + my $val = $_; + $val = lc $val if $ciscmp{$lcattr}; + # Get rid of spaces after non-escaped commas in DN attrs + $val =~ s/(?<!\\),\s+/,/g if $dnattrs{$lcattr}; + $targetuniqvals{$val} = undef; } foreach my $val (keys %sourceuniqvals) { if (exists $targetuniqvals{$val}) { @@ -234,6 +258,11 @@ # For 'shared' attributes (e.g. objectclass) where $source may not # be a sole authoritative source, we issue separate delete and # add modifications instead of a single replace. + # + # Note: this issues deletes/adds for the canonicalized versions of + # values rather than the original values themselves, since the + # canonicalized versions are readily available in a hash, whereas + # the original versions are in a linear array. $target->delete($attr => [ keys(%targetuniqvals) ]) if keys(%targetuniqvals); $target->add($attr => [ keys(%sourceuniqvals) ]) |
From: Kartik S. <kar...@us...> - 2003-06-24 21:58:37
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv18819 Modified Files: ldifsort.pl Log Message: Added option to sort attributes within each entry. Index: ldifsort.pl =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/ldifsort.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ldifsort.pl 3 Jul 2001 19:30:02 -0000 1.1 +++ ldifsort.pl 24 Jun 2003 21:58:34 -0000 1.2 @@ -13,7 +13,7 @@ =head1 SYNOPSIS -ldifsort.pl B<-k keyattr> [B<-nd>] file.ldif +ldifsort.pl B<-k keyattr> [B<-and>] file.ldif =over 4 @@ -23,6 +23,12 @@ specified, sorting is done by the full DN string, which can be composed of different attributes for different entries. +=item B<-a> + +Specifies that attributes within a given entry should also be sorted. This +has the side effect of removing all comments and line continuations in the +LDIF file. + =item B<-n> Specifies numeric comparisons on the key attribute. Otherwise string @@ -51,9 +57,10 @@ use strict; my %args; -getopts("k:nd", \%args); +getopts("k:and", \%args); my $keyattr = $args{k}; +my $sortattrs = $args{a}; my $ldiffile = $ARGV[0]; die "usage: $0 -k keyattr [-n] [-d] ldiffile\n" @@ -96,7 +103,14 @@ foreach my $valuepos (@sorted) { seek(LDIFH, $valuepos->[1], 0); my $entry = <LDIFH>; - print $entry; - print "\n" if $entry !~ /\n\n$/; + if ($sortattrs) { + $entry =~ s/\n //mg; # collapse line continuations + my @lines = grep(!/^#/, split(/\n/, $entry)); + my $dn = shift(@lines); + print "$dn\n", join("\n", sort @lines), "\n\n"; + } + else { + print $entry; + print "\n" if $entry !~ /\n\n$/; + } } - |
From: Chris R. <chr...@us...> - 2003-06-24 12:06:41
|
Update of /cvsroot/perl-ldap/website In directory sc8-pr-cvs1:/tmp/cvs-serv24167 Modified Files: index.html Log Message: Updated for 0.29 release Index: index.html =================================================================== RCS file: /cvsroot/perl-ldap/website/index.html,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- index.html 20 May 2003 15:05:40 -0000 1.41 +++ index.html 24 Jun 2003 12:06:36 -0000 1.42 @@ -51,8 +51,8 @@ </div> <div class="section"> <h2>Distribution</h2> - <p>The latest (May 2003) release of the library is <a href= - "http://prdownloads.sourceforge.net/perl-ldap/perl-ldap-0.28.tar.gz"> perl-ldap-0.28</a>. + <p>The latest (June 2003) release of the library is <a href= + "http://prdownloads.sourceforge.net/perl-ldap/perl-ldap-0.29.tar.gz"> perl-ldap-0.29</a>. You may also <a href= "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-ldap/ldap/">look at the individual files</a> in the CVS repository and the <a href= |
From: Graham B. <gb...@us...> - 2003-06-24 10:18:38
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv10550/lib/Net Modified Files: LDAP.pm Log Message: Release 0.29 Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- LDAP.pm 13 Jun 2003 10:11:47 -0000 1.55 +++ LDAP.pm 24 Jun 2003 10:18:35 -0000 1.56 @@ -27,7 +27,7 @@ LDAP_UNAVAILABLE ); -$VERSION = "0.28_01"; +$VERSION = "0.29"; @ISA = qw(Tie::StdHash Net::LDAP::Extra); $LDAP_VERSION = 3; # default LDAP protocol version |
From: Graham B. <gb...@us...> - 2003-06-24 10:18:38
|
Update of /cvsroot/perl-ldap/ldap In directory sc8-pr-cvs1:/tmp/cvs-serv10550 Modified Files: ChangeLog RELEASE_NOTES Log Message: Release 0.29 Index: ChangeLog =================================================================== RCS file: /cvsroot/perl-ldap/ldap/ChangeLog,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ChangeLog 19 May 2003 22:37:14 -0000 1.29 +++ ChangeLog 24 Jun 2003 10:18:35 -0000 1.30 @@ -1,3 +1,111 @@ +2003-06-23 13:52 Chris Ridd + + * lib/Net/LDAP.pod: + + Revamp to improve style and consistency (maybe) + +2003-06-18 19:23 Graham Barr + + * contrib/jpegDisplay.pl, contrib/jpegLoad.pl, contrib/tklkup, + lib/Net/LDAP/Examples.pod, lib/Net/LDAP/FAQ.pod: + + Remove all references to :all as it is not recomended + +2003-06-16 15:45 Chris Ridd + + * lib/Net/LDAP/FAQ.pod: + + Added a bit about accented characters + +2003-06-13 11:11 Graham Barr + + * lib/Net/LDAP.pm: + + Work-a-round a bug in IO::Socket::SSL where it leaves the socket + blessed into IO::Socket::SSL when socket_to_SSL fails + +2003-06-09 13:47 Graham Barr + + * MANIFEST, Makefile.PL, mkmanf, t/0-signature.t: + + Add a SIGNATURE to the distribution + +2003-06-09 13:31 Graham Barr + + * bin/: ldapdelete.PL, ldapmodrdn.PL, ldapsearch.PL: + + Remove *.PL scripts + +2003-06-09 13:29 Graham Barr + + * MANIFEST, Makefile.PL, bin/ldapdelete, bin/ldapmodrdn, + bin/ldapsearch: + + Depend in MakeMaker to fixup the #! line of installed scripts + +2003-06-09 13:04 Graham Barr + + * MANIFEST: + + Add refloop test to MANIFEST + +2003-06-06 23:47 Graham Barr + + * lib/Net/LDAP.pm, lib/Net/LDAP/Message.pm, t/04refloop.t: + + Fix reference loop problem by hiding the real object behind a tied + hash and only using the inner hash internally and the outer hash + externally + +2003-06-02 16:13 Graham Barr + + * lib/Net/LDAP/Constant.pm: + + Support :all to export all constants (not recoomended but for backwards complatability) + +2003-05-23 08:07 Chris Ridd + + * lib/Net/LDAP.pod: + + Minor typo in modify:add description + +2003-05-22 13:32 Chris Ridd + + * lib/Net/LDAP/FAQ.pod: + + Use ->new for all constructor examples + +2003-05-22 13:16 Chris Ridd + + * lib/Net/: LDAP.pod, LDAPI.pm, LDAPS.pm: + + Use ->new for all constructor examples + +2003-05-22 10:24 Chris Ridd + + * lib/Net/: LDAP.pod, LDAPI.pm, LDAPS.pm: + + Moved guts of LDAP[SI] doc into LDAP.pod + +2003-05-21 09:10 Graham Barr + + * MANIFEST, t/03schema.t, t/53schema.t: + + Rename the existing schema test to 03schema.t as it does not require a server. + Add new 53schema.t which obtains a schema from a server + +2003-05-20 15:58 Chris Ridd + + * lib/Net/LDAP/: Constant.pm, Util.pm: + + Extended ldap_error_name, ldap_error_text and ldap_error_desc to take Message args + +2003-05-20 15:56 Chris Ridd + + * lib/Net/LDAP/: Message.pm, Message.pod: + + Added error_name, error_text and error_desc methods + 2003-05-19 23:36 Graham Barr * RELEASE_NOTES, lib/Net/LDAP.pm: @@ -98,12 +206,6 @@ New script to create MANIFEST from CVS files -2003-05-08 20:41 Graham Barr - - * .cvsignore: - - Add .cvsignore file - 2003-05-08 20:40 Graham Barr * t/70sortctrl.t: @@ -953,9 +1055,9 @@ Add Kartik Subbarao and Norbert Klasen -2002-05-28 09:34 Graham Barr +2002-05-28 09:35 Graham Barr - * htdocs/index.xml, mkhtml, mkindex: + * mkhtml, mkindex: No longer including html generated from POD in the distribution @@ -973,7 +1075,7 @@ 2002-05-28 08:52 Graham Barr - * lib/Net/LDAP/: DSML/Parser.pm, DSML.pm: + * lib/Net/LDAP/DSML.pm: New DSML module that uses XML::SAX @@ -1032,9 +1134,7 @@ 2002-02-18 16:51 Graham Barr - * MANIFEST, Makefile.PL, htdocs/index.xml, lib/Authen/SASL.pm, - lib/Authen/SASL.pod, lib/Authen/SASL/CRAM_MD5.pm, - lib/Authen/SASL/EXTERNAL.pm, lib/Net/LDAP.pm, lib/Net/LDAP/Bind.pm: + * MANIFEST, Makefile.PL, lib/Net/LDAP.pm, lib/Net/LDAP/Bind.pm: Change over to using Authen::SASL v2.00, which is now distributed in a separate distribution @@ -1261,7 +1361,7 @@ 2001-10-24 15:37 Graham Barr - * MANIFEST, htdocs/index.html, htdocs/index.xml: + * MANIFEST: Add the new Security pod to the index page @@ -1313,12 +1413,6 @@ Output LDIF change commands correctly -2001-10-08 08:49 Chris Ridd - - * lib/Authen/SASL/EXTERNAL.pm: - - New module - 2001-10-05 15:36 Graham Barr * lib/Net/LDAP/: Entry.pm, Entry.pod: @@ -1448,14 +1542,13 @@ 2001-08-24 20:31 Graham Barr - * lib/: Authen/SASL.pod, Net/LDAP.pod, Net/LDAPS.pm, - Net/LDAP/Constant.pod, Net/LDAP/Control.pm, Net/LDAP/DSML.pm, - Net/LDAP/Entry.pod, Net/LDAP/FAQ.pod, Net/LDAP/Filter.pod, - Net/LDAP/LDIF.pod, Net/LDAP/Message.pod, Net/LDAP/Reference.pod, - Net/LDAP/Schema.pod, Net/LDAP/Search.pod, - Net/LDAP/Control/Paged.pm, Net/LDAP/Control/ProxyAuth.pm, - Net/LDAP/Control/Sort.pm, Net/LDAP/Control/SortResult.pm, - Net/LDAP/Control/VLV.pm, Net/LDAP/Control/VLVResponse.pm: + * lib/Net/: LDAP.pod, LDAPS.pm, LDAP/Constant.pod, LDAP/Control.pm, + LDAP/DSML.pm, LDAP/Entry.pod, LDAP/FAQ.pod, LDAP/Filter.pod, + LDAP/LDIF.pod, LDAP/Message.pod, LDAP/Reference.pod, + LDAP/Schema.pod, LDAP/Search.pod, LDAP/Control/Paged.pm, + LDAP/Control/ProxyAuth.pm, LDAP/Control/Sort.pm, + LDAP/Control/SortResult.pm, LDAP/Control/VLV.pm, + LDAP/Control/VLVResponse.pm: Fix pods for links generated by pod2html @@ -1483,12 +1576,6 @@ Perl special variable that knows what platform the perl code was compiled on. -2001-08-21 18:03 Graham Barr - - * htdocs/index.html: - - Doc updates - 2001-08-17 17:20 Graham Barr * t/53schema.t: @@ -1879,9 +1966,8 @@ 2001-04-10 17:30 Graham Barr - * MANIFEST, htdocs/index.xml, lib/Net/LDAP/ASN.pm, - lib/Net/LDAP/Constant.pm, lib/Net/LDAP/Control.pm, - lib/Net/LDAP/Control/ProxyAuth.pm: + * MANIFEST, lib/Net/LDAP/ASN.pm, lib/Net/LDAP/Constant.pm, + lib/Net/LDAP/Control.pm, lib/Net/LDAP/Control/ProxyAuth.pm: Add Net::LDAP::Control::ProxyAuth from Olivier Dubois @@ -2009,12 +2095,6 @@ Skip CVS files -2001-02-12 14:22 Graham Barr - - * htdocs/index.xml: - - XML source for docs index - 2001-02-12 14:17 Graham Barr * lib/Net/: LDAP.pm, LDAP.pod, LDAP/Schema.pm, LDAP/Schema.pod: @@ -2145,10 +2225,9 @@ data/51a-cmp.ldif, data/51b-cmp.ldif, data/51c-cmp.ldif, data/51d-cmp.ldif, data/52-cmp.ldif, data/52-in.ldif, data/52-mod.ldif, data/schema.in, data/slapd-conf.in, - data/slapd.at.conf, data/slapd.oc.conf, lib/Authen/SASL.pm, - lib/Authen/SASL.pod, lib/Authen/SASL/CRAM_MD5.pm, - lib/Bundle/Net/LDAP.pm, lib/LWP/Protocol/ldap.pm, lib/Net/LDAP.pm, - lib/Net/LDAP.pod, lib/Net/LDAP/ASN.pm, lib/Net/LDAP/Bind.pm, + data/slapd.at.conf, data/slapd.oc.conf, lib/Bundle/Net/LDAP.pm, + lib/LWP/Protocol/ldap.pm, lib/Net/LDAP.pm, lib/Net/LDAP.pod, + lib/Net/LDAP/ASN.pm, lib/Net/LDAP/Bind.pm, lib/Net/LDAP/Constant.pm, lib/Net/LDAP/Constant.pod, lib/Net/LDAP/Control.pm, lib/Net/LDAP/Entry.pm, lib/Net/LDAP/Entry.pod, lib/Net/LDAP/Examples.pod, Index: RELEASE_NOTES =================================================================== RCS file: /cvsroot/perl-ldap/ldap/RELEASE_NOTES,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- RELEASE_NOTES 19 May 2003 22:36:10 -0000 1.13 +++ RELEASE_NOTES 24 Jun 2003 10:18:35 -0000 1.14 @@ -1,3 +1,12 @@ +perl-ldap 0.29 24 Jun 2003 +========================== + +* Workaround bug in IO::Socket::SSL when startTLS fails +* Fix reference loop memory leak problem +* Add a SIGNATURE to the distribution +* Re-added support for :all in the import list to get all constants +* New methods error_name, error_text, error_desc added to Message.pm + perl-ldap 0.28 19 May 2003 ========================== |
From: Chris R. <chr...@us...> - 2003-06-23 12:52:28
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv18740 Modified Files: LDAP.pod Log Message: Revamp to improve style and consistency (maybe) Index: LDAP.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pod,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- LDAP.pod 23 May 2003 07:07:31 -0000 1.32 +++ LDAP.pod 23 Jun 2003 12:52:24 -0000 1.33 @@ -6,48 +6,49 @@ use Net::LDAP; - $ldap = Net::LDAP->new('ldap.bigfoot.com') or die "$@"; + $ldap = Net::LDAP->new( 'ldap.bigfoot.com' ) or die "$@"; - $ldap->bind ; # an anonymous bind + $mesg = $ldap->bind ; # an anonymous bind - $mesg = $ldap->search ( # perform a search + $mesg = $ldap->search( # perform a search [...1135 lines suppressed...] =over 4 -=item type +=item type =E<gt> OID This element must be present and is the name of the type of control being requested. -=item critical +=item critical =E<gt> FLAG critical is optional and should be a boolean value, if it is not specified then it is assumed to be I<false>. -=item value +=item value =E<gt> VALUE If the control being requested requires a value then this element should hold the value for the server. |
From: Graham B. <gb...@us...> - 2003-06-18 18:23:34
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv5454/lib/Net/LDAP Modified Files: Examples.pod FAQ.pod Log Message: Remove all references to :all as it is not recomended Index: Examples.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Examples.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Examples.pod 7 May 2003 10:59:12 -0000 1.6 +++ Examples.pod 18 Jun 2003 18:23:31 -0000 1.7 @@ -52,7 +52,7 @@ =head2 PACKAGE - Definitions - use Net::LDAP qw(:all); # use for all code + use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text) ; # use for Error handling Index: FAQ.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/FAQ.pod,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- FAQ.pod 16 Jun 2003 14:45:50 -0000 1.31 +++ FAQ.pod 18 Jun 2003 18:23:31 -0000 1.32 @@ -1106,7 +1106,7 @@ this requires the Win32::Perms module, and needs valid NT account info to replace the placeholders. - use Net::LDAP qw(:all); + use Net::LDAP; use Net::LDAP::Util; use Win32::Perms; |
From: Graham B. <gb...@us...> - 2003-06-18 18:23:34
|
Update of /cvsroot/perl-ldap/ldap/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv5454/contrib Modified Files: jpegDisplay.pl jpegLoad.pl tklkup Log Message: Remove all references to :all as it is not recomended Index: jpegDisplay.pl =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/jpegDisplay.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jpegDisplay.pl 12 Mar 2001 14:01:46 -0000 1.1 +++ jpegDisplay.pl 18 Jun 2003 18:23:31 -0000 1.2 @@ -15,6 +15,9 @@ # # Revisions: # $Log$ +# Revision 1.2 2003/06/18 18:23:31 gbarr +# Remove all references to :all as it is not recomended +# # Revision 1.1 2001/03/12 14:01:46 gbarr # New contrib scripts from Clif Harden # @@ -25,7 +28,7 @@ use Getopt::Std; use Net::LDAP; use Net::LDAP::Filter; -use Net::LDAP qw(:all); +use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); use Tk; use Tk::JPEG; Index: jpegLoad.pl =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/jpegLoad.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jpegLoad.pl 12 Mar 2001 14:01:46 -0000 1.1 +++ jpegLoad.pl 18 Jun 2003 18:23:31 -0000 1.2 @@ -15,6 +15,9 @@ # # Revisions: # $Log$ +# Revision 1.2 2003/06/18 18:23:31 gbarr +# Remove all references to :all as it is not recomended +# # Revision 1.1 2001/03/12 14:01:46 gbarr # New contrib scripts from Clif Harden # @@ -26,7 +29,7 @@ use Getopt::Std; use Net::LDAP; use Net::LDAP::Filter; -use Net::LDAP qw(:all); +use Net::LDAP; use Net::LDAP::Util qw( ldap_error_name ldap_error_text ); use Net::LDAP::Constant; Index: tklkup =================================================================== RCS file: /cvsroot/perl-ldap/ldap/contrib/tklkup,v retrieving revision 2.28 retrieving revision 2.29 diff -u -d -r2.28 -r2.29 --- tklkup 12 Mar 2003 02:19:06 -0000 2.28 +++ tklkup 18 Jun 2003 18:23:31 -0000 2.29 @@ -27,7 +27,7 @@ use Carp; use Data::Dumper; use MIME::Base64; -use Net::LDAP qw(:all); +use Net::LDAP; use Net::LDAP::Filter; use Net::LDAP::Util qw( ldap_explode_dn ldap_error_name ldap_error_text); use Net::LDAP::Constant; |
From: Chris R. <chr...@us...> - 2003-06-16 14:45:54
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv31474 Modified Files: FAQ.pod Log Message: Added a bit about accented characters Index: FAQ.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/FAQ.pod,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- FAQ.pod 22 May 2003 12:32:13 -0000 1.30 +++ FAQ.pod 16 Jun 2003 14:45:50 -0000 1.31 @@ -222,6 +222,19 @@ is not permitted by the directory, because jpegPhotos may only contain JPEG-formatted images. +Most syntaxes used in LDAP however describe text strings rather than +binary objects (like JPEGs or certificates.) + +In LDAPv3 most of these syntaxes support Unicode encoded using +UTF-8. Because the Net::LDAP modules do not change the strings that +you pass in as attribute values (they get sent to the LDAP server +as-is) to use accented characters you simply need to encode your +strings in UTF-8. There are modules on CPAN that will help you here. + +Note that LDAPv2 servers used something called T.61 instead of Unicode +and UTF-8. Most servers do not implement T.61 correctly, and it is +recommended that you use LDAPv3 instead. + Attributes may also be searched. The algorithms used to perform different kinds of searches are described by the attribute's 'matching rules'. Some matching rules are case-sensitive and some are |
From: Graham B. <gb...@us...> - 2003-06-13 10:11:50
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv18818/lib/Net Modified Files: LDAP.pm Log Message: Work-a-round a bug in IO::Socket::SSL where it leaves the socket blessed into IO::Socket::SSL when socket_to_SSL fails Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- LDAP.pm 6 Jun 2003 22:47:13 -0000 1.54 +++ LDAP.pm 13 Jun 2003 10:11:47 -0000 1.55 @@ -942,9 +942,19 @@ $arg->{sslversion} = 'tlsv1' unless defined $arg->{sslversion}; IO::Socket::SSL::context_init( { _SSL_context_init_args($arg) } ); - IO::Socket::SSL::socketToSSL($sock, {_SSL_context_init_args($arg)}) - ? $mesg - : _error($ldap, $mesg, LDAP_OPERATIONS_ERROR, $@); + my $sock_class = ref($sock); + + return $mesg + if IO::Socket::SSL::socketToSSL($sock, {_SSL_context_init_args($arg)}); + + my $err = $@; + + if ($sock_class ne ref($sock)) { + $err = $sock->errstr; + bless $sock, $sock_class; + } + + _error($ldap, $mesg, LDAP_OPERATIONS_ERROR, $err); } sub cipher { |
From: Graham B. <gb...@us...> - 2003-06-13 09:41:49
|
Update of /cvsroot/perl-ldap/ldap In directory sc8-pr-cvs1:/tmp/cvs-serv7060 Modified Files: .cvsignore Log Message: ignore the SIGNATURE file Index: .cvsignore =================================================================== RCS file: /cvsroot/perl-ldap/ldap/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 8 May 2003 19:41:16 -0000 1.1 +++ .cvsignore 13 Jun 2003 09:41:46 -0000 1.2 @@ -6,3 +6,4 @@ pm_to_blib temp ? +SIGNATURE |
From: Graham B. <gb...@us...> - 2003-06-09 12:47:50
|
Update of /cvsroot/perl-ldap/ldap In directory sc8-pr-cvs1:/tmp/cvs-serv6192 Modified Files: MANIFEST Makefile.PL mkmanf Log Message: Add a SIGNATURE to the distribution Index: MANIFEST =================================================================== RCS file: /cvsroot/perl-ldap/ldap/MANIFEST,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- MANIFEST 9 Jun 2003 12:29:40 -0000 1.26 +++ MANIFEST 9 Jun 2003 12:47:46 -0000 1.27 @@ -6,6 +6,7 @@ OldChanges README RELEASE_NOTES +SIGNATURE TODO bin/ldapdelete bin/ldapmodrdn @@ -85,6 +86,7 @@ lib/Net/LDAPI.pm lib/Net/LDAPS.pm mkmanf +t/0-signature.t t/00ldif-entry.t t/01canon_dn.t t/02filter.t Index: Makefile.PL =================================================================== RCS file: /cvsroot/perl-ldap/ldap/Makefile.PL,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.PL 9 Jun 2003 12:29:41 -0000 1.12 +++ Makefile.PL 9 Jun 2003 12:47:46 -0000 1.13 @@ -112,6 +112,11 @@ distdir : run_mkmanf +distdir : run_cpansign + +run_cpansign : + cpansign -s + EOS } Index: mkmanf =================================================================== RCS file: /cvsroot/perl-ldap/ldap/mkmanf,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mkmanf 8 May 2003 19:41:49 -0000 1.4 +++ mkmanf 9 Jun 2003 12:47:46 -0000 1.5 @@ -1,8 +1,10 @@ #!/bin/sh -find . -name Entries \ -| egrep /CVS/Entries$ \ -| xargs perl -aF/ -lne 'print substr($ARGV,2,-11),$F[1] if m,^/, and $F[2] !~ /^-/ and $F[1] !~ /^\./;' -- \ -| sort -u > MANIFEST.new +( + echo SIGNATURE + find . -name Entries \ + | egrep /CVS/Entries$ \ + | xargs perl -aF/ -lne 'print substr($ARGV,2,-11),$F[1] if m,^/, and $F[2] !~ /^-/ and $F[1] !~ /^\./;' -- +) | sort -u > MANIFEST.new diff -u MANIFEST MANIFEST.new && rm MANIFEST.new |