[krbdev.mit.edu #2636] replace all calls to getenv()/setenv() with Get/SetEnvironmentVariable on Windows

"Jeffrey Altman [Kermit Project]" via RT rt-comment at krbdev.mit.edu
Wed Jul 14 16:11:01 EDT 2004


Ken Raeburn wrote:

> On the plus side, that'll likely be a thread-safe interface, compared 
> with the UNIX one (if setenv is used).  Perhaps we should modify our 
> uses of getenv to call a helper function which returns us a string in 
> allocated storage; then that helper function could use either getenv 
> or GetEnvironmentVariable, and in the getenv case, while it still 
> wouldn't be thread-safe, it would reduce the window of exposure somewhat.
>
> Ken

A mutex could be placed in the helper function to ensure that at most 
one krb5 library call is accessing the environment variables
we care about at a time.




More information about the krb5-bugs mailing list