URL:
https://github.com/SSSD/sssd/pull/658
Title: #658: pytest: Test case for sudo: search with lower cased name for case insensitive
domains
jhrozek commented:
"""
On Mon, Sep 24, 2018 at 05:09:51AM -0700, Niranjan Mallapadi wrote:
mrniranjan commented on this pull request.
> + no_passwd = [(ldap.MOD_ADD, 'sudoOption',
'!authenticate'.encode('utf-8'))]
+ try:
+ (_, _) = ldap_inst.add_entry(sudo_attr1, capsrule_dn1)
+ except LdapException:
+ pytest.fail("Failed to add %s rule in ldap" % (capsrule_dn1))
+ try:
+ (_, _) = ldap_inst.add_entry(sudo_attr2, capsrule_dn2)
+ except LdapException:
+ pytest.fail("Failed to add %s rule in ldap" % (capsrule_dn2))
+ else:
+ (_, _) = ldap_inst.modify_ldap(capsrule_dn1, no_passwd)
+ (_, _) = ldap_inst.modify_ldap(capsrule_dn2, no_passwd)
+
+
+(a)pytest.fixture
+def enable_sss_sudo_nsswitch(session_multihost, tmpdir, request):
authselect doesn't do it by default, Not sure if that's bug, currently authselect
adds sss to passwd,group,netgroup,automount, services.
Also "sudoers: files " entry doesn't exist in default /etc/nsswith.conf
OK, interesting, then this change makes sense.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/658#issuecomment-424077897