#7838 configure_openldap_conf() does not handle multi-value URI
Opened 5 years ago by cheimes. Modified 4 years ago

Issue

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.

Steps to Reproduce

See https://github.com/freeipa/freeipa/pull/2756 for a reproducer

Actual behavior

/etc/openldap/ldap.conf has two URI lines

Expected behavior

/etc/openldap/ldap.conf should only have one URI

Version/Release/Distribution

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.

Metadata Update from @pvoborni:
- Issue set to the milestone: FreeIPA 4.7 backlog (was: 0.0 NEEDS_TRIAGE)

5 years ago

master:

  • a376b61 Add test case for configure_openldap_conf

ipa-4-7:

  • 52394eb Add test case for configure_openldap_conf

Metadata Update from @tdudlak:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Metadata Update from @frenaud:
- Custom field affects_doc adjusted to on
- Issue status updated to: Open (was: Closed)

4 years ago

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.

Metadata