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

« back to all changes in this revision

Viewing changes to subversion/libsvn_ra_serf/getlocationsegments.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:
52
52
 
53
53
} gls_context_t;
54
54
 
55
 
enum {
56
 
  INITIAL = 0,
 
55
enum locseg_state_e {
 
56
  INITIAL = XML_STATE_INITIAL,
57
57
  REPORT,
58
58
  SEGMENT
59
59
};
84
84
  const char *path;
85
85
  const char *start_str;
86
86
  const char *end_str;
 
87
  apr_int64_t start_val;
 
88
  apr_int64_t end_val;
87
89
  svn_location_segment_t segment;
88
90
 
89
91
  SVN_ERR_ASSERT(leaving_state == SEGMENT);
95
97
  /* The transition table said these must exist.  */
96
98
  SVN_ERR_ASSERT(start_str && end_str);
97
99
 
 
100
  SVN_ERR(svn_cstring_atoi64(&start_val, start_str));
 
101
  SVN_ERR(svn_cstring_atoi64(&end_val, end_str));
 
102
 
98
103
  segment.path = path;  /* may be NULL  */
99
 
  segment.range_start = SVN_STR_TO_REV(start_str);
100
 
  segment.range_end = SVN_STR_TO_REV(end_str);
 
104
  segment.range_start = (svn_revnum_t)start_val;
 
105
  segment.range_end = (svn_revnum_t)end_val;
101
106
  SVN_ERR(gls_ctx->receiver(&segment, gls_ctx->receiver_baton, scratch_pool));
102
107
 
103
108
  return SVN_NO_ERROR;
109
114
create_gls_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
  gls_context_t *gls_ctx = baton;
119
125
  svn_ra_serf__add_open_tag_buckets(buckets, alloc,
120
126
                                    "S:get-location-segments",
121
127
                                    "xmlns:S", SVN_XML_NAMESPACE,
122
 
                                    NULL);
 
128
                                    SVN_VA_NULL);
123
129
 
124
130
  svn_ra_serf__add_tag_buckets(buckets,
125
131
                               "S:path", gls_ctx->path,
173
179
  gls_ctx->receiver_baton = receiver_baton;
174
180
 
175
181
  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
176
 
                                      session, NULL /* conn */,
177
 
                                      NULL /* url */, peg_revision,
 
182
                                      session, NULL /* url */, peg_revision,
178
183
                                      pool, pool));
179
184
 
180
185
  xmlctx = svn_ra_serf__xml_context_create(gls_ttable,
181
186
                                           NULL, gls_closed, NULL,
182
187
                                           gls_ctx,
183
188
                                           pool);
184
 
  handler = svn_ra_serf__create_expat_handler(xmlctx, pool);
 
189
  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
185
190
 
186
191
  handler->method = "REPORT";
187
192
  handler->path = req_url;
188
193
  handler->body_delegate = create_gls_body;
189
194
  handler->body_delegate_baton = gls_ctx;
190
195
  handler->body_type = "text/xml";
191
 
  handler->conn = session->conns[0];
192
 
  handler->session = session;
193
196
 
194
197
  err = svn_ra_serf__context_run_one(handler, pool);
195
198
 
196
 
  err = svn_error_compose_create(
197
 
         svn_ra_serf__error_on_status(handler->sline,
198
 
                                      handler->path,
199
 
                                      handler->location),
200
 
         err);
 
199
  if (!err)
 
200
    {
 
201
      err = svn_ra_serf__error_on_status(handler->sline,
 
202
                                         handler->path,
 
203
                                         handler->location);
 
204
    }
201
205
 
202
206
  if (err && (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))
203
207
    return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);