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

Jakub Hrozek jhrozek at redhat.com
Thu Nov 14 18:37:44 UTC 2013


On Wed, Nov 13, 2013 at 05:22:25PM +0100, Lukas Slebodnik wrote:
> On (13/11/13 15:47), Jakub Hrozek wrote:
> >On Wed, Nov 13, 2013 at 03:17:29PM +0100, 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?
> >
> >Then maybe raise the debug level. We have something like IMPORTANT_INFO
> >as well..
> 
> This patch will ignore only malformed attribute and processing of netgroup
> will not fail.
> 
> Updated patch is attached.
> 
> LS

I think you made a typo in the debug level:
/home/remote/jhrozek/devel/sssd/src/db/sysdb_search.c:731:31: error: use of undeclared identifier
      'SSSDBG_MINOR_IMPORTANT_INFO'
                        DEBUG(SSSDBG_MINOR_IMPORTANT_INFO,
                              ^



More information about the sssd-devel mailing list