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

« back to all changes in this revision

Viewing changes to subversion/libsvn_auth_kwallet/kwallet.cpp

  • 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
 * kwallet.cpp: KWallet provider for SVN_AUTH_CRED_*
3
3
 *
4
4
 * ====================================================================
5
 
 * Copyright (c) 2008-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
 
22
27
 
23
28
/*** Includes. ***/
24
29
 
 
30
#include <stdlib.h>
25
31
#include <string.h>
26
32
#include <unistd.h>
27
33
 
30
36
#include "svn_auth.h"
31
37
#include "svn_config.h"
32
38
#include "svn_error.h"
 
39
#include "svn_io.h"
 
40
#include "svn_pools.h"
 
41
#include "svn_string.h"
33
42
#include "svn_version.h"
34
43
 
35
44
#include "private/svn_auth_private.h"
69
78
  const char *svn_application_name;
70
79
  if (svn_application_name_with_pid)
71
80
    {
72
 
      long pid = getpid();
73
 
      svn_application_name = apr_psprintf(pool, "Subversion [%ld]", pid);
 
81
      svn_application_name = apr_psprintf(pool, "Subversion [%ld]", long(getpid()));
74
82
    }
75
83
  else
76
84
    {
102
110
    }
103
111
}
104
112
 
 
113
static WId
 
114
get_wid(void)
 
115
{
 
116
  WId wid = 1;
 
117
  const char *wid_env_string = getenv("WINDOWID");
 
118
 
 
119
  if (wid_env_string)
 
120
    {
 
121
      apr_int64_t wid_env;
 
122
      svn_error_t *err;
 
123
 
 
124
      err = svn_cstring_atoi64(&wid_env, wid_env_string);
 
125
      if (err)
 
126
        svn_error_clear(err);
 
127
      else
 
128
        wid = (WId)wid_env;
 
129
    }
 
130
 
 
131
  return wid;
 
132
}
 
133
 
105
134
static KWallet::Wallet *
106
135
get_wallet(QString wallet_name,
107
136
           apr_hash_t *parameters)
114
143
                                 "kwallet-opening-failed",
115
144
                                 APR_HASH_KEY_STRING))
116
145
    {
117
 
      wallet = KWallet::Wallet::openWallet(wallet_name,
118
 
                                           -1,
 
146
      wallet = KWallet::Wallet::openWallet(wallet_name, get_wid(),
119
147
                                           KWallet::Wallet::Synchronous);
120
148
    }
121
149
  if (wallet)
399
427
};
400
428
 
401
429
/* Public API */
 
430
extern "C" {
402
431
void
403
432
svn_auth_get_kwallet_ssl_client_cert_pw_provider
404
433
    (svn_auth_provider_object_t **provider,
410
439
  po->vtable = &kwallet_ssl_client_cert_pw_provider;
411
440
  *provider = po;
412
441
}
 
442
}