You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Antoine Pitrou <so...@pitrou.net> on 2007/08/08 11:05:03 UTC

[Fwd: [bug] "svn log" can output invalid XML]

Can someone confirm this is a bug so I can enter it in the issue
tracker ?



-------- Message transféré --------
De: Antoine Pitrou <so...@pitrou.net>
À: dev@subversion.tigris.org
Sujet: [bug] "svn log" can output invalid XML
Date: Mon, 06 Aug 2007 14:55:48 +0200

Hi,

I've found that SVN can output some invalid XML with the log command. It
happens when e.g. a commit message contains control characters. Those
control characters are valid UTF-8 but are not allowed by the XML spec
(XML only allows control characters 0x9, 0xA and 0xD : see
http://www.w3.org/TR/REC-xml/#charsets ).

This is a concrete example from an existing repository:

svn log --xml -r 1722 svn://exaile.org/usr/local/svn/exaile/trunk | xmllint -

The only solution I can think of is to completely strip those control
characters when an XML output is desired.

Regards

Antoine.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Fwd: [bug] "svn log" can output invalid XML]

Posted by Julian Reschke <ju...@gmx.de>.
Antoine Pitrou wrote:
> Can someone confirm this is a bug so I can enter it in the issue
> tracker ?

I can confirm that svn definitively emits broken XML here.

Best regards, Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Fwd: [bug] "svn log" can output invalid XML]

Posted by "C. Michael Pilato" <cm...@collab.net>.
Ben Collins-Sussman wrote:
> The bug here is that control characters are in your log message.  Long
> long ago, we prevented control characters from entering the
> repository;  they're illegal in repository filenames, and illegal in
> repository log messages as well.  The repository should be rejecting
> the invalid data.

That's not actually true.  The filesystem backend has no reason to reject
control characters -- it treats property values as opaque blobs of data --
and therefore does no such "protective" work.  And as far as I can tell, the
only validation performed by the repository layer is that property names
with "svn:" prefixes don't fall in the "svn:wc:" or other "non-regular"
property namespaces.

This protection is provided, IIRC, by the client libraries.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [Fwd: [bug] "svn log" can output invalid XML]

Posted by Antoine Pitrou <so...@pitrou.net>.
Hi,

Le mercredi 08 août 2007 à 11:09 -0500, Ben Collins-Sussman a écrit :
> The bug here is that control characters are in your log message.  Long
> long ago, we prevented control characters from entering the
> repository;  they're illegal in repository filenames, and illegal in
> repository log messages as well.  The repository should be rejecting
> the invalid data.
> 
> So the real bug here isn't "how should we fix the XML?";  the bug "how
> did you get control characters into your log message in the first
> place?"

I don't know, this error was reported to me by an hgsvn user. I don't
myself use the aforementioned repository.

(by the way, I posted the bug in the issue tracker just before receiving
your message. Sorry for the confusion)

Regards

Antoine.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Fwd: [bug] "svn log" can output invalid XML]

Posted by Ben Collins-Sussman <su...@red-bean.com>.
The bug here is that control characters are in your log message.  Long
long ago, we prevented control characters from entering the
repository;  they're illegal in repository filenames, and illegal in
repository log messages as well.  The repository should be rejecting
the invalid data.

So the real bug here isn't "how should we fix the XML?";  the bug "how
did you get control characters into your log message in the first
place?"


On 8/8/07, Antoine Pitrou <so...@pitrou.net> wrote:
>
> Can someone confirm this is a bug so I can enter it in the issue
> tracker ?
>
>
>
> -------- Message transféré --------
> De: Antoine Pitrou <so...@pitrou.net>
> À: dev@subversion.tigris.org
> Sujet: [bug] "svn log" can output invalid XML
> Date: Mon, 06 Aug 2007 14:55:48 +0200
>
> Hi,
>
> I've found that SVN can output some invalid XML with the log command. It
> happens when e.g. a commit message contains control characters. Those
> control characters are valid UTF-8 but are not allowed by the XML spec
> (XML only allows control characters 0x9, 0xA and 0xD : see
> http://www.w3.org/TR/REC-xml/#charsets ).
>
> This is a concrete example from an existing repository:
>
> svn log --xml -r 1722 svn://exaile.org/usr/local/svn/exaile/trunk | xmllint -
>
> The only solution I can think of is to completely strip those control
> characters when an XML output is desired.
>
> Regards
>
> Antoine.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org