lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sat, 25 Feb 2012 10:37:29 +0100 From: Michal Marek <mmarek@...e.cz> To: Stephen Hemminger <shemminger@...tta.com> Cc: Stephen Boyd <sboyd@...eaurora.org>, linux-kernel@...r.kernel.org Subject: Re: [PATCH] tags: fix use of parenthesis in regex Dne 25.2.2012 01:56, Stephen Hemminger napsal(a): > On Sat, 25 Feb 2012 01:34:12 +0100 > Michal Marek <mmarek@...e.cz> wrote: > >> On Mon, Feb 06, 2012 at 03:15:43PM -0800, Stephen Hemminger wrote: >>> Several of the regular expressions passed to etags and ctags where incorrect >>> and missing the backslash before the closing paren, and matching the wrong >>> part of the start of the function causing warning: >>> etags: Unmatched ( or \( while compiling pattern >> >> But your patch introduces another imbalances, e.g. >> >> >>> @@ -129,31 +129,31 @@ exuberant() >> ... >>> - --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ >> ... >>> + --regex-c++='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ >> >> The old version had left paren, start of group, ..., end of group >> The new version has start of group, left paren, ..., right paren >> >> Where left / right paren means the character without any special >> meaning. I actually can't see anything wrong with the old TRACE_EVENT matching, the regular expression is correct and I think it does what it should do (turn >> TRACE_EVENT(foo) into trace_foo). >> >> Below is the full list of warnings I get from >> >> Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert >> Addresses: <dhiebert@...rs.sourceforge.net>, http://ctags.sourceforge.net >> Optional compiled features: +wildcards, +regex >> >> >> GEN tags >> ctags: Warning: regcomp ^SYSCALL_DEFINE[[:digit:]]?(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp ^TRACE_EVENT(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp ^DEFINE_EVENT\([^,)]*, *([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp PAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp PAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp PAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTSETFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTPAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp SETPAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __SETPAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTCLEARFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __TESTCLEARFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp CLEARPAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __CLEARPAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __PAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __PAGEFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp PAGEFLAG_FALSE(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTSCFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTSCFLAG(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp SETPAGEFLAG_NOOP(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp CLEARPAGEFLAG_NOOP(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __CLEARPAGEFLAG_NOOP(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp TESTCLEARFLAG_FALSE(\([^,)]*\).*: Unmatched ( or \( >> ctags: Warning: regcomp __TESTCLEARFLAG_FALSE(\([^,)]*\).*: Unmatched ( or \( >> >> The same list repeats, as ctags is called multiple times. >> >> Michal > > The problem is that in proper regex each start of sub-expression \( > needs to have a matching end of sub-expression \) But both *tags programs expect extended regexps, where \( is not start of sub-expression, but a verbatim left paren. So you balanced verbatim parens (which was not necessary, as the right paren is eaten by the trailing .*) and broke expression grouping. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists