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

« back to all changes in this revision

Viewing changes to subversion/libsvn_ra_serf/getlocations.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:
43
43
 * This enum represents the current state of our XML parsing for a REPORT.
44
44
 */
45
45
enum loc_state_e {
46
 
  INITIAL = 0,
 
46
  INITIAL = XML_STATE_INITIAL,
47
47
  REPORT,
48
48
  LOCATION
49
49
};
94
94
  path = svn_hash_gets(attrs, "path");
95
95
  if (revstr != NULL && path != NULL)
96
96
    {
97
 
      svn_revnum_t rev = SVN_STR_TO_REV(revstr);
 
97
      apr_int64_t rev_val;
 
98
      svn_revnum_t rev;
 
99
 
 
100
      SVN_ERR(svn_cstring_atoi64(&rev_val, revstr));
 
101
      rev = (svn_revnum_t)rev_val;
 
102
 
98
103
      apr_hash_set(loc_ctx->paths,
99
104
                   apr_pmemdup(loc_ctx->pool, &rev, sizeof(rev)), sizeof(rev),
100
105
                   apr_pstrdup(loc_ctx->pool, path));
109
114
create_get_locations_body(serf_bucket_t **body_bkt,
110
115
                          void *baton,
111
116
                          serf_bucket_alloc_t *alloc,
112
 
                          apr_pool_t *pool)
 
117
                          apr_pool_t *pool /* request pool */,
 
118
                          apr_pool_t *scratch_pool)
113
119
{
114
120
  serf_bucket_t *buckets;
115
121
  loc_context_t *loc_ctx = baton;
121
127
                                    "S:get-locations",
122
128
                                    "xmlns:S", SVN_XML_NAMESPACE,
123
129
                                    "xmlns:D", "DAV:",
124
 
                                    NULL);
 
130
                                    SVN_VA_NULL);
125
131
 
126
132
  svn_ra_serf__add_tag_buckets(buckets,
127
133
                               "S:path", loc_ctx->path,
159
165
  svn_ra_serf__handler_t *handler;
160
166
  svn_ra_serf__xml_context_t *xmlctx;
161
167
  const char *req_url;
162
 
  svn_error_t *err;
163
168
 
164
169
  loc_ctx = apr_pcalloc(pool, sizeof(*loc_ctx));
165
170
  loc_ctx->pool = pool;
171
176
  *locations = loc_ctx->paths;
172
177
 
173
178
  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
174
 
                                      session, NULL /* conn */,
175
 
                                      NULL /* url */, peg_revision,
 
179
                                      session,  NULL /* url */, peg_revision,
176
180
                                      pool, pool));
177
181
 
178
182
  xmlctx = svn_ra_serf__xml_context_create(getloc_ttable,
179
183
                                           NULL, getloc_closed, NULL,
180
184
                                           loc_ctx,
181
185
                                           pool);
182
 
  handler = svn_ra_serf__create_expat_handler(xmlctx, pool);
 
186
  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
183
187
 
184
188
  handler->method = "REPORT";
185
189
  handler->path = req_url;
186
190
  handler->body_delegate = create_get_locations_body;
187
191
  handler->body_delegate_baton = loc_ctx;
188
192
  handler->body_type = "text/xml";
189
 
  handler->conn = session->conns[0];
190
 
  handler->session = session;
191
 
 
192
 
  err = svn_ra_serf__context_run_one(handler, pool);
193
 
 
194
 
  SVN_ERR(svn_error_compose_create(
195
 
              svn_ra_serf__error_on_status(handler->sline,
196
 
                                           req_url,
197
 
                                           handler->location),
198
 
              err));
 
193
 
 
194
  SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
195
 
 
196
  SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
 
197
                                       handler->path,
 
198
                                       handler->location));
199
199
 
200
200
  return SVN_NO_ERROR;
201
201
}