[apparmor] [utils] proposed redesign for mergeprof

Steve Beattie steve at nxnw.org
Thu Oct 16 17:14:08 UTC 2014


On Wed, Oct 15, 2014 at 11:12:51PM +0200, Christian Boltz wrote:
> Hello,
> 
> Am Mittwoch, 15. Oktober 2014 schrieb Christian Boltz:
> > Remaining known issues I noticed while testing:
> > - aa-mergeprof always asks for includes, even if they are already
> > there 
> 
> The attached patch fixes this ;-)
> 
Acked-by: Steve Beattie <steve at nxnw.org>

(Though a couple of added blank lines have extraneous trailing spaces
in them. Can you fix before committing, unless they were artifacts
of your email client?)

> --- aa-mergeprof__MERGED+fixes	2014-10-15 22:23:51.029502379 +0200
> +++ aa-mergeprof	2014-10-15 23:09:33.267213910 +0200
> @@ -258,7 +258,12 @@ class Merge(object):
>  
>          #Add the file-wide includes from the other profile to the user profile
>          done = False
> -        options = list(map(lambda inc: '#include <%s>' %inc, sorted(other.filelist[other.filename]['include'].keys())))
> +
> +        options = []
> +        for inc in other.filelist[other.filename]['include'].keys():
> +            if not inc in self.user.filelist[self.user.filename]['include'].keys():
> +                options.append('#include <%s>' %inc)
> + 

^ trailing space

>          default_option = 1
>  
>          q = aaui.PromptQuestion()
> @@ -288,7 +293,12 @@ class Merge(object):
>          for hat in sorted(other.aa[profile].keys()):
>              #Add the includes from the other profile to the user profile
>              done = False
> -            options = list(map(lambda inc: '#include <%s>' %inc, sorted(other.aa[profile][hat]['include'].keys())))
> +
> +            options = []
> +            for inc in other.aa[profile][hat]['include'].keys():
> +                if not inc in self.user.aa[profile][hat]['include'].keys():
> +                    options.append('#include <%s>' %inc)
> +                

^ 12 trailing spaces

>              default_option = 1
>  
>              q = aaui.PromptQuestion()

Thanks!

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20141016/7d27709d/attachment.pgp>


More information about the AppArmor mailing list