[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] xml: omit domain name from comment if it contains double hyphen



On 10/23/2012 09:31 AM, Daniel P. Berrange wrote:
> On Tue, Oct 23, 2012 at 02:16:44PM +0200, Ján Tomko wrote:
>> We put a comment containing "virsh edit <domain_name>" at the start of
>> the XML. W3C recommendation forbids the use of "--" in comments [1] and
>> libvirt can't parse it either. This patch omits the domain name if it
>> contains a double hyphen.
> 
> I'd really rather that we properly escaped the data rather than
> just dropping it.

Since the whole point of that comment is intended to give the user
something they can paste into their shell, we could just escape it by
doing: s/--/-''-/.  And for that to work, we'd also need to shell-escape
any other metacharacters in the domain name, so that the entire line is
something that can easily be copied and pasted.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]