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

« back to all changes in this revision

Viewing changes to subversion/libsvn_repos/reporter.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:
495
495
      /* Create a result object */
496
496
      info = apr_palloc(b->pool, sizeof(*info));
497
497
      info->rev = rev;
498
 
      info->date = cdate ? svn_string_dup(cdate, b->pool) : NULL;
499
 
      info->author = author ? svn_string_dup(author, b->pool) : NULL;
 
498
      info->date = svn_string_dup(cdate, b->pool);
 
499
      info->author = svn_string_dup(author, b->pool);
500
500
 
501
501
      /* Cache it */
502
 
      apr_hash_set(b->revision_infos, &info->rev, sizeof(rev), info);
 
502
      apr_hash_set(b->revision_infos, &info->rev, sizeof(info->rev), info);
503
503
    }
504
504
 
505
505
  *revision_info = info;
576
576
      SVN_ERR(get_source_root(b, &s_root, s_rev));
577
577
 
578
578
      /* Is this deltification worth our time? */
579
 
      SVN_ERR(svn_fs_props_changed(&changed, b->t_root, t_path, s_root,
580
 
                                   s_path, pool));
 
579
      SVN_ERR(svn_fs_props_different(&changed, b->t_root, t_path, s_root,
 
580
                                     s_path, pool));
581
581
      if (! changed)
582
582
        return SVN_NO_ERROR;
583
583
 
603
603
      /* So source, i.e. all new.  Transmit all target props. */
604
604
      for (hi = apr_hash_first(pool, t_props); hi; hi = apr_hash_next(hi))
605
605
        {
606
 
          const void *key;
607
 
          void *val;
 
606
          const char *key = apr_hash_this_key(hi);
 
607
          svn_string_t *val = apr_hash_this_val(hi);
608
608
 
609
 
          apr_hash_this(hi, &key, NULL, &val);
610
609
          SVN_ERR(change_fn(b, object, key, val, pool));
611
610
        }
612
611
    }
842
841
         starting with '/', so make sure o_path always starts with a '/'
843
842
         too. */
844
843
      if (*o_path != '/')
845
 
        o_path = apr_pstrcat(pool, "/", o_path, (char *)NULL);
 
844
        o_path = apr_pstrcat(pool, "/", o_path, SVN_VA_NULL);
846
845
 
847
846
      SVN_ERR(svn_fs_closest_copy(&closest_copy_root, &closest_copy_path,
848
847
                                  b->t_root, o_path, pool));
1140
1139
           svn_boolean_t start_empty, svn_depth_t wc_depth,
1141
1140
           svn_depth_t requested_depth, apr_pool_t *pool)
