[apparmor] [patch 4/3] hide raw_rule within parse class method

Christian Boltz apparmor at cboltz.de
Wed Dec 17 00:19:43 UTC 2014


Hello,

Am Dienstag, 16. Dezember 2014 schrieb Steve Beattie:
> On Tue, Dec 09, 2014 at 05:20:39PM +0100, Christian Boltz wrote:

> > > --- a/utils/apparmor/rule/capability.py
> > > +++ b/utils/apparmor/rule/capability.py
> > > @@ -147,4 +144,4 @@ def parse_capability(raw_rule):
> > >      return CapabilityRule(capability, audit=audit, deny=deny,
> > >      
> > >                            allow_keyword=allow_keyword,
> > > 
> > > -                          comment=comment, raw_rule=raw_rule)
> > > +                          comment=comment)
> > 
> > This change means you no longer set raw_rule. Please change this to
> > 
> >     rule = CapabilityRule(......)
> >     rule.raw_rule = raw_rule
> >     return rule
> 
> That gets set in the BaseRule.parse() class method. I had thought
> you would prefer this coding style, such that subclasses wouldn't
> need to bother setting the raw_rule.

Ah, that's what you get from OO programming - it makes things less error 
prone etc., but also makes it easier to forget/overlook such things when 
reviewing a patch. Especially when [this part of] the patch removes 
raw_rule from the parameters ;-)

You are right - nothing to fix here :-)
 
> Thanks. All patches in the series are committed to trunk now.

Thanks!


Regards,

Christian Boltz
-- 
> ich mochte gerne fur eine unbestimte Zeit Linux von meiner 
> Festplatte werfen wie mache ich das genau?  [Glenn Charpantier]
Nimm die Platte aus dem Rechner, und pack sie ganz fest mit der Hand.
Dann machst Du eine heftige Wurfbewegung, als wolltest Du die Platte
ganz weit weg werfen. [...] Wenn die Bewgeung heftig genug war, ist
Linux nun von der Platte gefallen. [Adalbert Michelic in suse-linux]




More information about the AppArmor mailing list