apparmor parser fails with ptrace rules and CRLF line endings

Bug #1306882 reported by Steve Beattie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
Triaged
Medium
Unassigned

Bug Description

The parser should not fail when ptrace rules and CRLF line endings are used together:

$ file ok_dos_line_endings.sd
ok_dos_line_endings.sd: ASCII text, with CRLF line terminators
$ cat -n ok_dos_line_endings.sd
     1 #
     2 #=Description ptrace peer w/perms and misc modifiers rules w/DOS line endings
     3 #=EXRESULT PASS
     4 #
     5
     6 /usr/bin/foo {
     7 ptrace peer=/usr/bin/top,
     8 # a comment
     9 deny ptrace read peer=/bin/sh,
    10 allow ptrace write peer=/bin/true,
    11 audit ptrace trace peer=/bin/false,
    12 audit deny ptrace readby peer=/sbin/init,
    13 audit allow ptrace tracedby peer=/usr/bin/gdb,
    14 deny ptrace (readby, tracedby) peer=/usr/bin/valgrind,
    15
    16 }
$ ../../../apparmor_parser -qQ ok_dos_line_endings.sd
AppArmor parser error for ok_dos_line_endings.sd in ok_dos_line_endings.sd at line 8: syntax error, unexpected TOK_ID, expecting TOK_CONDID or TOK_END_OF_RULE

Note that the parser succeeds compiling the same profile with unix line endings .

Tags: aa-parser
Steve Beattie (sbeattie)
Changed in apparmor:
importance: Undecided → Medium
Changed in apparmor:
status: New → Triaged
tags: added: aa-parser
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.