[SSSD] [PATCH] SYSDB: Print message why netgroup cannot be parsed

Pavel Březina pbrezina at redhat.com
Wed Nov 13 14:28:44 UTC 2013


On 11/13/2013 03:17 PM, Lukas Slebodnik wrote:
> On (13/11/13 15:03), Jakub Hrozek wrote:
>> On Tue, Nov 12, 2013 at 05:21:56PM +0100, Lukas Slebodnik wrote:
>>> ehlo,
>>>
>>> It was not easy find out why netgroup could not be covert into result entries.
>>> Problem was that nisNetgroupTriple contained unexpected string "(,user01)"
>>>
>>> [sssd[nss]] [lookup_netgr_step] (0x0100): Requesting info for [netgr_example]
>>> [sssd[nss]] [lookup_netgr_step] (0x0020): Failed to convert results into entries
>>> [sssd[nss]] [nss_cmd_setnetgrent_done] (0x0020): setnetgrent failed
>>> [sssd[nss]] [netgr_hash_remove] (0x1000): netgroup [netgr_example] was already removed
>>>
>>> Simple patch is attached.
>>>
>>> LS
>>
>>>  From f68890db040a979639909ca2c2880d4853d244a0 Mon Sep 17 00:00:00 2001
>>> From: Lukas Slebodnik <lslebodn at redhat.com>
>>> Date: Tue, 12 Nov 2013 14:39:27 +0100
>>> Subject: [PATCH] SYSDB: Print message why netgroup cannot be parsed
>>>
>>> It was not easy find out why netgroup could not be covert into result entries.
>>> Problem was that nisNetgroupTriple contained unexpected string "(,user01)"
>>
>> Thanks, this required a good detective work!
>>
>>>
>>> Resolves:
>>> https://fedorahosted.org/sssd/ticket/2137
>>> ---
>>>   src/db/sysdb_search.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
>>> index 8dfaf1f2ada22db5e70ebe18bee1ee299e4767dd..71e727efb24db637d2a693d3efa62deec989a387 100644
>>> --- a/src/db/sysdb_search.c
>>> +++ b/src/db/sysdb_search.c
>>> @@ -728,6 +728,9 @@ errno_t sysdb_netgr_to_entries(TALLOC_CTX *mem_ctx,
>>>                                           &tmp_entry[c]->value.triple.username,
>>>                                           &tmp_entry[c]->value.triple.domainname);
>>>                       if (ret != EOK) {
>>> +                        DEBUG(SSSDBG_MINOR_FAILURE,
>>> +                              ("Cannot split netgroup tripple [%s]\n",
>>
>> Nitpick The message should say "triple".
>>
>>> +                               triple_str));
>>>                           goto done;
>>
>> Can we just discard the single triple and continue instead of failing?
>
> That's the question. I was not sure about it.
> In my opinion it is better to skip netgroup processing imediately, because
> it will be higher chance to fix typo in netgroup tripple.
> On the other hand it will easy to replace s/goto done/continue/.
>
> What is an opinion of other developers?

I agree with Jakub, we should just skip the invalid object and continue 
with the next.

>
> LS
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
>




More information about the sssd-devel mailing list