univention.s4connector.s4 package
Contents
univention.s4connector.s4 package¶
- univention.s4connector.s4.add_primary_group_to_addlist(connector, property_type, object, addlist, serverctrls)[source]¶
- univention.s4connector.s4.check_for_local_group_and_extend_serverctrls_and_sid(connector, property_type, object, add_or_modlist, serverctrls)[source]¶
- univention.s4connector.s4.samaccountname_dn_mapping(connector, given_object, dn_mapping_stored, ucsobject, propertyname, propertyattrib, ocucs, ucsattrib, ocad, dn_attr=None)[source]¶
map dn of given object (which must have an samaccountname in S4) ocucs and ocad are objectclasses in UCS and S4
- univention.s4connector.s4.user_dn_mapping(connector, given_object, dn_mapping_stored, isUCSobject)[source]¶
map dn of given user using the samaccountname/uid connector is an instance of univention.s4connector.s4, given_object an object-dict, dn_mapping_stored a list of dn-types which are already mapped because they were stored in the config-file
- univention.s4connector.s4.group_dn_mapping(connector, given_object, dn_mapping_stored, isUCSobject)[source]¶
map dn of given group using the samaccountname/cn connector is an instance of univention.s4connector.s4, given_object an object-dict, dn_mapping_stored a list of dn-types which are already mapped because they were stored in the config-file
- univention.s4connector.s4.windowscomputer_dn_mapping(connector, given_object, dn_mapping_stored, isUCSobject)[source]¶
map dn of given windows computer using the samaccountname/uid s4connector is an instance of univention.s4connector.s4, given_object an object-dict, dn_mapping_stored a list of dn-types which are already mapped because they were stored in the config-file
- univention.s4connector.s4.dc_dn_mapping(s4connector, given_object, dn_mapping_stored, isUCSobject)[source]¶
map dn of given dc computer using the samaccountname/uid s4connector is an instance of univention.s4connector.s4, given_object an object-dict, dn_mapping_stored a list of dn-types which are already mapped because they were stored in the config-file
- univention.s4connector.s4.compare_sid_lists(sid_list1, sid_list2)[source]¶
Compare the SID / RID attributes. Depending on the sync direction and SID sync configuration the function gets two SID lists or two RID values.
- class univention.s4connector.s4.LDAPEscapeFormatter[source]¶
Bases:
string.Formatter
A custom string formatter that supports a special e conversion, to employ the function ldap.filter.escape_filter_chars() on the given value.
>>> LDAPEscapeFormatter().format("{0}", "*") '*' >>> LDAPEscapeFormatter().format("{0!e}", "*") '\2a'
Unfortunately this does not support the key/index-less variant (see http://bugs.python.org/issue13598).
>>> LDAPEscapeFormatter().format("{!e}", "*") Traceback (most recent call last): KeyError: ''
- univention.s4connector.s4.format_escaped(format_string, *args, **kwargs)[source]¶
Convenience-wrapper around LDAPEscapeFormatter.
Use !e do denote format-field that should be escaped using ldap.filter.escape_filter_chars()’
>>> format_escaped("{0!e}", "*") '\2a'
- class univention.s4connector.s4.s4(CONFIGBASENAME, property, configRegistry, s4_ldap_host, s4_ldap_port, s4_ldap_base, s4_ldap_binddn, s4_ldap_bindpw, s4_ldap_certificate, listener_dir, logfilename=None, debug_level=None)[source]¶
Bases:
univention.s4connector.ucs
- RANGE_RETRIEVAL_PATTERN = re.compile('^([^;]+);range=(\\d+)-(\\d+|\\*)$')¶
- set_primary_group_to_ucs_user(object_key, object_ucs)[source]¶
check if correct primary group is set to a fresh UCS-User
- object_memberships_sync_from_ucs(key, object)[source]¶
sync group membership in AD if object was changend in UCS
- object_memberships_sync_to_ucs(key, object)[source]¶
sync group membership in UCS if object was changend in AD
- one_group_member_sync_to_ucs(ucs_group_object, object)[source]¶
sync groupmembers in UCS if changend one member in AD
- one_group_member_sync_from_ucs(s4_group_object, object)[source]¶
sync groupmembers in AD if changend one member in AD
Submodules¶
univention.s4connector.s4.computer module¶
univention.s4connector.s4.dc module¶
univention.s4connector.s4.dns module¶
- class univention.s4connector.s4.dns.PTRRecord(*args: Any, **kwargs: Any)[source]¶
Bases:
samba.dcerpc.dnsp.DnssrvRpcRecord
- class univention.s4connector.s4.dns.MXRecord(*args: Any, **kwargs: Any)[source]¶
Bases:
samba.dcerpc.dnsp.DnssrvRpcRecord
- univention.s4connector.s4.dns.dns_dn_mapping(s4connector, given_object, dn_mapping_stored, isUCSobject)[source]¶
map dn of given object (which must have an s4_RR_attr in S4) ol_oc_filter and s4_RR_filter are objectclass filters in UCS and S4
Code is based on univention.s4connector.s4.samaccountname_dn_mapping
univention.s4connector.s4.main module¶
univention.s4connector.s4.mapping module¶
- univention.s4connector.s4.mapping.ignore_filter_from_tmpl(template, ucr_key, default='')[source]¶
Construct an ignore_filter from a ucr_key (connector/s4/mapping/*/ignorelist, a comma delimited list of values), as specified by template while correctly escaping the filter-expression.
template must be formatted as required by format_escaped.
>>> ignore_filter_from_tmpl('(cn={0!e})', ... 'connector/s4/mapping/nonexistend/ignorelist', ... 'one,two,three') '(|(cn=one)(cn=two)(cn=three))'
- univention.s4connector.s4.mapping.ignore_filter_from_attr(attribute, ucr_key, default='')[source]¶
Convenience-wrapper around ignore_filter_from_tmpl().
This expects a single attribute instead of a template argument.
>>> ignore_filter_from_attr('cn', ... 'connector/s4/mapping/nonexistend/ignorelist', ... 'one,two,three') '(|(cn=one)(cn=two)(cn=three))'
univention.s4connector.s4.ntsecurity_descriptor module¶
- univention.s4connector.s4.ntsecurity_descriptor.encode_sddl_to_sd_in_ndr(domain_sid, ntsd_sddl)[source]¶
univention.s4connector.s4.password module¶
- univention.s4connector.s4.password.calculate_krb5key(unicodePwd, supplementalCredentials, kvno=0)[source]¶
- univention.s4connector.s4.password.calculate_supplementalCredentials(ucs_krb5key, old_supplementalCredentials, nt_hash)[source]¶
- univention.s4connector.s4.password.password_sync_s4_to_ucs(s4connector, key, ucs_object, modifyUserPassword=True)[source]¶
- univention.s4connector.s4.password.password_sync_s4_to_ucs_no_userpassword(s4connector, key, ucs_object)[source]¶
- univention.s4connector.s4.password.lockout_sync_s4_to_ucs(s4connector, key, ucs_object)[source]¶
- Sync account locking state from Samba/AD to OpenLDAP:
sync Samba/AD (lockoutTime != 0) -> OpenLDAP sambaAcctFlags (“L”) and Samba/AD badPasswordTime -> OpenLDAP sambaBadPasswordTime
- univention.s4connector.s4.password.lockout_sync_ucs_to_s4(s4connector, key, object)[source]¶
- Sync unlock modification from OpenLDAP to Samba/AD:
sync OpenLDAP (“L” not in sambaAcctFlags) -> Samba/AD lockoutTime = 0
sync OpenLDAP (“L” in sambaAcctFlags) -> Samba/AD lockoutTime = sambaBadPasswordTime and OpenLDAP sambaBadPasswordTime -> Samba/AD badPasswordTime
univention.s4connector.s4.query_config module¶
univention.s4connector.s4.sid_mapping module¶
Helper function to create the SID mapping definition.