1142
1141
{
1143
 
  svn_fs_root_t *s_root;
1144
1142
  apr_hash_t *s_entries = NULL, *t_entries;
1145
1143
  apr_hash_index_t *hi;
1146
1144
  apr_pool_t *subpool = svn_pool_create(pool);
1147
 
  apr_pool_t *iterpool;
1148
 
  const char *name, *s_fullpath, *t_fullpath, *e_fullpath;
1149
 
  path_info_t *info;
 
1145
  apr_array_header_t *t_ordered_entries = NULL;
 
1146
  int i;
1150
1147
 
1151
1148
  /* Compare the property lists.  If we're starting empty, pass a NULL
1152
1149
     source path so that we add all the properties.
1159
1156
  if (requested_depth > svn_depth_empty
1160
1157
      || requested_depth == svn_depth_unknown)
1161
1158
    {
 
1159
      apr_pool_t *iterpool;
 
1160
 
1162
1161
      /* Get the list of entries in each of source and target. */
1163
1162
      if (s_path && !start_empty)
1164
1163
        {
 
1164
          svn_fs_root_t *s_root;
 
1165
 
1165
1166
          SVN_ERR(get_source_root(b, &s_root, s_rev));
1166
1167
          SVN_ERR(svn_fs_dir_entries(&s_entries, s_root, s_path, subpool));
1167
1168
        }
1168
1169
      SVN_ERR(svn_fs_dir_entries(&t_entries, b->t_root, t_path, subpool));
1169
1170
 
1170
1171
      /* Iterate over the report information for this directory. */
1171
 
      iterpool = svn_pool_create(pool);
 
1172
      iterpool = svn_pool_create(subpool);
1172
1173
 
1173
1174
      while (1)
1174
1175
        {
 
1176
          path_info_t *info;
 
1177
          const char *name, *s_fullpath, *t_fullpath, *e_fullpath;
1175
1178
          const svn_fs_dirent_t *s_entry, *t_entry;
1176
1179
 
1177
1180
          svn_pool_clear(iterpool);
1192
1195
                 but don't update the entry yet. */
1193
1196
              if (s_entries)
1194
1197
                svn_hash_sets(s_entries, name, NULL);
 
1198
 
 
1199
              svn_pool_destroy(info->pool);
1195
1200
              continue;
1196
1201
            }
1197
1202
 
1199
1204
          t_fullpath = svn_fspath__join(t_path, name, iterpool);
1200
1205
          t_entry = svn_hash_gets(t_entries, name);
1201
1206
          s_fullpath = s_path ? svn_fspath__join(s_path, name, iterpool) : NULL;
1202
 
          s_entry = s_entries ?
1203
 
            svn_hash_gets(s_entries, name) : NULL;
 
1207
          s_entry = s_entries ? svn_hash_gets(s_entries, name) : NULL;
1204
1208
 
1205
 
          /* The only special cases here are
 
1209
          /* The only special cases where we don't process the entry are
1206
1210
 
1207
1211
             - When requested_depth is files but the reported path is
1208
1212
             a directory.  This is technically a client error, but we
1210
1214
 
1211
1215
             - When the reported depth is svn_depth_exclude.
1212
1216
          */
1213
 
          if ((! info || info->depth != svn_depth_exclude)
1214
 
              && (requested_depth != svn_depth_files
1215
 
                  || ((! t_entry || t_entry->kind != svn_node_dir)
1216
 
                      && (! s_entry || s_entry->kind != svn_node_dir))))
 
1217
          if (! ((requested_depth == svn_depth_files
 
1218
                  && ((t_entry && t_entry->kind == svn_node_dir)
 
1219
                      || (s_entry && s_entry->kind == svn_node_dir)))
 
1220
                 || (info && info->depth == svn_depth_exclude)))
1217
1221
            SVN_ERR(update_entry(b, s_rev, s_fullpath, s_entry, t_fullpath,
1218
1222
                                 t_entry, dir_baton, e_fullpath, info,
1219
1223
                                 info ? info->depth
1242
1246
               hi;
1243
1247
               hi = apr_hash_next(hi))
1244
1248
            {
1245
 
              const svn_fs_dirent_t *s_entry;
 
1249
              const svn_fs_dirent_t *s_entry = apr_hash_this_val(hi);
1246
1250
 
1247
1251
              svn_pool_clear(iterpool);
1248
 
              s_entry = svn__apr_hash_index_val(hi);
1249
1252
 
1250
1253
              if (svn_hash_gets(t_entries, s_entry->name) == NULL)
1251
1254
                {
 
1255
                  const char *e_fullpath;
1252
1256
                  svn_revnum_t deleted_rev;
1253
1257
 
1254
1258
                  if (s_entry->kind == svn_node_file
1277
1281
        }
1278
1282
 
1279
1283
      /* Loop over the dirents in the target. */
1280
 
      for (hi = apr_hash_first(subpool, t_entries);
1281
 
           hi;
1282
 
           hi = apr_hash_next(hi))
 
1284
      SVN_ERR(svn_fs_dir_optimal_order(&t_ordered_entries, b->t_root,
 
1285
                                       t_entries, subpool, iterpool));
 
1286
      for (i = 0; i < t_ordered_entries->nelts; ++i)
1283
1287
        {
1284
 
          const svn_fs_dirent_t *s_entry, *t_entry;
 
1288
          const svn_fs_dirent_t *t_entry
 
1289
             = APR_ARRAY_IDX(t_ordered_entries, i, svn_fs_dirent_t *);
 
1290
          const svn_fs_dirent_t *s_entry;
 
1291
          const char *s_fullpath, *t_fullpath, *e_fullpath;
1285
1292
 
1286
1293
          svn_pool_clear(iterpool);
1287
 
          t_entry = svn__apr_hash_index_val(hi);
1288
1294
 
1289
1295
          if (is_depth_upgrade(wc_depth, requested_depth, t_entry->kind))
1290
1296
            {
1305
1311
                      || requested_depth == svn_depth_files))
1306
1312
                continue;
1307
1313
 
1308
 
              /* Look for an entry with the same name
1309
 
                 in the source dirents. */
 
1314
              /* Look for an entry with the same name in the source dirents. */
1310
1315
              s_entry = s_entries ?
1311
 
                  svn_hash_gets(s_entries, t_entry->name)
1312
 
                  : NULL;
 
1316
                  svn_hash_gets(s_entries, t_entry->name) : NULL;
1313
1317
              s_fullpath = s_entry ?
1314
1318
                  svn_fspath__join(s_path, t_entry->name, iterpool) : NULL;
1315
1319
            }
1325
1329
                               iterpool));
1326
1330
        }
1327
1331
 
1328
 
 
1329
 
      /* Destroy iteration subpool. */
1330
 
      svn_pool_destroy(iterpool);
 
1332
      /* iterpool is destroyed by destroying its parent (subpool) below */
1331
1333
    }
1332
1334
 
1333
1335
  svn_pool_destroy(subpool);