Strategies to debug cpython modules during provision

William Brown william at blackhats.net.au
Tue Apr 10 02:31:43 UTC 2018


> 
> > Sadly, looking at it, when we get ret = 22, which I assume here is
> > KRB5_CONFIG_BADFORMAT, we just wrap that into the ldb_operr(ldb)
> > macro,
> > so we lose all the context that could help communicate the error to
> > someone.
> 
> Correct.

Actually, 22 is EINVAL apparently. Looks like you get EINVAL or
KRB5_CONFIG_BADFORMAT from krb5_config_parse_debug.

> 
> > So the first issue is how can we communicate what went wrong, why
> > it
> > went wrong, and how to resolve it. 
> 
> Exactly.

Do you think this is a better error message? 

ERROR(ldb): uncaught exception - Failed to setup krb5_context: Invalid
argument. This could be due to an invalid krb5 configuration. Please
check your systems krb5 configuration is correct.

This displays when ret == EINVAL || KRB5_CONFIG_BADFORM. If it's
another error, it's:

ERROR(ldb): uncaught exception - Failed to setup krb5_context: %s,
error_message(ret)

> 
> > After that, then we can think about "modern heimdal" to prevent the
> > error at all. 
> 
> Agreed.
> 
> > Given how unfamiliar I am with the codebase though, I'd like some
> > advice on where to start here and how to communicate better. I'm
> > assuming this requires a call to ldb_error instead of ldb_operr()
> > macro. Does that sound like a reasonable start to resolve this? 
> 
> ldb_asprintf_errstring() would be the best way to fill out a good
> error
> string. 
> 

Yep, got it. :) 

> 
> > Done. Worked out the root cause now. Thank you! 
> 
> I do appreciate your attention on these things - we often inflict
> pain
> on new users, and they would like these things fixed, but rarely do
> our
> new users come with the coding skill to fix them.

Thanks mate, it's no problem. It's a good thing to have fresh eyes on
these things. 

> 
> Thank you very much,
> 
> Andrew Bartlett
> 



More information about the samba-technical mailing list