apparmor/parser
John Johansen 36d44a3b25 Fix the mount flags set generated by the parser
When generating the flag set the parser was not generating the complete
set when flags where not consecutive.  This is because the len value
was not being reset for each flag considered, so once it was set for
a flag, then the next flag would have to be set to reset it else the
output string was still incremented by the old len value.

  Eg.
  echo "/t { mount options=rbind, }" | apparmor_parser -QT -D rule-exprs

  results in
  rule: \x07[^\000]*\x00[^\000]*\x00[^\000]*\x00\x0d  ->

  however \x0d only covers the bind and not the recursive flag

This is fixed by adding a continue to the flags generation loop for the
else case.

  resulting the dump from above generating

  rule: \x07[^\000]*\x00[^\000]*\x00[^\000]*\x00\x0d\x0f  ->

  \x0d\x0f covers both of the required flags

Also fix the flags output to allow for the allow any flags case.  This
was being screened out.  By masking the flags even when no flags where
specified.

  this results in a difference of

  echo "/t { mount, }" | apparmor_parser -QT -D rule-exprs

    rule: \x07[^\000]*\x00[^\000]*\x00[^\000]*\x00(\x01|)(\x02|)(\x03|)(\x04|)(\x05|)\x00[^\000]*

  becoming
    \x07[^\000]*\x00[^\000]*\x00[^\000]*\x00[^\000]*\x00[^\000]*

  which is simplified and covers all permissions vs. the first rule output

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-03-15 09:03:48 -07:00
..
libapparmor_re Fix infinite loop bug in normalization. 2012-03-09 04:22:42 -08:00
po Fix list email typo 2011-02-23 15:57:36 -08:00
tst Fix minimize.sh test to screen out more parser error messages by grepping 2012-03-09 06:48:03 -08:00
apparmor-parser.spec.in Add an example parser.conf file 2011-10-07 14:43:54 -07:00
apparmor.d.pod Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
apparmor.pod as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
apparmor.vim.pod Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
apparmor_parser.pod Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
COPYING.GPL rpmlint complains about an outdated FSF address in parser/COPYING.GPL. 2011-11-27 13:52:06 +01:00
frob_slack_rc as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
immunix.h Fix the x intersection consistency test 2012-03-09 04:19:24 -08:00
Makefile Fix Make file for mount.c so that warnings are emitted during a build 2012-03-09 04:21:06 -08:00
mount.c Fix the mount flags set generated by the parser 2012-03-15 09:03:48 -07:00
mount.h Add mount rules 2012-02-24 04:19:38 -08:00
parser.conf Commit the example parser.conf file that was supposed to be part of 2011-10-09 20:15:03 -07:00
parser.h Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_alias.c as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
parser_common.c Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_include.c Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_include.h Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_interface.c Add Basic infrastructure support for the policydb 2012-02-16 08:14:46 -08:00
parser_lex.l Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_main.c Fix the "Kernel features are written to cache:" test 2012-03-09 04:25:03 -08:00
parser_merge.c Fix compilation errors that slipped in. Yes, I realize this breaks the 2011-02-23 14:40:07 -08:00
parser_misc.c Add mount rules 2012-02-24 04:19:38 -08:00
parser_policy.c Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
parser_regex.c Fix the mount flags set generated by the parser 2012-03-15 09:03:48 -07:00
parser_symtab.c [v2: added clean-ups, backed off on some of the build silencing] 2011-05-13 02:12:49 -07:00
parser_variable.c Add mount rules 2012-02-24 04:19:38 -08:00
parser_yacc.y Revert commit: -r 1955 Default profiles to be chroot relative 2012-03-15 08:59:56 -07:00
policydb.h Add Basic infrastructure support for the policydb 2012-02-16 08:14:46 -08:00
rc.aaeventd.redhat as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.aaeventd.suse openSUSE patch to remove the "-f" parameter from startproc in rc.aaeventd.suse / 2011-08-13 14:22:35 +02:00
rc.apparmor.debian as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.functions Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
rc.apparmor.redhat as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.slackware as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.suse It looks like rc.apparmor.functions renamed "aa_log_action_begin()" to 2011-09-15 20:20:23 +02:00
README Remove pcre and update tests where necessary 2010-07-31 16:00:52 -07:00
subdomain.conf Here's an update to rename another chunk of things that still used 2011-01-13 13:58:26 -08:00
subdomain.conf.pod Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
techdoc.tex From: Jeff Mahoney <jeffm@suse.com> 2011-02-09 14:29:05 -08:00

The apparmor_parser allows you to add, replace, and remove AppArmor
policy through the use of command line options. The default is to add.
`apparmor_parser --help` shows what the command line options are.

You can also find more information at
<http://forge.novell.com/modules/xfmod/project/?apparmor>.

Please send all complaints, bug reports, feature requests, rants about the
software, and questions to apparmor-general@forge.novell.com. Security
issues should be directed to security@suse.de or secure@novell.com,
where we will attempt to conform to the RFP vulnerability disclosure
protocol: http://www.wiretrip.net/rfp/policy.html

Thanks.

-- The AppArmor development team