<br><tt><font size=2>"Daniel P. Berrange" <berrange@redhat.com>
wrote on 03/25/2010 12:40:15 PM:<br>
<br>
<br>
> Please respond to "Daniel P. Berrange"</font></tt>
<br><tt><font size=2>> <br>
> On Thu, Mar 25, 2010 at 12:26:34PM -0400, Stefan Berger wrote:<br>
> > libvir-list-bounces@redhat.com wrote on 03/25/2010 11:59:11 AM:<br>
> > <br>
> > <br>
> > > "Daniel P. Berrange" <berrange@redhat.com>
wrote on 03/25/2010 11:49:05 <br>
> > AM:<br>
> > > <br>
> > > > Please respond to "Daniel P. Berrange" <br>
> > > > <br>
> > > > On Tue, Mar 23, 2010 at 10:54:17AM -0400, stefanb@us.ibm.com
wrote:<br>
> > > > > +/*<br>
> > > > > +    char macaddr[VIR_MAC_STRING_BUFLEN],<br>
> > > > > +         ipaddr[INET_ADDRSTRLEN],<br>
> > > > > +         number[20];<br>
> > > > > +    char chain[MAX_CHAINNAME_LENGTH];<br>
> > > > > +    virBuffer buf = VIR_BUFFER_INITIALIZER;<br>
> > > > > +<br>
> > > > > +    if (nwfilter->chainsuffix ==
VIR_NWFILTER_CHAINSUFFIX_ROOT)<br>
> > > > > +        PRINT_ROOT_CHAIN(chain,
chainPrefix, ifname);<br>
> > > > > +    else<br>
> > > > > +        PRINT_CHAIN(chain,
chainPrefix, ifname,<br>
> > > > > +              
     virNWFilterChainSuffixTypeToString<br>
> > > > (nwfilter->chainsuffix));<br>
> > > > <br>
> > > > Since we're passing this into the shell, I think we
should do paranoid<br>
> > > > validation on the 'chain' and 'ifname' fields, since
they ultimately <br>
> > come<br>
> > > > from the user specified XML. Validate that it only
contains a-Z, 0-0, <br>
> > -, _ <br>
> > > <br>
> > > Actually the user specified XML only currently allows the
chain names <br>
> > 'arp', <br>
> > > 'ipv4', 'ipv6' and 'root'. Others will already be rejected
when <br>
> > > parsing the filter. <br>
> > > <br>
> > <br>
> > Actually, yes, there's a problem with target device names like
t\"t that <br>
> > do create an<br>
> > interface named t\"t but end up creating an ebtables entry
with interface <br>
> > t"t. So <br>
> > if I don't go through bash it works correctly, otherwise it does
not and I <br>
> > guess I<br>
> > would need to escape the '\' with '\\\'.<br>
> <br>
> Such interface names are insane & we should just refuse them,
rather than<br>
> trying todo escaping :-)</font></tt>
<br>
<br><tt><font size=2>Right, but at what level should they be refused? When
such names are parsed ?</font></tt>
<br>
<br><tt><font size=2>I do have a patch that does away with as much of the
external scripting as possible</font></tt>
<br><tt><font size=2>and there I don't see that problem anymore when going
directly through virRun().</font></tt>
<br><tt><font size=2>I wrote that patch on top of the others and would
submit it as a separate patch in</font></tt>
<br><tt><font size=2>the series.</font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br>
<br><tt><font size=2><br>
> <br>
> Daniel<br>
> -- <br>
> |: Red Hat, Engineering, London    -o-   </font></tt><a href=http://people.redhat.com/berrange/:|><tt><font size=2>http://people.redhat.com/berrange/:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://libvirt.org/><tt><font size=2>http://libvirt.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href="http://virt-manager.org/"><tt><font size=2>http://virt-manager.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href=http://deltacloud.org:|/><tt><font size=2>http://deltacloud.org:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://autobuild.org/><tt><font size=2>http://autobuild.org</font></tt></a><tt><font size=2>
       -o-         </font></tt><a href=http://search.cpan.org/~danberr/:|><tt><font size=2>http://search.cpan.org/~danberr/:|</font></tt></a><tt><font size=2><br>
> |: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1
B3DF F742 7D3B 9505 :|<br>
</font></tt>