Codebase list libnet-ldap-perl / 5eb1a83
Imported Upstream version 0.4300 gregor herrmann 12 years ago
17 changed file(s) with 85 addition(s) and 81 deletion(s). Raw diff Collapse all Expand all
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
016 0.4001 -- Wed Mar 24 14:54:35 CDT 2010
117
218 * Update Module::Install and generate META.yml
110110 Makefile.PL
111111 MANIFEST This list of files
112112 MANIFEST.SKIP
113 META.yml
114113 README
115114 SIGNATURE
116115 t/00ldif-entry.t
+0
-30
META.yml less more
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
3838 ],
3939 'LDAPS' => [
4040 -default => 0,
41 'IO::Socket::SSL' => 0.93,
41 'IO::Socket::SSL' => 1.26,
4242 ],
4343 'Read/Write DSML files' => [
4444 -default => 0,
151151 -----BEGIN PGP SIGNATURE-----
152152 Version: GnuPG v1.4.10 (Darwin)
153153
154 iEYEARECAAYFAkuqbssACgkQR0BL4gbYw3RwHwCfVC/lwO7A8Enx9B5FPm0cQcEJ
155 i8IAn0ae/0y3xMI7OsSru2RxlHvopw/Y
156 =JCBz
154 iEYEARECAAYFAkuqbsgACgkQR0BL4gbYw3Qr0gCgiGn/eQ8KSx3Dnok5YNd60Q0q
155 A4cAn2zrr1fxzDR9SALzApcUiKJHL3xo
156 =95Vx
157157 -----END PGP SIGNATURE-----
66 # These modules are available from the PERL CPAN
77 # system.
88 #
9 # $Id$
9 # $Id: jpegDisplay.pl,v 1.2 2003/06/18 18:23:31 gbarr Exp $
1010 #
1111 # Purpose: This program is designed to retrieve jpeg photo data
1212 # from a LDAP directory.
1010 # directory entry.
1111 #
1212 #
13 # $Id$
13 # $Id: jpegLoad.pl,v 1.2 2003/06/18 18:23:31 gbarr Exp $
1414 #
1515 # Revisions:
1616 # $Log: jpegLoad.pl,v $
00 #! /usr/bin/perl
11
2 # $Id$
2 # $Id: ldapmodify.pl,v 1.1 2001/10/23 15:07:41 gbarr Exp $
33
44 =head1 NAME
55
8181 'sharedattrs=s' => sub {my @a=split(/,/,lc $_[1]);@sharedattrs{@a}=(1) x @a}
8282 );
8383 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))
8585 { $ciscmp{$_} = 1 }
8686 }
8787 unless (keys %numcmp) {
00 #! /usr/bin/perl
1 # $Id$
1 # $Id: ldifsort.pl,v 1.9 2005/04/03 20:20:24 subbarao Exp $
22
33 =head1 NAME
44
00 #! /usr/bin/perl
11
2 # $Id$
2 # $Id: ldifuniq.pl,v 1.1 2002/08/24 15:11:21 kartik_subbarao Exp $
33
44 =head1 NAME
55
99
1010 my @err2name;
1111
12 local $_;
1213 while(<DATA>) {
1314 last if /^=cut/;
1415 my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/;
55
66 use strict;
77 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);
99 use vars qw($VERSION);
1010
1111 use constant CHECK_UTF8 => $] > 5.007;
257257
258258 sub update {
259259 my $self = shift;
260 my $ldap = shift;
260 my $target = shift; # a Net::LDAP or a Net::LDAP::LDIF object
261261 my %opt = @_;
262262 my $mesg;
263263 my $user_cb = delete $opt{callback};
264264 my $cb = sub { $self->changetype('modify') unless $_[0]->code;
265265 $user_cb->(@_) if $user_cb };
266266
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());
287295 }
288296
289297 return $mesg;
218218
219219 =item ldif ( OPTION =E<gt> VALUE, ... )
220220
221 Returns the entry as an LDIF string. possible options
221 Returns the entry as an LDIF string. Possible options are
222222
223223 =over
224224
225225 =item change =E<gt> VALUE
226226
227227 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
230230 false if no changes have been applied to the entry.
231231
232232 =back
249249 package Net::LDAP::Message::Dummy;
250250 use vars qw(@ISA);
251251 @ISA = qw(Net::LDAP::Message);
252 use Net::LDAP::Constant qw(LDAP_SUCCESS);
252253
253254 sub sync { shift }
254255 sub decode { shift }
255256 sub abandon { shift }
256 sub code { 0 }
257 sub error { "" }
257 sub code { shift->{resultCode} || LDAP_SUCCESS }
258 sub error { shift->{errorMessage} || "" }
258259 sub dn { "" }
259260 sub done { 1 }
260261 }
2727 LDAP_UNAVAILABLE
2828 );
2929
30 $VERSION = "0.4001";
30 $VERSION = "0.43";
3131 @ISA = qw(Tie::StdHash Net::LDAP::Extra);
3232 $LDAP_VERSION = 3; # default LDAP protocol version
3333
218218 }
219219
220220 (
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",
232233 );
233234 }
234235
383384 # If we're talking to a round-robin, the canonical name of
384385 # the host we are talking to might not match the name we
385386 # 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 }
387391 $connected_name ||= $ldap->{net_ldap_host};
388392
389393 $sasl_conn = eval {
00 #!perl -w
1
2 BEGIN {
3 for (1,2) { require Net::LDAP::Constant; }
4 }
5
16 use Net::LDAP::Util qw(ldap_error_name);;
27
38 my @constant = qw(