6.2. Fetching the configuration parameters

One of the main requisites for services that use an LDAP backend is the correct configuration of its parameters. Let's see the contents of the smb.conf file as an example:

passsdb backend = ldapsam:ldap://127.0.0.1
ldap suffix = dc=ebox 
ldap admin dn = cn=admin,dc=ebox  

In this case we are configuring the samba daemon using LDAP as a backend through a socket. We'll need to know the dc base and the privileged dn in order to access protected attributes. Continuing the Samba example, we will also need to know the password of the user that has permission to read restricted attributes for samba objects. For all these tasks, EBox::LDAP offers a number of functions.

ldapConf

Returns a hash with the LDAP configuration.

dn.  base dn

ldapi.  ldapi for the connection to the LDAP server

rootdn.  cn for the privileged user

getPassword

Returns the password for privileged user.