any hidden dependency for krb5_context?

Greg Hudson ghudson at MIT.EDU
Tue Jun 17 12:59:55 EDT 2014


On 06/16/2014 06:57 PM, Bin Lu wrote:
> Initialize several krb5_context in one thread and put it in a global (pool) structure, then other threads get krb5_context from the pool and do the real work.

This ought to work, as long as you don't use the same krb5_context in
multiple threads at the same time.  I don't have any guesses as to why
you would be getting KRB5_REALM_CANT_RESOLVE when using a context in a
different thread from the one it was initialized in.

> I thought the realm should have been resolved during krb5_init_context() from env("KRB5_CONFIG").

The profile is read at krb5_init_context time, and is queried when we
actually need to send a message to the KDC.  But that should work from
any thread.


More information about the krbdev mailing list