univention.s4connector package

class univention.s4connector.attribute(ucs_attribute='', ldap_attribute='', con_attribute='', con_other_attribute='', required=0, single_value=False, compare_function=None, mapping=(), reverse_attribute_check=False, sync_mode='sync', udm_option=None)[source]
univention.s4connector.check_ucs_lastname_user(s4connector, key, ucs_object)[source]

check if required values for lastname are set

univention.s4connector.compare_lowercase(val1, val2)[source]
univention.s4connector.compare_normal(val1, val2)[source]
class univention.s4connector.configdb(filename)[source]
add_section(section)[source]
get(section, option)[source]
get_by_value(section, option)[source]
has_option(section, option)[source]
has_section(section)[source]
items(section)[source]
remove_option(section, option)[source]
set(section, option, value)[source]
class univention.s4connector.configsaver(filename)[source]
add_section(section)[source]
get(section, option)[source]
has_option(section, option)[source]
has_section(section)[source]
items(section)[source]
remove_option(section, option)[source]
set(section, option, value)[source]
write(ignore='')[source]
univention.s4connector.dictonary_lowercase(dict)[source]
univention.s4connector.generate_strong_password(length=24)[source]
univention.s4connector.make_lower(mlValue)[source]

lower string cases for mlValue which can be string or a list of values which can be given to mlValue

class univention.s4connector.property(ucs_default_dn='', con_default_dn='', ucs_module='', ucs_module_others=[], sync_mode='', scope='', con_search_filter='', ignore_filter=None, match_filter=None, ignore_subtree=[], con_create_objectclass=[], con_create_attributes=[], dn_mapping_function=[], attributes=None, ucs_create_functions=[], con_create_extenstions=[], post_con_create_functions=[], post_con_modify_functions=[], post_ucs_modify_functions=[], post_attributes=None, mapping_table=None, position_mapping=[], con_sync_function=None, ucs_sync_function=None, disable_delete_in_ucs=False, identify=None, con_subtree_delete_objects=[])[source]
univention.s4connector.set_primary_group_user(s4connector, key, ucs_object)[source]

check if correct primary group is set

univention.s4connector.set_ucs_passwd_user(s4connector, key, ucs_object)[source]

set random password to fulfill required values

class univention.s4connector.ucs(CONFIGBASENAME, _property, baseConfig, listener_dir)[source]
_check_dn_mapping(dn_ucs, dn_con)[source]
_debug_traceback(level, text)[source]

print traceback with ud.debug, level is i.e. ud.INFO

_decode_dn_from_config_option(dn)[source]
_encode_dn_as_config_option(dn)[source]
_filter_match(filter, attributes)[source]

versucht eine Liste von Attributen auf einen LDAP-Filter zu matchen Besonderheiten des Filters: - immer case-sensitive - nur * als Wildcard - geht “lachser” mit Verschachtelten Klammern um

_forget_entryCSN(entryUUID, entryCSN)[source]
_get_config_items(section)[source]
_get_config_option(section, option)[source]
_get_dn_by_con(dn_con)[source]
_get_dn_by_ucs(dn_ucs)[source]
_get_entryUUID(dn)[source]
_get_last_entryCSN_commited_by_connector(entryUUID)[source]

Remember the entryCSN of a change committed by the S4-Connector itself

_get_rdn(dn)[source]
_get_rejected_ucs(filename)[source]
_get_subtree(dn)[source]
_ignore_object(key, object)[source]

parse if object should be ignored because of ignore_subtree or ignore_filter

Parameters:
  • key – the property_type from the mapping
  • object – a mapped or unmapped S4 or UCS object
_list_rejected_filenames_ucs()[source]
_list_rejected_ucs()[source]
_object_mapping(key, old_object, object_type='con')[source]

Create a mapped object from Samba or UCS object definition.

Parameters:
  • key – the mapping key
  • old_object – the object definition in univention directory listener style
  • object_type – “con” if old_object is a S4 object. “ucs” if old_object is a UCS object.
Ptype old_object:
 

dict

Ptype object_type:
 

str

_remember_entryCSN_commited_by_connector(entryUUID, entryCSN)[source]

Remember the entryCSN of a change committed by the S4-Connector itself

