~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/libsvn_subr/deprecated.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include <assert.h>
30
30
 
 
31
#include <apr_md5.h>
 
32
 
31
33
/* We define this here to remove any further warnings about the usage of
32
34
   deprecated functions in this file. */
33
35
#define SVN_DEPRECATED
43
45
#include "svn_mergeinfo.h"
44
46
#include "svn_utf.h"
45
47
#include "svn_xml.h"
 
48
#include "svn_auth.h"
46
49
 
47
50
#include "opt.h"
 
51
#include "auth.h"
48
52
#include "private/svn_opt_private.h"
49
53
#include "private/svn_mergeinfo_private.h"
50
 
#include "private/svn_subr_private.h"
51
54
 
52
55
#include "svn_private_config.h"
53
56
 
1067
1070
                           pool));
1068
1071
}
1069
1072
 
 
1073
void
 
1074
svn_stream_set_read(svn_stream_t *stream,
 
1075
                    svn_read_fn_t read_fn)
 
1076
{
 
1077
  svn_stream_set_read2(stream, NULL /* only full read support */,
 
1078
                       read_fn);
 
1079
}
 
1080
 
 
1081
svn_error_t *
 
1082
svn_stream_read(svn_stream_t *stream,
 
1083
                char *buffer,
 
1084
                apr_size_t *len)
 
1085
{
 
1086
  return svn_error_trace(svn_stream_read_full(stream, buffer, len));
 
1087
}
 
1088
 
 
1089
struct md5_stream_baton
 
1090
{
 
1091
  const unsigned char **read_digest;
 
1092
  const unsigned char **write_digest;
 
1093
  svn_checksum_t *read_checksum;
 
1094
  svn_checksum_t *write_checksum;
 
1095
  svn_stream_t *proxy;
 
1096
  apr_pool_t *pool;
 
1097
};
 
1098
 
 
1099
static svn_error_t *
 
1100
read_handler_md5(void *baton, char *buffer, apr_size_t *len)
 
1101
{
 
1102
  struct md5_stream_baton *btn = baton;
 
1103
  return svn_error_trace(svn_stream_read2(btn->proxy, buffer, len));
 
1104
}
 
1105
 
 
1106
static svn_error_t *
 
1107
read_full_handler_md5(void *baton, char *buffer, apr_size_t *len)
 
1108
{
 
1109
  struct md5_stream_baton *btn = baton;
 
1110
  return svn_error_trace(svn_stream_read_full(btn->proxy, buffer, len));
 
1111
}
 
1112
 
 
1113
static svn_error_t *
 
1114
skip_handler_md5(void *baton, apr_size_t len)
 
1115
{
 
1116
  struct md5_stream_baton *btn = baton;
 
1117
  return svn_error_trace(svn_stream_skip(btn->proxy, len));
 
1118
}
 
1119
 
 
1120
static svn_error_t *
 
1121
write_handler_md5(void *baton, const char *buffer, apr_size_t *len)
 
1122
{
 
1123
  struct md5_stream_baton *btn = baton;
 
1124
  return svn_error_trace(svn_stream_write(btn->proxy, buffer, len));
 
1125
}
 
1126
 
 
1127
static svn_error_t *
 
1128
close_handler_md5(void *baton)
 
1129
{
 
1130
  struct md5_stream_baton *btn = baton;
 
1131
 
 
1132
  SVN_ERR(svn_stream_close(btn->proxy));
 
1133
 
 
1134
  if (btn->read_digest)
 
1135
    *btn->read_digest
 
1136
      = apr_pmemdup(btn->pool, btn->read_checksum->digest,
 
1137
                    APR_MD5_DIGESTSIZE);
 
1138
 
 
1139
  if (btn->write_digest)
 
1140
    *btn->write_digest
 
1141
      = apr_pmemdup(btn->pool, btn->write_checksum->digest,
 
1142
                    APR_MD5_DIGESTSIZE);
 
1143
 
 
1144
  return SVN_NO_ERROR;
 
1145
}
 
1146
 
 
1147
 
 
1148
svn_stream_t *
 
1149
svn_stream_checksummed(svn_stream_t *stream,
 
1150
                       const unsigned char **read_digest,
 
1151
                       const unsigned char **write_digest,
 
1152
                       svn_boolean_t read_all,
 
1153
                       apr_pool_t *pool)
 
1154
{
 
1155
  svn_stream_t *s;
 
1156
  struct md5_stream_baton *baton;
 
1157
 
 
1158
  if (! read_digest && ! write_digest)
 
1159
    return stream;
 
1160
 
 
1161
  baton = apr_palloc(pool, sizeof(*baton));
 
1162
  baton->read_digest = read_digest;
 
1163
  baton->write_digest = write_digest;
 
1164
  baton->pool = pool;
 
1165
 
 
1166
  /* Set BATON->proxy to a stream that will fill in BATON->read_checksum
 
1167
   * and BATON->write_checksum (if we want them) when it is closed. */
 
1168
  baton->proxy
 
1169
    = svn_stream_checksummed2(stream,
 
1170
                              read_digest ? &baton->read_checksum : NULL,
 
1171
                              write_digest ? &baton->write_checksum : NULL,
 
1172
                              svn_checksum_md5,
 
1173
                              read_all, pool);
 
1174
 
 
1175
  /* Create a stream that will forward its read/write/close operations to
 
1176
   * BATON->proxy and will fill in *READ_DIGEST and *WRITE_DIGEST (if we
 
1177
   * want them) after it closes BATON->proxy. */
 
1178
  s = svn_stream_create(baton, pool);
 
1179
  svn_stream_set_read2(s, read_handler_md5, read_full_handler_md5);
 
1180
  svn_stream_set_skip(s, skip_handler_md5);
 
1181
  svn_stream_set_write(s, write_handler_md5);
 
1182
  svn_stream_set_close(s, close_handler_md5);
 
1183
  return s;
 
1184
}
 
