Imported Upstream version 0.4300
gregor herrmann
12 years ago
0 | 0.43 -- Sat Sep 3 12:50:49 CDT 2011 | |
1 | ||
2 | * Fix copy & paste errors in Net::LDAP::Message | |
3 | ||
4 | 0.42 -- Sat Sep 3 07:46:06 CDT 2011 | |
5 | ||
6 | * Check whether LDAP socket object has a peerhost() method defined before calling it. This fixes SASL authentication over UNIX domain (ldapi://) sockets. [Chris Mikkelson] | |
7 | ||
8 | 0.41 -- Sat Sep 3 07:37:31 CDT 2011 | |
9 | ||
10 | * use of non-localised $_ in Net::LDAP::Constant causes prolems in lemonldap-ng [Damyan Ivanov] | |
11 | * Added cn,o,ou to the default set of case-insensitive attributes [Kartik Subbarao] | |
12 | * Entry.pod: fix typos [Peter Marschall] | |
13 | * extend Net::LDAP::Entry->update() to take LDIF objects [Peter Marschall] | |
14 | * Specify that we want to use the 'ldap' scheme to verify certificates. [Kevan Carstensen] | |
15 | ||
0 | 16 | 0.4001 -- Wed Mar 24 14:54:35 CDT 2010 |
1 | 17 | |
2 | 18 | * Update Module::Install and generate META.yml |
110 | 110 | Makefile.PL |
111 | 111 | MANIFEST This list of files |
112 | 112 | MANIFEST.SKIP |
113 | META.yml | |
114 | 113 | README |
115 | 114 | SIGNATURE |
116 | 115 | t/00ldif-entry.t |
0 | --- | |
1 | abstract: 'LDAP client library' | |
2 | author: | |
3 | - 'Graham Barr <gbarr@cpan.org>' | |
4 | build_requires: | |
5 | ExtUtils::MakeMaker: 6.42 | |
6 | configure_requires: | |
7 | ExtUtils::MakeMaker: 6.42 | |
8 | distribution_type: module | |
9 | generated_by: 'Module::Install version 0.95' | |
10 | license: perl | |
11 | meta-spec: | |
12 | url: http://module-build.sourceforge.net/META-spec-v1.4.html | |
13 | version: 1.4 | |
14 | module_name: Net::LDAP | |
15 | name: perl-ldap | |
16 | no_index: | |
17 | directory: | |
18 | - inc | |
19 | - t | |
20 | requires: | |
21 | Convert::ASN1: 0.07 | |
22 | perl: 5.8.0 | |
23 | resources: | |
24 | ListArchive: http://perl.markmail.org/search/list:perl-ldap | |
25 | MailingList: http://lists.cpan.org/showlist.cgi?name=perl-ldap | |
26 | homepage: http://ldap.perl.org/ | |
27 | license: http://dev.perl.org/licenses/ | |
28 | repository: http://git.goingon.net/?p=perl-ldap.git;a=summary | |
29 | version: 0.4001 |
38 | 38 | ], |
39 | 39 | 'LDAPS' => [ |
40 | 40 | -default => 0, |
41 | 'IO::Socket::SSL' => 0.93, | |
41 | 'IO::Socket::SSL' => 1.26, | |
42 | 42 | ], |
43 | 43 | 'Read/Write DSML files' => [ |
44 | 44 | -default => 0, |
151 | 151 | -----BEGIN PGP SIGNATURE----- |
152 | 152 | Version: GnuPG v1.4.10 (Darwin) |
153 | 153 | |
154 | iEYEARECAAYFAkuqbssACgkQR0BL4gbYw3RwHwCfVC/lwO7A8Enx9B5FPm0cQcEJ | |
155 | i8IAn0ae/0y3xMI7OsSru2RxlHvopw/Y | |
156 | =JCBz | |
154 | iEYEARECAAYFAkuqbsgACgkQR0BL4gbYw3Qr0gCgiGn/eQ8KSx3Dnok5YNd60Q0q | |
155 | A4cAn2zrr1fxzDR9SALzApcUiKJHL3xo | |
156 | =95Vx | |
157 | 157 | -----END PGP SIGNATURE----- |
6 | 6 | # These modules are available from the PERL CPAN |
7 | 7 | # system. |
8 | 8 | # |
9 | # $Id$ | |
9 | # $Id: jpegDisplay.pl,v 1.2 2003/06/18 18:23:31 gbarr Exp $ | |
10 | 10 | # |
11 | 11 | # Purpose: This program is designed to retrieve jpeg photo data |
12 | 12 | # from a LDAP directory. |
10 | 10 | # directory entry. |
11 | 11 | # |
12 | 12 | # |
13 | # $Id$ | |
13 | # $Id: jpegLoad.pl,v 1.2 2003/06/18 18:23:31 gbarr Exp $ | |
14 | 14 | # |
15 | 15 | # Revisions: |
16 | 16 | # $Log: jpegLoad.pl,v $ |
0 | 0 | #! /usr/bin/perl |
1 | 1 | |
2 | # $Id$ | |
2 | # $Id: ldapmodify.pl,v 1.1 2001/10/23 15:07:41 gbarr Exp $ | |
3 | 3 | |
4 | 4 | =head1 NAME |
5 | 5 |
81 | 81 | 'sharedattrs=s' => sub {my @a=split(/,/,lc $_[1]);@sharedattrs{@a}=(1) x @a} |
82 | 82 | ); |
83 | 83 | unless (keys %ciscmp) { |
84 | foreach (qw(mail manager member objectclass owner uid uniquemember)) | |
84 | foreach (qw(cn mail manager member o ou objectclass owner uid uniquemember)) | |
85 | 85 | { $ciscmp{$_} = 1 } |
86 | 86 | } |
87 | 87 | unless (keys %numcmp) { |
0 | 0 | #! /usr/bin/perl |
1 | # $Id$ | |
1 | # $Id: ldifsort.pl,v 1.9 2005/04/03 20:20:24 subbarao Exp $ | |
2 | 2 | |
3 | 3 | =head1 NAME |
4 | 4 |
0 | 0 | #! /usr/bin/perl |
1 | 1 | |
2 | # $Id$ | |
2 | # $Id: ldifuniq.pl,v 1.1 2002/08/24 15:11:21 kartik_subbarao Exp $ | |
3 | 3 | |
4 | 4 | =head1 NAME |
5 | 5 |
9 | 9 | |
10 | 10 | my @err2name; |
11 | 11 | |
12 | local $_; | |
12 | 13 | while(<DATA>) { |
13 | 14 | last if /^=cut/; |
14 | 15 | my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/; |
5 | 5 | |
6 | 6 | use strict; |
7 | 7 | use Net::LDAP::ASN qw(LDAPEntry); |
8 | use Net::LDAP::Constant qw(LDAP_LOCAL_ERROR); | |
8 | use Net::LDAP::Constant qw(LDAP_LOCAL_ERROR LDAP_OTHER); | |
9 | 9 | use vars qw($VERSION); |
10 | 10 | |
11 | 11 | use constant CHECK_UTF8 => $] > 5.007; |
257 | 257 | |
258 | 258 | sub update { |
259 | 259 | my $self = shift; |
260 | my $ldap = shift; | |
260 | my $target = shift; # a Net::LDAP or a Net::LDAP::LDIF object | |
261 | 261 | my %opt = @_; |
262 | 262 | my $mesg; |
263 | 263 | my $user_cb = delete $opt{callback}; |
264 | 264 | my $cb = sub { $self->changetype('modify') unless $_[0]->code; |
265 | 265 | $user_cb->(@_) if $user_cb }; |
266 | 266 | |
267 | if ($self->{'changetype'} eq 'add') { | |
268 | $mesg = $ldap->add($self, 'callback' => $cb, %opt); | |
269 | } | |
270 | elsif ($self->{'changetype'} eq 'delete') { | |
271 | $mesg = $ldap->delete($self, 'callback' => $cb, %opt); | |
272 | } | |
273 | elsif ($self->{'changetype'} =~ /modr?dn/o) { | |
274 | my @args = (newrdn => $self->get_value('newrdn') || undef, | |
275 | deleteoldrdn => $self->get_value('deleteoldrdn') || undef); | |
276 | my $newsuperior = $self->get_value('newsuperior'); | |
277 | push(@args, newsuperior => $newsuperior) if $newsuperior; | |
278 | $mesg = $ldap->moddn($self, @args, 'callback' => $cb, %opt); | |
279 | } | |
280 | elsif (@{$self->{'changes'}}) { | |
281 | $mesg = $ldap->modify($self, 'changes' => $self->{'changes'}, 'callback' => $cb, %opt); | |
282 | } | |
283 | else { | |
284 | require Net::LDAP::Message; | |
285 | $mesg = Net::LDAP::Message->new( $ldap ); | |
286 | $mesg->set_error(LDAP_LOCAL_ERROR,"No attributes to update"); | |
267 | if (ref($target) && UNIVERSAL::isa($target, 'Net::LDAP')) { | |
268 | if ($self->{'changetype'} eq 'add') { | |
269 | $mesg = $target->add($self, 'callback' => $cb, %opt); | |
270 | } | |
271 | elsif ($self->{'changetype'} eq 'delete') { | |
272 | $mesg = $target->delete($self, 'callback' => $cb, %opt); | |
273 | } | |
274 | elsif ($self->{'changetype'} =~ /modr?dn/o) { | |
275 | my @args = (newrdn => $self->get_value('newrdn') || undef, | |
276 | deleteoldrdn => $self->get_value('deleteoldrdn') || undef); | |
277 | my $newsuperior = $self->get_value('newsuperior'); | |
278 | push(@args, newsuperior => $newsuperior) if $newsuperior; | |
279 | $mesg = $target->moddn($self, @args, 'callback' => $cb, %opt); | |
280 | } | |
281 | elsif (@{$self->{'changes'}}) { | |
282 | $mesg = $target->modify($self, 'changes' => $self->{'changes'}, 'callback' => $cb, %opt); | |
283 | } | |
284 | else { | |
285 | require Net::LDAP::Message; | |
286 | $mesg = Net::LDAP::Message->new( $target ); | |
287 | $mesg->set_error(LDAP_LOCAL_ERROR,"No attributes to update"); | |
288 | } | |
289 | } | |
290 | elsif (ref($target) && UNIVERSAL::isa($target, 'Net::LDAP::LDIF')) { | |
291 | $target->write_entry($self); | |
292 | $mesg = Net::LDAP::Message::Dummy->new(); | |
293 | $mesg->set_error(LDAP_OTHER, $target->error()) | |
294 | if ($target->error()); | |
287 | 295 | } |
288 | 296 | |
289 | 297 | return $mesg; |
218 | 218 | |
219 | 219 | =item ldif ( OPTION =E<gt> VALUE, ... ) |
220 | 220 | |
221 | Returns the entry as an LDIF string. possible options | |
221 | Returns the entry as an LDIF string. Possible options are | |
222 | 222 | |
223 | 223 | =over |
224 | 224 | |
225 | 225 | =item change =E<gt> VALUE |
226 | 226 | |
227 | 227 | If given a true value then the LDIF will be generated as a change record. |
228 | If flase, then the LDIF generated will represent the entry content. If | |
229 | unspecified then it will fefault to true if the entry has changes and | |
228 | If false, then the LDIF generated will represent the entry content. If | |
229 | unspecified then it will default to true if the entry has changes and | |
230 | 230 | false if no changes have been applied to the entry. |
231 | 231 | |
232 | 232 | =back |
249 | 249 | package Net::LDAP::Message::Dummy; |
250 | 250 | use vars qw(@ISA); |
251 | 251 | @ISA = qw(Net::LDAP::Message); |
252 | use Net::LDAP::Constant qw(LDAP_SUCCESS); | |
252 | 253 | |
253 | 254 | sub sync { shift } |
254 | 255 | sub decode { shift } |
255 | 256 | sub abandon { shift } |
256 | sub code { 0 } | |
257 | sub error { "" } | |
257 | sub code { shift->{resultCode} || LDAP_SUCCESS } | |
258 | sub error { shift->{errorMessage} || "" } | |
258 | 259 | sub dn { "" } |
259 | 260 | sub done { 1 } |
260 | 261 | } |
27 | 27 | LDAP_UNAVAILABLE |
28 | 28 | ); |
29 | 29 | |
30 | $VERSION = "0.4001"; | |
30 | $VERSION = "0.43"; | |
31 | 31 | @ISA = qw(Tie::StdHash Net::LDAP::Extra); |
32 | 32 | $LDAP_VERSION = 3; # default LDAP protocol version |
33 | 33 | |
218 | 218 | } |
219 | 219 | |
220 | 220 | ( |
221 | SSL_cipher_list => defined $arg->{'ciphers'} ? $arg->{'ciphers'} : 'ALL', | |
222 | SSL_ca_file => exists $arg->{'cafile'} ? $arg->{'cafile'} : '', | |
223 | SSL_ca_path => exists $arg->{'capath'} ? $arg->{'capath'} : '', | |
224 | SSL_key_file => $clientcert ? $clientkey : undef, | |
225 | SSL_passwd_cb => $passwdcb, | |
226 | SSL_check_crl => $arg->{'checkcrl'} ? 1 : 0, | |
227 | SSL_use_cert => $clientcert ? 1 : 0, | |
228 | SSL_cert_file => $clientcert, | |
229 | SSL_verify_mode => $verify, | |
230 | SSL_version => defined $arg->{'sslversion'} ? $arg->{'sslversion'} : | |
231 | 'sslv2/3', | |
221 | SSL_cipher_list => defined $arg->{'ciphers'} ? $arg->{'ciphers'} : 'ALL', | |
222 | SSL_ca_file => exists $arg->{'cafile'} ? $arg->{'cafile'} : '', | |
223 | SSL_ca_path => exists $arg->{'capath'} ? $arg->{'capath'} : '', | |
224 | SSL_key_file => $clientcert ? $clientkey : undef, | |
225 | SSL_passwd_cb => $passwdcb, | |
226 | SSL_check_crl => $arg->{'checkcrl'} ? 1 : 0, | |
227 | SSL_use_cert => $clientcert ? 1 : 0, | |
228 | SSL_cert_file => $clientcert, | |
229 | SSL_verify_mode => $verify, | |
230 | SSL_version => defined $arg->{'sslversion'} ? $arg->{'sslversion'} : | |
231 | 'sslv2/3', | |
232 | SSL_verifycn_scheme => "ldap", | |
232 | 233 | ); |
233 | 234 | } |
234 | 235 | |
383 | 384 | # If we're talking to a round-robin, the canonical name of |
384 | 385 | # the host we are talking to might not match the name we |
385 | 386 | # requested |
386 | my $connected_name = $ldap->{net_ldap_socket}->peerhost; | |
387 | my $connected_name; | |
388 | if ($ldap->{net_ldap_socket}->can('peerhost')) { | |
389 | $connected_name = $ldap->{net_ldap_socket}->peerhost; | |
390 | } | |
387 | 391 | $connected_name ||= $ldap->{net_ldap_host}; |
388 | 392 | |
389 | 393 | $sasl_conn = eval { |