ipa-client-install fails with an exception if the client is being configured on a host with a pre-existing NIS domain that contains the character "%".
ipa-client-install
Please note that I didn't pick the original NIS domain and am migrating this set up to FreeIPA.
--no-nisdomain
The client exits unsuccessfully throwing an exception that includes "invalid interpolation syntax"
For the client to install.
FreeIPA client 4.8.6-1ubuntu2 on Ubuntu 20.04.3 but latest is also affected.
I've traced the underlying problem to the save() function in ipalib/sysrestore.py which uses Python's configparser.ConfigParser class. ConfigParser exposes an interpolation syntax that is keyed/trigged by the use of "%". The docs state that "%" characters should be escaped by adding an additional "%" (e.g. "%" should be sent in as "%%").
save()
ipalib/sysrestore.py
configparser.ConfigParser
ConfigParser
I've been unable to find what the valid character set for a NIS domain consists of. Typically it is just a normal domain name where % would be illegal but it isn't entirely clear from the NIS documentation I've been able to find.
I completely agree that having a "%" in your NIS domain is super abnormal and, if I'm being honest, I'm shocked that it hasn't caused any issues until now.
I would point out that this is a symptom of a possible larger bug which is any value containing a "%" that is saved via backup_state would cause a similar error. Looking through the code, it doesn't appear that the interpolation functionality of ConfigParser is used anywhere so the easiest/cleanest fix would be to just disable interpolation completely by setting interpolation=None when instantiating the ConfigParser class.
backup_state
interpolation=None
I submitted a PR for this on Github: https://github.com/freeipa/freeipa/pull/6154
master:
ipa-4-9:
Metadata Update from @abbra: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.