Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_auth_gssapi_posix.h" | 5 #include "net/http/http_auth_gssapi_posix.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/thread_restrictions.h" | |
| 16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
| 18 | 19 |
| 19 // These are defined for the GSSAPI library: | 20 // These are defined for the GSSAPI library: |
| 20 // Paraphrasing the comments from gssapi.h: | 21 // Paraphrasing the comments from gssapi.h: |
| 21 // "The implementation must reserve static storage for a | 22 // "The implementation must reserve static storage for a |
| 22 // gss_OID_desc object for each constant. That constant | 23 // gss_OID_desc object for each constant. That constant |
| 23 // should be initialized to point to that gss_OID_desc." | 24 // should be initialized to point to that gss_OID_desc." |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10 | 440 "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10 |
| 440 #endif | 441 #endif |
| 441 }; | 442 }; |
| 442 library_names = kDefaultLibraryNames; | 443 library_names = kDefaultLibraryNames; |
| 443 num_lib_names = arraysize(kDefaultLibraryNames); | 444 num_lib_names = arraysize(kDefaultLibraryNames); |
| 444 } | 445 } |
| 445 | 446 |
| 446 for (size_t i = 0; i < num_lib_names; ++i) { | 447 for (size_t i = 0; i < num_lib_names; ++i) { |
| 447 const char* library_name = library_names[i]; | 448 const char* library_name = library_names[i]; |
| 448 FilePath file_path(library_name); | 449 FilePath file_path(library_name); |
| 450 | |
| 451 // TODO: Move library loading to a separate thread. BUG(66702) | |
|
cbentzel
2010/12/13 22:00:46
Nit: Use http://crbug.com/66702 rather than BUG(66
| |
| 452 base::ThreadRestrictions::ScopedAllowIO allow_io_temporarily; | |
| 453 | |
|
cbentzel
2010/12/13 22:00:46
Nit: extra newline
| |
| 449 base::NativeLibrary lib = base::LoadNativeLibrary(file_path); | 454 base::NativeLibrary lib = base::LoadNativeLibrary(file_path); |
| 455 | |
|
cbentzel
2010/12/13 22:00:46
Nit: extra newline
| |
| 450 if (lib) { | 456 if (lib) { |
| 451 // Only return this library if we can bind the functions we need. | 457 // Only return this library if we can bind the functions we need. |
| 452 if (BindMethods(lib)) | 458 if (BindMethods(lib)) |
| 453 return lib; | 459 return lib; |
| 454 base::UnloadNativeLibrary(lib); | 460 base::UnloadNativeLibrary(lib); |
| 455 } | 461 } |
| 456 } | 462 } |
| 457 LOG(WARNING) << "Unable to find a compatible GSSAPI library"; | 463 LOG(WARNING) << "Unable to find a compatible GSSAPI library"; |
| 458 return NULL; | 464 return NULL; |
| 459 } | 465 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 875 if (rv != OK) { | 881 if (rv != OK) { |
| 876 LOG(ERROR) << "Problem initializing context. \n" | 882 LOG(ERROR) << "Problem initializing context. \n" |
| 877 << DisplayExtendedStatus(library_, major_status, minor_status) | 883 << DisplayExtendedStatus(library_, major_status, minor_status) |
| 878 << '\n' | 884 << '\n' |
| 879 << DescribeContext(library_, scoped_sec_context_.get()); | 885 << DescribeContext(library_, scoped_sec_context_.get()); |
| 880 } | 886 } |
| 881 return rv; | 887 return rv; |
| 882 } | 888 } |
| 883 | 889 |
| 884 } // namespace net | 890 } // namespace net |
| OLD | NEW |