[apparmor] [patch 05/26] cleanup/fix escape sequences in the backend and add support for \d

Seth Arnold seth.arnold at canonical.com
Tue Apr 15 19:33:29 UTC 2014


On Tue, Apr 15, 2014 at 04:11:06AM -0700, John Johansen wrote:
> new version
> - address Seth's feedback
> - add missing strn_escseq tests
> - expand strn_escseq to take a 3rd parameter to allow specifying chars to
>   convert straight across. . eg "+" will cause it to convert \+ as +
> - fix libapparmor/parse.y failed escape pass through to match processunqoted
> 
> ---
> 
> cleanup/fix escape sequences processing
> 
> Unify escape sequence processing into a set of library fns.
> 
> Fix the octal escape sequence that was broken, so that short escapes \0,
> \00 \xa, didn't work and actually resulted in some encoding bugs.
> 
> Also we were missing support for the decimal # conversion \d123
> 
> Incorporate and update Steve Beattie's unit tests of escape sequences
> patch
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>

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

... With the caveat that I really dislike #if 0 blocks of code; if
returning -1 rather than '\\' is the right answer, we should stick with
it and remove the now-needless code block.

Thanks

> +	char c = *(*pos)++;
> +	switch(c) {
> +#if 0
> +	case '\0':
> +		(*pos)--;
> +		return '\\';
> +#endif
> +	case '\\':
> +		return '\\';

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


More information about the AppArmor mailing list