_remove_config_option(section, option)[source]
_remove_dn_mapping(dn_ucs, dn_con)[source]
_remove_rejected_ucs(filename)[source]
_remove_subtree_in_ucs(parent_ucs_object)[source]
_save_rejected_ucs(filename, dn, resync=True, reason='')[source]
_set_config_option(section, option, value)[source]
_set_dn_mapping(dn_ucs, dn_con)[source]
_subtree_match(dn, subtree)[source]
_subtree_replace(dn, subtree, subtreereplace)[source]
_ucs__set_values(property_type, object, ucs_object, modtype='modify')
_ucs__sync_file_from_ucs(filename, append_error='', traceback_level=1)
add_in_ucs(property_type, object, module, position)[source]
close_debug()[source]
delete_in_ucs(property_type, object, module, position)[source]

Removes an Samba-4 object in UCS-LDAP

dn_mapped_to_base(dn, base)[source]

Introduced for Bug #33110: Fix case of base part of DN

get_dn_by_con(dn_con)[source]
get_dn_by_ucs(dn_ucs)[source]
get_ucs_ldap_object(dn)[source]
get_ucs_ldap_object_dn(dn)[source]
get_ucs_object(property_type, dn)[source]
identify_udm_object(dn, attrs)[source]

Get the type of the specified UCS object

init_debug()[source]
initialize()[source]
initialize_ucs()[source]
list_rejected_ucs(filter_noresync=False)[source]
modify_in_ucs(property_type, object, module, position)[source]
move_in_ucs(property_type, object, module, position)[source]
open_ucs()[source]
poll(show_deleted=True)[source]
poll_ucs()[source]

poll changes from UCS: iterates over files exported by directory-listener module

resync_rejected()[source]
resync_rejected_ucs()[source]

tries to resync rejected changes from UCS

search_ucs(filter='(objectClass=*)', base='', scope='sub', attr=[], unique=0, required=0, timeout=-1, sizelimit=0)[source]
sync_from_ucs(property_type, object, pre_mapped_ucs_dn, old_dn=None, old_ucs_object=None, new_ucs_object=None)[source]
sync_to_ucs(property_type, object, pre_mapped_s4_dn, original_object)[source]

Synchronize an object from Samba4-LDAP to UCS Open-LDAP.

Parameters:
  • property_type – the type of the object to be synced, must be part of the mapping. (e.g. “user”, “group”, “dc”, “windowscomputer”, etc.)
  • object – A dictionary describing the Samba object. modtype: A modification type (“add”, “modify”, “move”, “delete”) dn: The DN of the object in the UCS-LDAP olddn: The olddn of the object object in UCS-LDAP (e.g. on “move” operation)
  • pre_mapped_s4_dn – pass
  • original_object – pass
Ptype object:

dict

update_deleted_cache_after_removal(entryUUID, objectGUID)[source]
was_entryUUID_deleted(entryUUID)[source]
was_objectGUID_deleted_by_ucs(objectGUID)[source]

Submodules

univention.s4connector.lockingdb module

univention.s4connector.lockingdb.func_name()[source]
class univention.s4connector.lockingdb.LockingDB(filename)[source]

A local database which includes the list of objects which are currently locked. That means the synchronisation of these objects has not been finished. https://forge.univention.org/bugzilla/show_bug.cgi?id=35391

lock_ucs(uuid)[source]
unlock_ucs(uuid)[source]
lock_s4(guid)[source]
unlock_s4(guid)[source]
is_ucs_locked(uuid)[source]
is_s4_locked(guid)[source]
_LockingDB__create_tables()
_LockingDB__execute_sql_commands(sql_commands, fetch_result=False)

univention.s4connector.s4cache module

class univention.s4connector.s4cache.EntryDiff(old, new)[source]

Bases: object

added()[source]
changed()[source]
removed()[source]
class univention.s4connector.s4cache.S4Cache(filename)[source]

Local cache for the current Samba 4 state of the s4connector. With this cache the connector has the possibility to create a diff between the new Samba 4 object and the old one from cache.

_S4Cache__create_tables()
_S4Cache__execute_sql_commands(sql_commands, fetch_result=False)
_add_entry(guid, entry)[source]
_append_guid(guid)[source]
_attr_exists(guid)[source]
_create_attr(attr)[source]
_get_attr_id(attr)[source]
_get_attr_id_and_create_if_not_exists(attr)[source]
_get_guid_id(guid)[source]
_guid_exists(guid)[source]
_update_entry(guid, entry)[source]
add_entry(guid, entry)[source]
diff_entry(old_entry, new_entry)[source]
get_entry(guid)[source]
remove_entry(guid)[source]
univention.s4connector.s4cache._decode_base64(val)[source]
univention.s4connector.s4cache._encode_base64(val)[source]
univention.s4connector.s4cache.func_name()[source]