1185
 
1070
1186
/*** From path.c ***/
1071
1187
 
1072
1188
const char *
1253
1369
  svn_xml_make_header2(str, NULL, pool);
1254
1370
}
1255
1371
 
 
1372
 
 
1373
/*** From utf.c ***/
1256
1374
void
1257
1375
svn_utf_initialize(apr_pool_t *pool)
1258
1376
{
1260
1378
}
1261
1379
 
1262
1380
svn_error_t *
 
1381
svn_utf_cstring_from_utf8_ex(const char **dest,
 
1382
                             const char *src,
 
1383
                             const char *topage,
 
1384
                             const char *convset_key,
 
1385
                             apr_pool_t *pool)
 
1386
{
 
1387
  return svn_utf_cstring_from_utf8_ex2(dest, src, topage, pool);
 
1388
}
 
1389
 
 
1390
/*** From error.c ***/
 
1391
void
 
1392
svn_handle_error(svn_error_t *err, FILE *stream, svn_boolean_t fatal)
 
1393
{
 
1394
  svn_handle_error2(err, stream, fatal, "svn: ");
 
1395
}
 
1396
 
 
1397
void
 
1398
svn_handle_warning(FILE *stream, svn_error_t *err)
 
1399
{
 
1400
  svn_handle_warning2(stream, err, "svn: ");
 
1401
}
 
1402
 
 
1403
 
 
1404
/*** From subst.c ***/
 
1405
svn_error_t *
1263
1406
svn_subst_build_keywords(svn_subst_keywords_t *kw,
1264
1407
                         const char *keywords_val,
1265
1408
                         const char *rev,
1309
1452
{
1310
1453
  return svn_ver_check_list2(my_version, checklist, svn_ver_compatible);
1311
1454
}
 
1455
 
 
1456
/*** From win32_crypto.c ***/
 
1457
#if defined(WIN32) && !defined(__MINGW32__)
 
1458
void
 
1459
svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
 
1460
                                     apr_pool_t *pool)
 
1461
{
 
1462
  svn_auth__get_windows_simple_provider(provider, pool);
 
1463
}
 
1464
 
 
1465
void
 
1466
svn_auth_get_windows_ssl_client_cert_pw_provider
 
1467
   (svn_auth_provider_object_t **provider,
 
1468
    apr_pool_t *pool)
 
1469
{
 
1470
  svn_auth__get_windows_ssl_client_cert_pw_provider(provider, pool);
 
1471
}
 
1472
 
 
1473
void
 
1474
svn_auth_get_windows_ssl_server_trust_provider
 
1475
  (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 
1476
{
 
1477
  svn_auth__get_windows_ssl_server_trust_provider(provider, pool);
 
1478
}
 
1479
#endif /* WIN32 && !__MINGW32__ */
 
1480
 
 
1481
/*** From macos_keychain.c ***/
 
1482
#if defined(DARWIN)
 
1483
void
 
1484
svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
 
1485
                                      apr_pool_t *pool)
 
1486
{
 
1487
  svn_auth__get_keychain_simple_provider(provider, pool);
 
1488
}
 
1489
 
 
1490
void
 
1491
svn_auth_get_keychain_ssl_client_cert_pw_provider
 
1492
  (svn_auth_provider_object_t **provider,
 
1493
   apr_pool_t *pool)
 
1494
{
 
1495
  svn_auth__get_keychain_ssl_client_cert_pw_provider(provider, pool);
 
1496
}
 
1497
#endif /* DARWIN */
 
1498
 
 
1499
#if !defined(WIN32)
 
1500
void
 
1501
svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
 
1502
                                       apr_pool_t *pool)
 
1503
{
 
1504
  svn_auth__get_gpg_agent_simple_provider(provider, pool);
 
1505
}
 
1506
#endif /* !WIN32 */
 
1507
 
 
1508
svn_error_t *
 
1509
svn_cmdline_create_auth_baton(svn_auth_baton_t **ab,
 
1510
                              svn_boolean_t non_interactive,
 
1511
                              const char *auth_username,
 
1512
                              const char *auth_password,
 
1513
                              const char *config_dir,
 
1514
                              svn_boolean_t no_auth_cache,
 
1515
                              svn_boolean_t trust_server_cert,
 
1516
                              svn_config_t *cfg,
 
1517
                              svn_cancel_func_t cancel_func,
 
1518
                              void *cancel_baton,
 
1519
                              apr_pool_t *pool)
 
1520
{
 
1521
  return svn_error_trace(svn_cmdline_create_auth_baton2(ab,
 
1522
                                                        non_interactive,
 
1523
                                                        auth_username,
 
1524
                                                        auth_password,
 
1525
                                                        config_dir,
 
1526
                                                        no_auth_cache,
 
1527
                                                        trust_server_cert,
 
1528
                                                        FALSE,
 
1529
                                                        FALSE,
 
1530
                                                        FALSE,
 
1531
                                                        FALSE,
 
1532
                                                        cfg,
 
1533
                                                        cancel_func,
 
1534
                                                        cancel_baton,
 
1535
                                                        pool));
 
1536
}