Net::LDAP::Util - Utility functions |
Net::LDAP::Util - Utility functions
use Net::LDAP::Util qw(ldap_error_text ldap_error_name ldap_error_desc );
$mesg = $ldap->search( .... );
die "Error ",ldap_error_name($mesg) if $mesg->code;
Net::LDAP::Util is a collection of utility functions for use with the the Net::LDAP manpage modules.
Net::LDAP::Message
object containing an error
code. If the error is not known the a string in the form "LDAP error
code %d(0x%02X)"
is returned.
Net::LDAP::Message
object
containing an LDAP error code. If the error code given is unknown then
undef
is returned.
Net::LDAP::Message
object containing an LDAP
error code.
It performs the following operations on the given DN:
OPTIONS is a list of name/value pairs, valid options are:
A Distinguished Name is a sequence of Relative Distinguished Names (RDNs), which themselves are sets of Attributes. For each RDN a hash is constructed with the attribute type names as keys and the attribute values as corresponding values. These hashes are then stored in an array in the order in which they appear in the DN.
For example, the DN 'OU=Sales+CN=J. Smith,DC=example,DC=net' is exploded to: [ { 'OU' => 'Sales', 'CN' => 'J. Smith' }, { 'DC' => 'example' }, { 'DC' => 'net' } ]
(RFC2253 string) DNs might also contain values, which are the bytes of the BER encoding of the X.500 AttributeValue rather than some LDAP string syntax. These values are hex-encoded and prefixed with a #. To distinguish such BER values, ldap_explode_dn uses references to the actual values, e.g. '1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com' is exploded to: [ { '1.3.6.1.4.1.1466.0' => ``\004\002Hi'' }, { 'DC' => 'example' }, { 'DC' => 'com' } ];
It also performs the following operations on the given DN:
OPTIONS is a list of name/value pairs, valid options are:
Any control characters with an ACII code < 32 as well as the characters with special meaning in LDAP filters ``*'', ``('', ``)'', and ``\'' the backslash are converted into the representation of a backslash followed by two hex digits representing the hexadecimal value of the character.
Returns the converted list in list mode and the first element in scalar mode.
Converts any sequences of a backslash followed by two hex digits into the corresponding character.
Returns the converted list in list mode and the first element in scalar mode.
The characters ``,'', ``+'', ``''``, ''\``, ''<``, ''>``, '';``, ''#``, ''=`` with a special meaning in RFC 2252 are preceeded by ba backslash. Control characters with an ASCII code < 32 are represented as \hexpair. Finally all leading and trailing spaces are converted to sequences of \20.
Returns the converted list in list mode and the first element in scalar mode.
Any escape sequence starting with a baskslash - hexpair or special character - will be transformed back to the corresponding character.
Returns the converted list in list mode and the first element in scalar mode.
Graham Barr <gbarr@pobox.com>
Copyright (c) 1999-2004 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.
ldap_explode_dn and canonical_dn also
(c) 2002 Norbert Klasen, norbert.klasen@daasi.de, All Rights Reserved.
Net::LDAP::Util - Utility functions |