[30083] in Kerberos

home help back first fref pref prev next nref lref last post

Re: krb5_context in a threaded process

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Tue Jul 8 17:57:04 2008

From: Ken Raeburn <raeburn@mit.edu>
To: aditham@yahoo.com
In-Reply-To: <e2fe0cfc-80a3-4f71-b74f-0781eed13872@c58g2000hsc.googlegroups.com>
Message-Id: <E895A172-99B5-4B06-A37F-D3DE05970455@mit.edu>
Mime-Version: 1.0 (Apple Message framework v926)
Date: Tue, 8 Jul 2008 17:55:12 -0400
Cc: kerberos@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: kerberos-bounces@mit.edu

On Jul 8, 2008, at 11:25, aditham@yahoo.com wrote:
> I need to initialize multiple krb5_context's in a multi-threaded
> program
> and each context *must* be initialized from a different config file.
>
> krb5_init_context() seems to read config from /etc/krb5.conf or the
> file
> pointed to by KRB5_CONFIG. Setting the environment variable will not
> work since
> "env"is for the process, not the thread.
>
> I was wondering if there is a better way to do this, other than
> creating a mutex
> to set/get the KRB5_CONFIG env variable before each krb5_init_context.

Unfortunately, no, at the moment that's the best way.  (Or use  
multiple processes.)

I'd actually thought about implementing an interface to take the extra  
input argument, because it would clean up how some of the KDC  
initialization works right now (which uses a private variant of  
krb5_init_context that only differs in that it adds the kdc.conf file  
to the normal list of config files).  Do you want to propose and  
implement something along those lines?  The krbdev@mit list would be  
the place for that discussion....

Ken
________________________________________________
Kerberos mailing list           Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos

home help back first fref pref prev next nref lref last post