GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::LDAP::CONFIG (3)

.ds Aq ’

NAME

Net::LDAP::Config - a simple wrapper for maintaining info related to LDAP connections

CONTENTS

SYNOPSIS



        my $config = Net::LDAP::Config->new(source => default);
        $config->clauth(); # CLI authentation
        $config->bind(
                dn => $dn,
                password => $password
        ); # normal authentation



DESCRIPTION

<B>Net::LDAP::ConfigB> is a wrapper module originally written for <B>ldapshB> but which is useful for much more. It’s not very well documented just yet, but here are the main uses:

CONFIG FILE

The config file is a simple INI-style format. There is one special section, <B>mainB>, and the only option it recognizes is <B>defaultB>, for specifying the default source. Any other sections specify an LDAP source.

For example:
        [ldap]
        servers: ldap1.domain.com,ldap2.domain.com
        base: dc=domain,dc=com
        ssl: require



        [main]
        default: ldap



A main config file is looked for in /etc/ldapsh_config and /usr/local/etc/ldapsh_config, and then in the user’s home directory, either in the file specified by $LDAP_CONFIG or ~/.ldapsh_config.

CLI AUTHENTICATION

If you are building an interactive script, you’ll want to use this method:

create the configuration object, which basically pulls the server configuration from the config file
my $config = Net::LDAP::Config->new(’source’ => ’mysource’);

and then get all of the necessary info this caches ldap UIDs in ~/.ldapuids



 $config->clauth();



NORMAL AUTHENTICATION

This is where you collect the DN and password and auth normally:



 my $config = Net::LDAP::Config->new(source => mysource);
 $config->bind(
        dn => $dn,
        password => $password
 ); # normal authentation



If you don’t want to authenticate, use <B>connectB>:



 my $config = Net::LDAP::Config->new(source => mysource);
 $config->connect();



Yes, it sucks that there’s a difference. I’m still trying to clean up the API.

You should probably just use <B>bindB>, as it behaves well either with or without auth information.

ENVIRONMENT VARIABLES

Here are the environment variables that <B>Net::LDAP::ConfigB> uses:
LDAP_UIDFILE The file in which to store LDAP DN’s. Defaults to ~/.ldapuids. This file is maintained automatically by <B>Net::LDAP::ConfigB>, although you can modify it if you like — it just caches the searched-for DN so you don’t have to specify your username each time.

Feel free to recommend a different design.

LDAP_CONFIG A user-specific config file; over-rides any information in the central file. Defaults to ~/.ldapsh_config.

FUNCTIONS

debug Can be used to turn debugging on (debug(on)) or off (debug(off)), otherwise prints on STDERR anything passed to it if debugging is currently on.
error Used to store and report errors on the shell. Any arguments passed to <B>errorB> are joined into a single error message and returned as an error any time <B>errorB> is called.

EXAMPLE

  if ( error() ) { warn error(There was a problem); } else { dostuff(); }

if (error()) { die error(); }

multiConnect Connects to the first viable ldap server from a list or reference to a list.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 106: =over without closing =back
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::LDAP::CONFIG (3) 2004-11-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.