[krbdev.mit.edu #2636] replace all calls to getenv()/setenv() with Get/SetEnvironmentVariable on Windows
Ken Raeburn via RT
rt-comment at krbdev.mit.edu
Wed Jul 14 16:01:57 EDT 2004
> Unfortunately not. GetEnvironmentVariable() requires that the user
> provide the input buffer as well as a length. The return value is the
> length of the returned string.
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
More information about the krb5-bugs
mailing list