diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 12:38:19 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 12:38:19 +0000 |
commit | 1b6e1d2f72217d4bd9c9a164db70cbfc1b869d1c (patch) | |
tree | cdad2f08fdc26c5a15ec7e45609717d829a2ccd5 | |
parent | b69f4ffd2ff73ba0cad80f80555e4b15fc211257 (diff) | |
download | chromium_src-1b6e1d2f72217d4bd9c9a164db70cbfc1b869d1c.zip chromium_src-1b6e1d2f72217d4bd9c9a164db70cbfc1b869d1c.tar.gz chromium_src-1b6e1d2f72217d4bd9c9a164db70cbfc1b869d1c.tar.bz2 |
Revert 97925 - Linux: allow linking directly with Kerberos instead of using dlopen.
dlopen is still the default for Google Chrome. This option
is intended for Linux distro packagers.
BUG=92689
Review URL: http://codereview.chromium.org/7655046
TBR=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/7719024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98028 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | build/install-build-deps.sh | 8 | ||||
-rw-r--r-- | net/http/http_auth_gssapi_posix.cc | 11 | ||||
-rw-r--r-- | net/http/http_auth_gssapi_posix.h | 15 | ||||
-rw-r--r-- | net/http/http_auth_gssapi_posix_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_auth_handler_factory.cc | 3 | ||||
-rw-r--r-- | net/http/http_auth_handler_negotiate_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/mock_gssapi_library_posix.cc | 3 | ||||
-rw-r--r-- | net/http/mock_gssapi_library_posix.h | 3 | ||||
-rw-r--r-- | net/net.gyp | 14 |
9 files changed, 15 insertions, 48 deletions
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 7908608..1329877 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -105,10 +105,10 @@ dev_list="apache2.2-bin bison fakeroot flex g++ gperf language-pack-fr libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libcups2-dev libdbus-glib-1-dev libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libglib2.0-dev libgnome-keyring-dev - libgtk2.0-dev libjpeg62-dev libkrb5-dev libnspr4-dev libnss3-dev - libpam0g-dev libsctp-dev libsqlite3-dev libxslt1-dev libxss-dev - libxtst-dev mesa-common-dev msttcorefonts patch perl libwww-perl - php5-cgi pkg-config python python-dev rpm subversion ttf-dejavu-core + libgtk2.0-dev libjpeg62-dev libnspr4-dev libnss3-dev libpam0g-dev + libsctp-dev libsqlite3-dev libxslt1-dev libxss-dev libxtst-dev + mesa-common-dev msttcorefonts patch perl libwww-perl php5-cgi + pkg-config python python-dev rpm subversion ttf-dejavu-core ttf-kochi-gothic ttf-kochi-mincho wdiff libcurl4-gnutls-dev ttf-indic-fonts ttf-thai-tlwg $chromeos_dev_list" diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc index cc27e70..25ee910 100644 --- a/net/http/http_auth_gssapi_posix.cc +++ b/net/http/http_auth_gssapi_posix.cc @@ -17,7 +17,6 @@ #include "net/base/net_errors.h" #include "net/base/net_util.h" -#if defined(DLOPEN_KERBEROS) // These are defined for the GSSAPI library: // Paraphrasing the comments from gssapi.h: // "The implementation must reserve static storage for a @@ -63,7 +62,6 @@ gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_VAL; gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_VAL; gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_VAL; gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_VAL; -#endif // defined(DLOPEN_KERBEROS) namespace net { @@ -412,11 +410,9 @@ bool GSSAPISharedLibrary::Init() { bool GSSAPISharedLibrary::InitImpl() { DCHECK(!initialized_); -#if defined(DLOPEN_KERBEROS) gssapi_library_ = LoadSharedLibrary(); if (gssapi_library_ == NULL) return false; -#endif // defined(DLOPEN_KERBEROS) initialized_ = true; return true; } @@ -463,20 +459,17 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLibrary() { return NULL; } -#if defined(DLOPEN_KERBEROS) #define BIND(lib, x) \ - DCHECK(lib); \ gss_##x##_type x = reinterpret_cast<gss_##x##_type>( \ base::GetFunctionPointerFromNativeLibrary(lib, "gss_" #x)); \ if (x == NULL) { \ LOG(WARNING) << "Unable to bind function \"" << "gss_" #x << "\""; \ return false; \ } -#else -#define BIND(lib, x) gss_##x##_type x = gss_##x -#endif bool GSSAPISharedLibrary::BindMethods(base::NativeLibrary lib) { + DCHECK(lib != NULL); + BIND(lib, import_name); BIND(lib, release_name); BIND(lib, release_buffer); diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h index 8e8a114..b1b1227 100644 --- a/net/http/http_auth_gssapi_posix.h +++ b/net/http/http_auth_gssapi_posix.h @@ -6,8 +6,6 @@ #define NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ #pragma once -#include <gssapi.h> - #include <string> #include "base/gtest_prod_util.h" @@ -16,6 +14,9 @@ #include "net/base/net_export.h" #include "net/http/http_auth.h" +#define GSS_USE_FUNCTION_POINTERS +#include "net/third_party/gssapi/gssapi.h" + namespace net { NET_EXPORT_PRIVATE extern gss_OID CHROME_GSS_C_NT_HOSTBASED_SERVICE_X; @@ -167,16 +168,6 @@ class NET_EXPORT_PRIVATE GSSAPISharedLibrary : public GSSAPILibrary { int* open); private: - typedef typeof(&gss_import_name) gss_import_name_type; - typedef typeof(&gss_release_name) gss_release_name_type; - typedef typeof(&gss_release_buffer) gss_release_buffer_type; - typedef typeof(&gss_display_name) gss_display_name_type; - typedef typeof(&gss_display_status) gss_display_status_type; - typedef typeof(&gss_init_sec_context) gss_init_sec_context_type; - typedef typeof(&gss_wrap_size_limit) gss_wrap_size_limit_type; - typedef typeof(&gss_delete_sec_context) gss_delete_sec_context_type; - typedef typeof(&gss_inquire_context) gss_inquire_context_type; - FRIEND_TEST_ALL_PREFIXES(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup); bool InitImpl(); diff --git a/net/http/http_auth_gssapi_posix_unittest.cc b/net/http/http_auth_gssapi_posix_unittest.cc index f536ee8..f4270e1 100644 --- a/net/http/http_auth_gssapi_posix_unittest.cc +++ b/net/http/http_auth_gssapi_posix_unittest.cc @@ -81,13 +81,11 @@ TEST(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup) { EXPECT_TRUE(gssapi.get()->Init()); } -#if defined(DLOPEN_KERBEROS) TEST(HttpAuthGSSAPIPOSIXTest, GSSAPILoadCustomLibrary) { scoped_ptr<GSSAPILibrary> gssapi( new GSSAPISharedLibrary("/this/library/does/not/exist")); EXPECT_FALSE(gssapi.get()->Init()); } -#endif // defined(DLOPEN_KERBEROS) TEST(HttpAuthGSSAPIPOSIXTest, GSSAPICycle) { scoped_ptr<test::MockGSSAPILibrary> mock_library(new test::MockGSSAPILibrary); diff --git a/net/http/http_auth_handler_factory.cc b/net/http/http_auth_handler_factory.cc index 6a6b574..fcf2e45 100644 --- a/net/http/http_auth_handler_factory.cc +++ b/net/http/http_auth_handler_factory.cc @@ -10,11 +10,10 @@ #include "net/http/http_auth_filter.h" #include "net/http/http_auth_handler_basic.h" #include "net/http/http_auth_handler_digest.h" -#include "net/http/http_auth_handler_ntlm.h" - #if defined(USE_KERBEROS) #include "net/http/http_auth_handler_negotiate.h" #endif +#include "net/http/http_auth_handler_ntlm.h" namespace net { diff --git a/net/http/http_auth_handler_negotiate_unittest.cc b/net/http/http_auth_handler_negotiate_unittest.cc index 63eab92..1d3de4e 100644 --- a/net/http/http_auth_handler_negotiate_unittest.cc +++ b/net/http/http_auth_handler_negotiate_unittest.cc @@ -15,6 +15,7 @@ #include "net/http/mock_sspi_library_win.h" #elif defined(OS_POSIX) #include "net/http/mock_gssapi_library_posix.h" +#include "net/third_party/gssapi/gssapi.h" #endif #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -25,6 +26,7 @@ typedef net::MockSSPILibrary MockAuthLibrary; typedef net::test::MockGSSAPILibrary MockAuthLibrary; #endif + namespace net { class HttpAuthHandlerNegotiateTest : public PlatformTest { @@ -343,7 +345,6 @@ TEST_F(HttpAuthHandlerNegotiateTest, NoKerberosCredentials) { EXPECT_EQ(ERR_MISSING_AUTH_CREDENTIALS, callback.WaitForResult()); } -#if defined(DLOPEN_KERBEROS) TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) { scoped_ptr<HostResolver> host_resolver(new MockHostResolver()); MockAllowURLSecurityManager url_security_manager; @@ -365,7 +366,6 @@ TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) { EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, rv); EXPECT_TRUE(generic_handler.get() == NULL); } -#endif // defined(DLOPEN_KERBEROS) #endif // defined(OS_POSIX) diff --git a/net/http/mock_gssapi_library_posix.cc b/net/http/mock_gssapi_library_posix.cc index 6d44729..5ae4721 100644 --- a/net/http/mock_gssapi_library_posix.cc +++ b/net/http/mock_gssapi_library_posix.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "net/third_party/gssapi/gssapi.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { @@ -278,7 +279,7 @@ OM_uint32 MockGSSAPILibrary::import_name( // Save the data. output->name = BufferToString(input_name_buffer); CopyOid(&output->name_type, input_name_type); - *output_name = reinterpret_cast<gss_name_t>(output); + *output_name = output; return GSS_S_COMPLETE; } diff --git a/net/http/mock_gssapi_library_posix.h b/net/http/mock_gssapi_library_posix.h index 4109f9c..aad5de8 100644 --- a/net/http/mock_gssapi_library_posix.h +++ b/net/http/mock_gssapi_library_posix.h @@ -6,13 +6,12 @@ #define NET_HTTP_MOCK_GSSAPI_LIBRARY_POSIX_H_ #pragma once -#include <gssapi.h> - #include <list> #include <string> #include "base/gtest_prod_util.h" #include "net/http/http_auth_gssapi_posix.h" +#include "net/third_party/gssapi/gssapi.h" namespace net { diff --git a/net/net.gyp b/net/net.gyp index 8f43b69..fb55d21 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -7,7 +7,6 @@ 'chromium_code': 1, 'use_kerberos%': 1, - 'linux_link_kerberos%': 0, }, 'targets': [ { @@ -711,19 +710,6 @@ 'defines': [ 'USE_KERBEROS', ], - 'conditions': [ - ['linux_link_kerberos==1', { - 'link_settings': { - 'ldflags': [ - '<!@(krb5-config --libs gssapi)', - ], - }, - }, { # linux_link_kerberos==0 - 'defines': [ - 'DLOPEN_KERBEROS', - ], - }], - ], }, { # use_kerberos == 0 'sources!': [ 'http/http_auth_gssapi_posix.cc', |