New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn off interpolation to avoid issues with special characters #6154
Conversation
Thanks for the patch. Can you update the commit message per https://www.freeipa.org/page/Contribute/Code#Commit_message_requirements I don't think its a bad thing to disable interpolation but I don't know that this is going to make a NIS domain name with a % in it work everywhere. Have you tried netgroups with this change locally? Do they work as expected? |
8d6d29c
to
d9e072c
Compare
Commit message updated! I think I was unclear about the problem, this bug is preventing me from migrating from a NIS domain with a
I'm not trying to continue support for |
That makes sense. Kicking off full CI. |
The code looks good. Can you update the commit message with the basic reasoning from your latest comment? I think that will add good context for the future and is worth preserving in the repo. |
Turn off string interpolation on the FileStore class to avoid exceptions when a value to be saved contains a percent sign (%). The underlying SafeConfigParser that is used interprets percent signs as placeholders to be interpolated which then causes an exception as the placeholder isn't properly formatted. ipa-client-install uses the FileStore class to backup certain values that it overwrites as part of the installation. If those pre-existing, backed-up values contained a percent sign, ipa-client-install would throw an exception and thus prevent installation. https://pagure.io/freeipa/issue/9085
d9e072c
to
68fce17
Compare
I added another paragraph to the comment; hopefully it provides sufficient context! |
master:
|
This fixes https://pagure.io/freeipa/issue/9085
The Python
configparser.ConfigParser
class enables string interpolation by default which throws errors if%
signs are used in any values that don't interpolate correctly. The majority of the code base usesconfigparser.RawConfigParser
which has interpolation disabled by default soipalib/sysrestore.py
can match this functionality by settinginterpolation=None
on instantiation.