But, shouldn't /.foo/.bar match? On Mon, May 28, 2012 at 12:32 PM, Nicolas Valcárcel <[email protected]>wrote:
> Thanks! So what i would need to have is '.' after a '/' or beginning of > string followed by anything BUT a '/', right? > > > On Mon, May 28, 2012 at 12:19 PM, John Johansen < > [email protected]> wrote: > >> On 05/28/2012 09:23 AM, Nicolas Valcárcel wrote: >> > Hi, i'm working on rewriting to python3 some apparmor tools, but i'm >> not a perl expert, nor know apparmor in deep, so i got a stopper here that >> i hope you can help me with. >> > >> hey Nicolas >> >> > In Immunix/AppArmor.pm there is a function isSkippableFile which has a >> regexp i don't understand: >> > $path =~ /(^|\/)\.[^\/]*$/ <--- this one i don't >> understand >> dot files, but looking at it, it has an issue >> '.' followed by anything that is not a path >> or >> '/.' followed by anything that is not a path, note the leading '/' is >> not anchored >> >> so >> >> . >> .. >> .foo >> /. >> /.. >> /.foo >> bar/.foo >> /bar/.foo >> >> but not >> >> ./ >> .foo/ >> .foo/bar >> /.foo/ >> /.foo/bar >> >> now for where it has a problem, since the leading '/' is unanchored >> /.foo/.bar >> >> will match >> >> >> > $path =~ /\.rpm(save|new)$/ <--- this would be anything ending in >> .rpmsave or .rpmnew? >> yes >> >> > $path =~ /\.dpkg-(old|new)$/ <--- this would be anything ending >> in .dpkg-old or .dpkg-new? >> yes >> >> > $path =~ /\.swp$/ <--- this would be anything >> ending in .swp? >> yes >> >> > $path =~ /\~$/); <--- this would be anything >> ending in ~? >> > >> yes >> > > > > -- > Nicolas Valcárcel > Gerente IT / CTO > Celular: (511) 976 330 707 > > -- Nicolas Valcárcel Gerente IT / CTO Celular: (511) 976 330 707
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
