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

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: address comments; 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;
+ size_t num_lib_names;
+ const char* kTempLibraryName[1];
+ if (!gssapi_library_name_.empty()) {
+ // We have a user-specified library name, so we ignore hard-coded values.
+ kTempLibraryName[0] = gssapi_library_name_.c_str();
+ kLibraryNames = kTempLibraryName;
+ num_lib_names = 1;
+ } else {
+ static const char* kTempLibraryNames[] = {
#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