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

Re: [PATCH] fix for unescaped etag in mod dav checkout.

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-10-25 20:42:46 CEST

Is this patch from Clark Rawlins still applicable, or has the problem
been solved a different way? I have a feeling this got solved
already, but I'm not positive and wasn't sure from the logs.

His original message is quoted below, and also here's the same
message's URL in the archives, in case anyone wants to follow the
whole thread there (Philip followed up, for one):

   http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=22345

Thanks,
-Karl

Clark Rawlins <clark@bit63.org> writes:
> This small patch fixes a problem where etags sometimes can contain
> unescaped & characters.
>
> To reproduce:
> svnadmin create test
> {configure apache to use test as a repos}
> svn co http://localhost/svn/test
> cd test
> touch test\&test
> svn add test\&test
> svn commit -m "Add file with an ampersand in the name."
> cd ..
> rm -rf test
> svn co http://localhost/svn/test
> XML parse error here!
>
> This five line patch fixes the problem.
>
>
> Index: repos.c
> ===================================================================
> --- repos.c
> +++ repos.c 2002-09-26 22:27:44.000000000 -0500
> @@ -1597,6 +1597,7 @@
> {
> svn_error_t *serr;
> svn_revnum_t created_rev;
> + const char *quoted_path;
>
> /* if the resource doesn't exist, isn't a simple REGULAR or VERSION
> resource, or it is a Baseline, then it has no etag. */
> @@ -1616,9 +1617,12 @@
> /* ### what to do? */
> return "";
> }
> +
> + quoted_path = apr_xml_quote_string(resource->pool,
> + resource->info->repos_path, 1);
>
> return apr_psprintf(resource->pool, "\"%" SVN_REVNUM_T_FMT "/%s\"",
> - created_rev, resource->info->repos_path);
> + created_rev, quoted_path);
> }
>
> static dav_error * dav_svn_set_headers(request_rec *r,
> --
> "They that can give up essential liberty to obtain a little temporary safety
> deserve neither liberty nor safety."
> - Benjamin Franklin, Historical Review of Pennsylvania, 1759.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 25 21:13:19 2002

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.