Configuration of LDAP client |
modules/Ldap.ycp |
LDAP client configuration data, I/O functions. | |
|
|
This module has an unstable interface. |
show popups with error messages?
DN of base configuration object
Required packages for this module to operate -- they are now required only when LDAP is set for authentication
Write only, used during autoinstallation. Don't run services and SuSEconfig, it's all done at one place.
Are LDAP services available via nsswitch.conf?
Is NIS service available? If yes, and LDAP client will be enabled, warn user (see bug #36981)
If no, automounter will not be affected.
Start automounter and import the settings from LDAP
If login of LDAP uses to local machine is enabled
which attribute have LDAP groups for list of members
IP addresses of LDAP server.
If home directories of LDAP users are stored on this machine
DN for binding to LDAP server
defaults for adding new config objects and templates
Map of object classes (from schema). Indexed by names.
Map of atribute types (from schema). Indexed by names.
encryption schemes supported by slappasswd
Available configuration modules (objectclass names) TODO update
The defualt values, which should replace the ones from Read () Used during instalation, when we want to do a reasonable proposal
If the default values, used from ldap-server module were used to configure ldap-client
If false, do not read settings already set from outside used e.g. for Users YaPI. see bug #60898
if sshd should be restarted during write phase
If the domain has changed from a nonempty one, it may only be changed at boot time. Use this to warn the user.
- Return value:
-
whether changed by SetDomain
- Return value:
-
Get the LDAP domain.
Set the LDAP domain.
- Parameters:
-
new_domain a new domain
Set the defualt values, which should replace the ones from Read () Used during instalation, when we want to do a reasonable proposal
- Parameters:
-
settings
set the value of read_settings variable which means, do not read some settings from system
- Parameters:
-
read
Only set variables, without checking anything
- Parameters:
-
settings
Get all the LDAP configuration from a map. When called by ldap_auto (preparing autoinstallation data) the map may be empty.
- Parameters:
-
settings $["start": "domain": "servers":[...] ]
- Return value:
-
success
Dump the LDAP settings to a map, for autoinstallation use.
- Return value:
-
$["start":, "servers":[...], "domain":]
Summary() returns html formated configuration summary
- Return value:
-
summary
returns html formated configuration summary (shorter than Summary)
- Return value:
-
summary
Read single entry from /etc/ldap.conf file
- Parameters:
-
entry entry name defvalue default value if entry is not present
- Return value:
-
entry value
Read multi-valued entry from /etc/ldap.conf file
- Parameters:
-
entry entry name
- Return value:
-
entry value
Write (single valued) entry to /etc/ldap.conf
- Parameters:
-
entry name value
Write (possibly multi valued) entry to /etc/ldap.conf
- Parameters:
-
entry name value it is of type [attr1, attr2], in /etc/ldap.conf should be written as "entry attr1 attr2"
- Example
-
to write "nss_map_attribute uniquemember member", call WriteLdapConfEntries ("nss_map_attribute", ["uniquemember", "member"])
Add a new value to the entry in /etc/ldap.conf
- Parameters:
-
entry name value
Check if current machine runs OES
Reads LDAP settings from the SCR
- Return value:
-
success
Error popup for errors detected during LDAP operation
- Parameters:
-
type error type: binding/reading/writing error
Reads and returns error map (=message + code) from agent
Reads and returns error message from agent
return administrator's DN if it was not read yet, read it now
Initializes LDAP agent
Binds to LDAP server
- Parameters:
-
pass password
Asks user for bind password to LDAP server
- Parameters:
-
enable_anonymous
- Return value:
-
password
Asks for LDAP password and tries to bind with it
- Parameters:
-
enable_anonymous
- Return value:
-
password entered, nil on cancel
Check if attribute allowes only single or multiple value
- Parameters:
-
attr attribute name
- Return value:
-
answer
Gets the description of attribute (from schema)
- Parameters:
-
attr attribute name
- Return value:
-
description
Returns true if given object class exists in schema
- Parameters:
-
class ObjectClass name
Returns true if given object class is of 'structural' type
- Parameters:
-
class ObjectClass name
Returns allowed and required attributes of given object class Read it from LDAP if it was not done yet.
- Parameters:
-
class
- Return value:
-
attribute names (list of strings)
Returns required attributes of given object class Read it from LDAP if it was not done yet.
- Parameters:
-
class
- Return value:
-
attribute names (list of strings)
Returns the list of all allowed and required attributes for each object class, given in the list of object classes
- Parameters:
-
classes list of object classes whose attributes we want
- Return value:
-
attribute names (list of strings)
For a given object, add all atributes this object is allowed to have according to its "objectclass" value. Added attributes have empty values.
- Parameters:
-
object map describing LDAP entry
- Return value:
-
updated map
Prepare agent for later schema queries (agent reads schema to its internal structures)
- Return value:
-
error message
In template object, convert the list of values (where is in the form [ "a1=v1", "a2=v2"]) to map (in the form $[ "a1":"v1", "a2":"v2"]
- Parameters:
-
templ original template map
- Return value:
-
updated template map
Read object templates from LDAP server
- Return value:
-
error message
Read configuration moduels from LDAP server
- Return value:
-
error message
Search for one entry (=base scope) in LDAP directory
- Parameters:
-
dn DN of entry
- Return value:
-
with entry values, empty map if nothing found, nil on error
Check for existence of parent object of given DN in LDAP tree return the answer
- Parameters:
-
dn
Return main configuration object DN
Return the map of configuration modules (new copy) (in the form $[ DN: $[ map_of_one_module] ])
Return the map of templates (new copy)
Return list of default object classes for user or group There is fixed list here, it is not saved anywhere (only in default users plugin for LDAP objects)
- Parameters:
-
template used for differ if we need user or group list
Creates default new map for a new object template
- Parameters:
-
cn cn of new template classes object classes of the object the template will belong to
- Return value:
-
template map
Creates default new map for new configuration object
- Parameters:
-
cn class additional objectclass of new module (e.g.userConfiguration)
- Return value:
-
new module map
Searches for DN's of all objects defined by filter in given base ("sub")
- Parameters:
-
base search base search_filter if filter is empty, "objectclass=*" is used
- Return value:
-
of DN's (list of strings)
Returns DN's of groups (objectclass=posixGroup) in given base
- Parameters:
-
base LDAP search base
- Return value:
-
groups (list of strings)
Check if given DN exist and if it points to some template
- Parameters:
-
dn
- Return value:
-
empty map if DN don't exist, template map if DN points to template object, nil if object with given DN is not template
Save the edited map of configuration modules to global map
- Parameters:
-
modules
Save the edited map of templates to global map
- Parameters:
-
templs
Writes map of objects to LDAP
- Parameters:
-
objects map of objects to write. It is in the form: $[ DN: (map) attribute_values]
- Return value:
-
error map (empty on success)
- Example
-
TODO
Writes map of objects to LDAP. Ask for password, when needed and shows the error message when necessary.
- Parameters:
-
objects
- Return value:
-
success
Modify also /etc/openldap/ldap.conf for the use of ldap client utilities (like ldapsearch)
- Return value:
-
modified?
If a file does not + entry, add it.
- Parameters:
-
login
- Return value:
-
success?
Check if references to other objects are correct; create these objects if possible
create the default objects for users and groups
Check the server if it is NDS (novell directory service)
Saves LDAP configuration.
- Parameters:
-
abort block for abort
Check if base config DN belongs to some existing object and offer creating it if necessary
- Parameters:
-
dn
Return list of architecture specific packages (derived from package list given as parameter) merged with the packages in parameter
- Parameters:
-
packages
Return needed packages and packages to be removed during autoinstallation.
- Return value:
-
of lists.
Set the value of bind_pass variable
- Parameters:
-
pass new password valure
Set the value of 'anonymous' variable (= bind without password)
- Parameters:
-
anon new value
Set the value of 'use_gui' variable (= show error popups)
- Parameters:
-
gui new value
Set the value of restart_sshd (= restart sshd during write)
- Parameters:
-
restart