[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Regression in dirent_walker with malformed DAV responses

From: James McCoy <jamessan_at_debian.org>
Date: Sat, 1 Nov 2014 14:27:22 -0400

As described in [0], SVN::Ra::get_dir errors out with

  Incorrect parameters given: Could not convert '%ld' into a number at /path/to/scriptname line X

with certain servers.

[0]: https://bugs.debian.org/767530

This can also be demonstrated with a simple ls command -- svn ls
http://www.virtualbox.org/svn/vbox/trunk/COPYING. The problem is that
the server is responding to a PROPFIND request on the file with a
malformed getcontentlength node:

PROPFIND /svn/vbox/!svn/bc/53112/trunk/COPYING HTTP/1.1
Host: www.virtualbox.org
User-Agent: SVN/1.8.10 (x86_64-pc-linux-gnu) serf/1.3.7
Content-Type: text/xml
Accept-Encoding: gzip
DAV: http://subversion.tigris.org/xmlns/dav/svn/depth
DAV: http://subversion.tigris.org/xmlns/dav/svn/mergeinfo
DAV: http://subversion.tigris.org/xmlns/dav/svn/log-revprops
Depth: 0
Transfer-Encoding: chunked

12d
<?xml version="1.0" encoding="utf-8"?><propfind xmlns="DAV:"><prop><resourcetype xmlns="DAV:"/><getcontentlength xmlns="DAV:"/><deadprop-count xmlns="http://subversion.tigris.org/xmlns/dav/"/><version-name xmlns="DAV:"/><creationdate xmlns="DAV:"/><creator-displayname xmlns="DAV:"/></prop></propfind>
0

HTTP/1.1 207 Multi-Status
Date: Sat, 01 Nov 2014 03:59:48 GMT
Server: Oracle-Application-Server-11g
Content-Length: 670
Content-Type: text/xml; charset="utf-8"
Content-Language: en

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:ns1="http://subversion.tigris.org/xmlns/dav/" xmlns:ns0="DAV:">
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">
<D:href>/svn/vbox/!svn/bc/53112/trunk/COPYING</D:href>
<D:propstat>
<D:prop>
<lp1:resourcetype/>
<lp1:getcontentlength>%ld</lp1:getcontentlength>
<lp2:deadprop-count>1</lp2:deadprop-count>
<lp1:version-name>35198</lp1:version-name>
<lp1:creationdate>2010-12-16T16:24:25.075872Z</lp1:creationdate>
<lp1:creator-displayname>vboxsync</lp1:creator-displayname>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>

This "worked" prior to 1.7 because apr_atoi64 was less stringent about
conversion errors. r993183 introduced svn_cstring_strtoi64 which now
fails converting '%ld' to a number instead of treating it as 0.

This was noticed because it breaks git-svn[1], although there is a
proposed[2] workaround. While this is definitely a bug in whatever's
sending the bad property value, it would be nice to gracefully handle
this as was happening pre-1.7 (albeit intentional this time rather than
accidental), but at the very least better error reporting would be
useful here.

[1]: http://article.gmane.org/gmane.comp.version-control.git/258842
[2]: http://article.gmane.org/gmane.comp.version-control.git/258935

Cheers,

-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan_at_debian.org>

Received on 2014-11-01 19:24:58 CET

This is an archived mail posted to the Subversion Dev mailing list.