Some options are not known by SSSDConfig even though they are present in the config schema. I tried it with ldap_sudo_* and ldap_autofs_*, both are not present in get_all_options() are will raise a NoOptionError when trying to access them with get_option().
ldap_sudo_*
ldap_autofs_*
get_all_options()
NoOptionError
get_option()
#!/bin/python import SSSDConfig config = SSSDConfig.SSSDConfig() config.import_config('/etc/sssd/sssd.conf') domain = config.get_domain('ldap.vm') # ldap_sudo_include_regexp is not present in the list # even though it is set in sssd.conf for key, value in domain.get_all_options().items(): print('%s = %s' % (key, value)) # throws SSSDConfig.NoOptionError value = domain.get_option('ldap_sudo_include_regexp') print(value)
$ sudo cat /etc/sssd/sssd.conf ... [domain/ldap.vm] timeout = 30000 debug_level = 0x3ff0 id_provider = ldap ldap_uri = _srv_ ldap_tls_reqcert = demand ldap_tls_cacert = /home/pbrezina/workspace/sssd-test-suite/shared-enrollment/ldap/cacert.asc dns_discovery_domain = ldap.vm entry_cache_timeout = 30 ldap_pwmodify_mode = ldap_modify ldap_sudo_include_regexp = false
$ sudo python ./test.py ldap_pwmodify_mode = ldap_modify ldap_tls_reqcert = demand id_provider = ldap entry_cache_timeout = 30 dns_discovery_domain = ldap.vm debug_level = 16368 ldap_uri = _srv_ timeout = 30000 ldap_tls_cacert = /home/pbrezina/workspace/sssd-test-suite/shared-enrollment/ldap/cacert.asc Traceback (most recent call last): File "./test.py", line 15, in <module> value = domain.get_option('ldap_sudo_include_regexp') File "/usr/lib/python2.7/site-packages/SSSDConfig/__init__.py", line 725, in get_option raise NoOptionError(optionname) SSSDConfig.NoOptionError: ldap_sudo_include_regexp
I'm going to move this into patches welcome for now since nobody seems to be affected. But feel free to just send a PR if you want this fixed..
Metadata Update from @jhrozek: - Issue set to the milestone: SSSD Patches welcome - Issue tagged with: bug
@jhrozek I do not believe this is a problem. SSSDConfigSchema class won't read those properties unless you specify options shown below in your sssd.conf file:
autofs_provider = ldap sudo_provider = ldap
@pbrezina I cannot reproduce a problem with both autofs_provider & sudo_provider options specified in my sssd.conf file. Please try the same on your server.
@alexalme These two options are not affected. See the description and reproducer in the ticket description.
@pbrezina I know these two options are not affected, but you've specified only "id_provider = ldap" in sssd.conf file. In that case, logic inside the SSSDConfigSchema class will read only "[provider/ldap]" and "[provider/ldap/id]" sections of sssd/sssd.api.d/sssd-ldap.conf file. ldap_sudo_ & ldap_autofs_ attributes are located in another sections.
Or you are trying to say that SSSDConfigSchema class should read all [provider/ldap/*] sections no matter what has been specified in sssd.conf?
Both autofs and sudo (and others) provider defaults to the value of id_provider and it is quite common to specify only id_provider. So it should assume and read the correct provider options.
@pbrezina thanks for the clarification. I've got it now. Let me work on the fix.
@jhrozek , @pbrezina I've created PR: https://github.com/SSSD/sssd/pull/851
Just FYI, I've created a new account because there is no way to change username on the existing one. I want my username to be the same as on GitHub, but for some unknown reason, I've chosen another when I've registered. Anyway, looks like all of the tests have passed successfully.
Alex
master
Metadata Update from @pbrezina: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
SSSD is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in SSSD's github repository.
This issue has been cloned to Github and is available here: - https://github.com/SSSD/sssd/issues/4967
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.