Re: [virt-manager PATCH] seclabel: add a validation for security type static

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

 



On Fri, May 13, 2016 at 01:28:34PM -0400, Cole Robinson wrote:
> On 05/13/2016 01:19 PM, Pavel Hrdina wrote:
> > Commit 510d28e3 refactored the seclabel code and one check was lost.
> > Add the check back into the code.
> > 
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1298031
> > 
> > Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> > ---
> >  virtinst/seclabel.py | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/virtinst/seclabel.py b/virtinst/seclabel.py
> > index 10bf4e8..02221f0 100644
> > --- a/virtinst/seclabel.py
> > +++ b/virtinst/seclabel.py
> > @@ -87,6 +87,11 @@ class Seclabel(XMLBuilder):
> >                         default_cb=_get_default_type,
> >                         default_name=TYPE_DEFAULT)
> >  
> > +    def validate(self):
> > +        if self.type == self.TYPE_STATIC and not self.label:
> > +            raise RuntimeError(_("A label must be specified for 'static' "
> > +                                 "security type."))
> > +
> >      label = XMLProperty("./label")
> >      imagelabel = XMLProperty("./imagelabel")
> >      baselabel = XMLProperty("./baselabel")
> > 
> 
> Hmm I think the bug is WONTFIX, since this just duplicates an explicit error
> that libvirt will already throw for us. Yes it's slightly more annoying for
> the user since virt-install will fully set up the VM before reporting the
> error, but that's the case with hundreds of other validation checks.
> 
> The only time bits like this are really important IMO is if a) it's via the
> virt-manager UI and we want to use the validation check to block an action
> early, or b) it's a really common misconfiguration. Neither cover this case
> 
> Thanks,
> Cole

I'm OK with WONTFIX, it was really easy patch, so I sent it anyway.  I'll close
that bug.

Thanks,
Pavel

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux