The URI stanza supports multiple hosts. configure_openldap_conf() does not handle an existing /etc/openldap/ldap.conf with two URI stanzes correctly. It adds a second URI line to the config file.
configure_openldap_conf()
/etc/openldap/ldap.conf
See https://github.com/freeipa/freeipa/pull/2756 for a reproducer
/etc/openldap/ldap.conf has two URI lines
/etc/openldap/ldap.conf should only have one URI
FreeIPA 4.7.3
The bug is in parseLine method https://github.com/freeipa/freeipa/blob/b431e9b684df11c811892bd9d2a5711355f0076e/ipaclient/install/ipachangeconf.py#L205-L230. Because the assignment empty space is handled before assignment value tab, it parses the line URI\tldap://ldap.example.com ldap://ldap-master.example.com:666 as option URI\tldap://ldap.example.com with value ldap://ldap-master.example.com:666. The method should use whatever assignment value comes first and produces the shortest option key.
parseLine
URI\tldap://ldap.example.com ldap://ldap-master.example.com:666
URI\tldap://ldap.example.com
ldap://ldap-master.example.com:666
Metadata Update from @pvoborni: - Issue set to the milestone: FreeIPA 4.7 backlog (was: 0.0 NEEDS_TRIAGE)
master:
ipa-4-7:
Metadata Update from @tdudlak: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Metadata Update from @frenaud: - Custom field affects_doc adjusted to on - Issue status updated to: Open (was: Closed)
Reopening issue as it is still present. The above commits added a test but did not fix the issue.
Login to comment on this ticket.