Skip to content
Browse files

*** empty log message ***

  • Loading branch information...
1 parent f7a6d6a commit e9c5ec712fb889bbd0dc3012fd9f848746e6b3d0 @gbarr gbarr committed May 4, 2000
Showing with 64 additions and 17 deletions.
  1. +18 −0 ChangeLog
  2. +20 −8 lib/Net/LDAP.pm
  3. +5 −3 lib/Net/LDAP.pod
  4. +15 −5 lib/Net/LDAP/Schema.pm
  5. +6 −1 lib/Net/LDAP/Schema.pod
View
18 ChangeLog
@@ -1,3 +1,21 @@
+Change 507 on 2000/05/03 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::LDAP
+ - Check return value of asn_recv for defined not truth
+ as on some systems the return value may be ''
+
+Change 506 on 2000/05/03 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::LDAP::Schema (patch from Chris Ridd)
+ - Fix sup to always be an array ref
+ - add ->superclasses() method
+
+Change 505 on 2000/05/03 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::LDAP
+ - Fix bug in ->unbind() where $mesg was not being passed to _sendmsg()
+ - Added debug values 4 and 8 to dump with asn_dump()
+
Change 496 on 2000/04/27 by <gbarr@pobox.com> (Graham Barr)
Release 0.16
View
28 lib/Net/LDAP.pm
@@ -21,7 +21,7 @@ use Net::LDAP::Constant qw(LDAP_SUCCESS
LDAP_PARAM_ERROR
);
-$VERSION = "0.16";
+$VERSION = "0.16_01";
$LDAP_VERSION = 2; # default LDAP protocol version
@@ -138,13 +138,13 @@ sub unbind {
controls => $arg->{control}
) or return $mesg->set_error(LDAP_ENCODING_ERROR,"$@");
- $ldap->_sendmesg();
+ $ldap->_sendmesg($mesg);
}
sub ldapbind {
require Carp;
- Carp::carp("->ldapbind depricated, use ->bind") if $^W;
+ Carp::carp("->ldapbind deprecated, use ->bind") if $^W;
goto &bind;
}
@@ -527,10 +527,16 @@ sub _sendmesg {
my $ldap = shift;
my $mesg = shift;
- if ($ldap->debug & 1) {
+ my $debug;
+ if ($debug = $ldap->debug) {
require Convert::ASN1::Debug;
print STDERR "$ldap sending:\n";
- Convert::ASN1::asn_hexdump(*STDERR, $mesg->pdu);
+
+ Convert::ASN1::asn_hexdump(*STDERR, $mesg->pdu)
+ if $debug & 1;
+
+ Convert::ASN1::asn_dump(*STDERR, $mesg->pdu)
+ if $debug & 4;
}
send($ldap->socket, $mesg->pdu, 0)
@@ -562,13 +568,19 @@ sub _recvresp {
for( $ready = 1 ; $ready ; $ready = $sel->can_read(0)) {
my $pdu;
- asn_recv($sock, $pdu, 0)
+ defined asn_recv($sock, $pdu, 0)
or return LDAP_OPERATIONS_ERROR;
- if ($ldap->debug & 2) {
+ my $debug;
+ if ($debug = $ldap->debug) {
require Convert::ASN1::Debug;
print STDERR "$ldap received:\n";
- Convert::ASN1::asn_hexdump(\*STDERR,$pdu);
+
+ Convert::ASN1::asn_hexdump(\*STDERR,$pdu)
+ if $debug & 2;
+
+ Convert::ASN1::asn_dump(\*STDERR,$pdu)
+ if $debug & 8;
}
my $result = $LDAPResponse->decode($pdu)
View
8 lib/Net/LDAP.pod
@@ -77,8 +77,10 @@ Timeout passed to L<IO::Socket|IO::Socket> when connecting the remote server.
If passed a non-zero value then debug data will be sent to C<STDERR>. The
bits of this value are :-
- 1 Show outgoing packets.
- 2 Show incoming packets.
+ 1 Show outgoing packets (using asn_hexdump).
+ 2 Show incoming packets (using asn_hexdump).
+ 4 Show outgoing packets (using asn_dump).
+ 8 Show incoming packets (using asn_dump).
=item async
@@ -634,6 +636,6 @@ terms as Perl itself.
=for html <hr>
-I<$Id: LDAP.pod,v 1.1 2000/05/03 12:29:03 gbarr Exp $>
+I<$Id: LDAP.pod,v 1.2 2000/05/04 08:42:45 gbarr Exp $>
=cut
View
20 lib/Net/LDAP/Schema.pm
@@ -130,15 +130,25 @@ sub syntax
my $syntax = $self->{oid}->{$oid}->{syntax};
unless( $syntax ) {
my @sup = @{$self->{oid}->{$oid}->{sup}};
- foreach my $sup ( @sup ) {
- $syntax = $self->syntax( $sup ); # Hope there are no loops
- last if $syntax; # What would multi-syntax mean?
- }
+ $syntax = $self->syntax( $sup[0] );
}
return $syntax;
}
+sub superclass
+{
+ my $self = shift;
+ my $oc = shift;
+
+ my $oid = $self->is_objectclass( $oc );
+ return undef unless $oid;
+
+ my $res = $self->{oid}->{$oid}->{sup};
+ return undef unless $res;
+ return wantarray() ? @$res : $res;
+}
+
sub must
{
my $self = shift;
@@ -593,7 +603,7 @@ sub _fixup_entry
# Store some items as array refs always, for simpler code
# Note - 'name' is made scalar later in this function
#
- foreach my $item_type ( qw( name must may ) ) {
+ foreach my $item_type ( qw( name must may sup ) ) {
my $item = $schema_entry->{$item_type};
if( $item && !ref $item ) {
$schema_entry->{$item_type} = [ $item ];
View
7 lib/Net/LDAP/Schema.pod
@@ -55,6 +55,11 @@ Returns a list of the names of all objectclasses in the schema.
Return value is an array or array reference depending on calling context.
+=item superclass
+
+Given an argument which is the name or oid of a known objectclass, returns
+the list of names of the immediate superclasses.
+
=item syntaxes
Returns a list of the names of all objectclasses in the schema. (The name of
@@ -131,6 +136,6 @@ terms as Perl itself.
=for html <hr>
-I<$Id: Schema.pod,v 1.1 2000/05/03 12:29:17 gbarr Exp $>
+I<$Id: Schema.pod,v 1.2 2000/05/04 08:42:45 gbarr Exp $>
=cut

0 comments on commit e9c5ec7

Please sign in to comment.
Something went wrong with that request. Please try again.