[apparmor] [Branch ~apparmor-dev/apparmor/master] Rev 2136: Kshitij Gupta found and fixed a problem with Glob and Glob w/ Ext behavior

Seth Arnold seth.arnold at canonical.com
Tue Jul 9 00:36:45 UTC 2013


On Tue, Jul 09, 2013 at 01:35:03AM +0200, Christian Boltz wrote:
> Besides some accidential whitespace changes (probably tabs vs. spaces),
> I'm wondering about
> 
> > +                                    if (not $newpath ~~ $options) {
> vs.
> > +                                    if (not $newpath ~~ @options) {
> 
> Note that in one case $options is used and @options in the other.
> 
> I somehow doubt that both are correct ;-)

Oh man. *sigh*

So, how about the following, to fix both problems? (I picked @options as
the solution -- to match the path among items in the list.)

Proposed for trunk and 2.8:

Acked-by: Seth Arnold <seth.arnold at canonical.com>

=== modified file 'utils/Immunix/AppArmor.pm'
--- utils/Immunix/AppArmor.pm	2013-07-05 21:12:08 +0000
+++ utils/Immunix/AppArmor.pm	2013-07-09 00:31:23 +0000
@@ -3879,8 +3879,8 @@
                                             $newpath =~ s/\/[^\/]+$/\/\*/;
                                         }
                                     }
-                                    if (not $newpath ~~ $options) {
-					push @options, $newpath;	
+                                    if (not $newpath ~~ @options) {
+                                        push @options, $newpath;	
                                         $defaultoption = $#options + 1;
                                     }
                                 }
@@ -3897,8 +3897,8 @@
                                         $newpath =~ s/\/[^\/]+(\.[^\/]+)$/\/\*$1/;
                                     }
                                     if (not $newpath ~~ @options) {
-					push @options, $newpath;
-					$defaultoption = $#options + 1;
+                                        push @options, $newpath;
+                                        $defaultoption = $#options + 1;
                                     }
                                 }
                             } elsif ($ans =~ /\d/) {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130708/218dcea3/attachment.pgp>


More information about the AppArmor mailing list