[apparmor] fix ${} not being treated as pcre special chars

Steve Beattie steve at nxnw.org
Thu Jun 19 20:46:48 UTC 2014


On Thu, Jun 19, 2014 at 12:09:00PM -0700, John Johansen wrote:
> Fix: backend processing was not treating ${} as a special pcre character
> 
> Also for characters that are not recognized as a valid escape seq
> make sure that the character is emitted.
> 
> previously
>   \$ resulted in \
> where it should have been \$ if $ wasn't recognized
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Steve Beattie <steve at nxnw.org>

> ---
>  parser/libapparmor_re/parse.y |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> --- 2.9-test.orig/parser/libapparmor_re/parse.y
> +++ 2.9-test/parser/libapparmor_re/parse.y
> @@ -172,14 +172,15 @@
>  		return *(*pos - 1);
>  
>  	case '\\':
> -		tmp = str_escseq(pos, "*+.|^-[]()");
> -		if (tmp == -1)
> +		tmp = str_escseq(pos, "*+.|^$-[](){}");
> +		if (tmp == -1) {
>  			/* bad escape sequence, just skip it for now, that
>  			 * is output \\ followed by the invalid esc seq
>  			 * TODO: output error message
>  			 */
>  			val->c = '\\';
> -		else
> +			(*pos)--;
> +		} else
>  			val->c = tmp;
>  		break;
>  	}
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-- 
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/20140619/08b723db/attachment.pgp>


More information about the AppArmor mailing list