~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to subversion/libsvn_subr/auth.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * auth.c: authentication support functions for Subversion
3
3
 *
4
4
 * ====================================================================
5
 
 * Copyright (c) 2000-2009 CollabNet.  All rights reserved.
6
 
 *
7
 
 * This software is licensed as described in the file COPYING, which
8
 
 * you should have received as part of this distribution.  The terms
9
 
 * are also available at http://subversion.tigris.org/license-1.html.
10
 
 * If newer versions of this license are posted there, you may use a
11
 
 * newer version instead, at your option.
12
 
 *
13
 
 * This software consists of voluntary contributions made by many
14
 
 * individuals.  For exact contribution history, see the revision
15
 
 * history and logs, available at http://subversion.tigris.org/.
 
5
 *    Licensed to the Apache Software Foundation (ASF) under one
 
6
 *    or more contributor license agreements.  See the NOTICE file
 
7
 *    distributed with this work for additional information
 
8
 *    regarding copyright ownership.  The ASF licenses this file
 
9
 *    to you under the Apache License, Version 2.0 (the
 
10
 *    "License"); you may not use this file except in compliance
 
11
 *    with the License.  You may obtain a copy of the License at
 
12
 *
 
13
 *      http://www.apache.org/licenses/LICENSE-2.0
 
14
 *
 
15
 *    Unless required by applicable law or agreed to in writing,
 
16
 *    software distributed under the License is distributed on an
 
17
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
18
 *    KIND, either express or implied.  See the License for the
 
19
 *    specific language governing permissions and limitations
 
20
 *    under the License.
16
21
 * ====================================================================
17
22
 */
18
23
 
28
33
#include "svn_config.h"
29
34
#include "svn_private_config.h"
30
35
#include "svn_dso.h"
 
36
#include "svn_version.h"
31
37
 
32
38
/* The good way to think of this machinery is as a set of tables.
33
39
 
55
61
 
56
62
/* This effectively defines a single table.  Every provider in this
57
63
   array returns the same kind of credentials. */
58
 
typedef struct
 
64
typedef struct provider_set_t
59
65
{
60
66
  /* ordered array of svn_auth_provider_object_t */
61
67
  apr_array_header_t *providers;
96
102
 
97
103
void
98
104
svn_auth_open(svn_auth_baton_t **auth_baton,
99
 
              apr_array_header_t *providers,
 
105
              const apr_array_header_t *providers,
100
106
              apr_pool_t *pool)
101
107
{
102
108
  svn_auth_baton_t *ab;
178
184
  table = apr_hash_get(auth_baton->tables, cred_kind, APR_HASH_KEY_STRING);
179
185
  if (! table)
180
186
    return svn_error_createf(SVN_ERR_AUTHN_NO_PROVIDER, NULL,
181
 
                             "No provider registered for '%s' credentials",
 
187
                             _("No provider registered for '%s' credentials"),
182
188
                             cred_kind);
183
189
 
184
190
  /* First, see if we have cached creds in the auth_baton. */
185
 
  cache_key = apr_pstrcat(pool, cred_kind, ":", realmstring, NULL);
 
191
  cache_key = apr_pstrcat(pool, cred_kind, ":", realmstring, (char *)NULL);
186
192
  creds = apr_hash_get(auth_baton->creds_cache,
187
193
                       cache_key, APR_HASH_KEY_STRING);
188
194
  if (creds)
410
416
                          dso,
411
417
                          version_function_name) == 0)
412
418
            {
413
 
              svn_version_func_t version_function;
414
 
              version_function = (svn_version_func_t) version_function_symbol;
 
419
              svn_version_func_t version_function
 
420
                = version_function_symbol;
415
421
              const svn_version_checklist_t check_list[] =
416
422
                {
417
423
                  { library_label, version_function },
425
431
            {
426
432
              if (strcmp(provider_type, "simple") == 0)
427
433
                {
428
 
                  svn_auth_simple_provider_func_t provider_function;
429
 
                  provider_function =
430
 
                    (svn_auth_simple_provider_func_t)
431
 
                    provider_function_symbol;
 
434
                  svn_auth_simple_provider_func_t provider_function
 
435
                    = provider_function_symbol;
432
436
                  provider_function(provider, pool);
433
437
                }
434
438
              else if (strcmp(provider_type, "ssl_client_cert_pw") == 0)
435
439
                {
436
 
                  svn_auth_ssl_client_cert_pw_provider_func_t provider_function;
437
 
                  provider_function =
438
 
                    (svn_auth_ssl_client_cert_pw_provider_func_t)
439
 
                    provider_function_symbol;
 
440
                  svn_auth_ssl_client_cert_pw_provider_func_t provider_function
 
441
                    = provider_function_symbol;
440
442
                  provider_function(provider, pool);
441
443
                }
442
444
            }