Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: net/http/http_auth_gssapi_posix.cc

Issue 4560001: Support specifying the GSSAPI library that will be used. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix library handling on Windows; port to ToT Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_auth_gssapi_posix.cc
diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc
index b20ef50d550d01401e4c0e9656fad844ccb80d21..91513bc7b8ab57d5e39f3d7cd32ad1bcf95dc9ab 100644
--- a/net/http/http_auth_gssapi_posix.cc
+++ b/net/http/http_auth_gssapi_posix.cc
@@ -385,8 +385,9 @@ std::string DescribeContext(GSSAPILibrary* gssapi_lib,
} // namespace
-GSSAPISharedLibrary::GSSAPISharedLibrary()
+GSSAPISharedLibrary::GSSAPISharedLibrary(const std::string& gssapi_library_name)
: initialized_(false),
+ gssapi_library_name_(gssapi_library_name),
gssapi_library_(NULL),
import_name_(NULL),
release_name_(NULL),
@@ -422,16 +423,27 @@ bool GSSAPISharedLibrary::InitImpl() {
}
base::NativeLibrary GSSAPISharedLibrary::LoadSharedLibrary() {
- static const char* kLibraryNames[] = {
+ const char** kLibraryNames;
cbentzel 2010/11/11 03:37:51 Nit: this should be library_names now [it's no lon
Jakob Kummerow (corp) 2010/11/11 11:10:53 Done.
+ size_t num_lib_names;
+ const char* kTempLibraryName[1];
cbentzel 2010/11/11 03:37:51 Nit: name this something like const char* user_spe
Jakob Kummerow (corp) 2010/11/11 11:10:53 Done.
+ if (!gssapi_library_name_.empty()) {
+ // We have a user-specified library name, so we ignore hard-coded values.
danno 2010/11/10 16:52:01 Try to avoid using "we" or ""I" in the code and in
Jakob Kummerow (corp) 2010/11/10 17:48:39 Done.
+ kTempLibraryName[0] = gssapi_library_name_.c_str();
+ kLibraryNames = kTempLibraryName;
+ num_lib_names = 1;
+ } else {
+ static const char* kTempLibraryNames[] = {
cbentzel 2010/11/11 03:37:51 Nit: name kDefaultLibraryNames (there's nothing "T
Jakob Kummerow (corp) 2010/11/11 11:10:53 Done.
#if defined(OS_MACOSX)
- "libgssapi_krb5.dylib" // MIT Kerberos
+ "libgssapi_krb5.dylib" // MIT Kerberos
#else
- "libgssapi_krb5.so.2", // MIT Kerberos - FC, Suse10, Debian
- "libgssapi.so.4", // Heimdal - Suse10, MDK
- "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10
+ "libgssapi_krb5.so.2", // MIT Kerberos - FC, Suse10, Debian
+ "libgssapi.so.4", // Heimdal - Suse10, MDK
+ "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10
#endif
- };
- static size_t num_lib_names = arraysize(kLibraryNames);
+ };
+ kLibraryNames = kTempLibraryNames;
+ num_lib_names = arraysize(kTempLibraryNames);
+ }
for (size_t i = 0; i < num_lib_names; ++i) {
const char* library_name = kLibraryNames[i];
@@ -613,9 +625,6 @@ OM_uint32 GSSAPISharedLibrary::inquire_context(
locally_initiated,
open);
}
-GSSAPILibrary* GSSAPILibrary::GetDefault() {
- return Singleton<GSSAPISharedLibrary>::get();
-}
ScopedSecurityContext::ScopedSecurityContext(GSSAPILibrary* gssapi_lib)
: security_context_(GSS_C_NO_CONTEXT),

Powered by Google App Engine
This is Rietveld 408576698