Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarr committed May 4, 2000
1 parent f7a6d6a commit e9c5ec7
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 17 deletions.
18 changes: 18 additions & 0 deletions 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
Expand Down
28 changes: 20 additions & 8 deletions lib/Net/LDAP.pm
Expand Up @@ -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

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions lib/Net/LDAP.pod
Expand Up @@ -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

Expand Down Expand Up @@ -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
20 changes: 15 additions & 5 deletions lib/Net/LDAP/Schema.pm
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ];
Expand Down
7 changes: 6 additions & 1 deletion lib/Net/LDAP/Schema.pod
Expand Up @@ -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
Expand Down Expand Up @@ -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.