[apparmor] [patch] utils: fix apparmor.vim rlimits support (was Re: [patch 13/18] parser: add rttime rlimit support)

2014-01-16 Thread Steve Beattie
On Fri, Jan 17, 2014 at 12:45:27AM +0100, Christian Boltz wrote: > (and BTW, did you test if apparmor.vim displays all tests from 12/18 > correctly?) Apparently I missed all the incorrect highlighting vim gave me while creating those test cases, because no, apparmor.vim does not display many of t

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 08:02 PM, Seth Arnold wrote: > On Thu, Jan 16, 2014 at 05:03:43PM -0800, John Johansen wrote: >> Well some of this will depend on which parser version you want to support. > > Argh. Leave it to me to forget that kernel, userspace, and surrounding > frameworks do not update in lockste

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Seth Arnold
On Thu, Jan 16, 2014 at 05:03:43PM -0800, John Johansen wrote: > Well some of this will depend on which parser version you want to support. Argh. Leave it to me to forget that kernel, userspace, and surrounding frameworks do not update in lockstep. Just how many dimensions does this matrix have, a

Re: [apparmor] [patch 16/18] utils: address pep8 complaints

2014-01-16 Thread Steve Beattie
On Fri, Jan 17, 2014 at 01:29:31AM +0100, Christian Boltz wrote: > Sorry for the terrible quoting, anyway: > Does it really make sense to have two spaces in front of # ? It's pep8's error 261. From running pep8 with the --show-pep8 argument: vim/create-apparmor.vim.py:91:96: E261 at least two s

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 04:23 PM, Seth Arnold wrote: > On Thu, Jan 16, 2014 at 02:57:52PM -0800, John Johansen wrote: >> Is there a way for a trigger to notice which file was updated? >> That way we could use a trigger. >> >> If not another option that comes to mind is we could add a new flag to the >> parse

Re: [apparmor] [patch 17/18] parser+utils: adjust translation bugs reporting address

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > This patch updates the Report-Msgid-Bugs-To: to point to the apparmor > list instead of the old Novell forge address. It also makes the > Project-Id-Version: field consistent. Good idea - the Project-Id-Version had some entertaining v

Re: [apparmor] [patch 16/18] utils: address pep8 complaints

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > This patch eliminates the complaints from running: > > pep8 --ignore=E501 aa-easyprof vim/ > > (E501 is 'line too long', which I'm not too chuffed about. > ) > Mostly, it's a lot of whitespace touchups, with a few conversions from

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Seth Arnold
On Thu, Jan 16, 2014 at 02:57:52PM -0800, John Johansen wrote: > Is there a way for a trigger to notice which file was updated? > That way we could use a trigger. > > If not another option that comes to mind is we could add a new flag to the > parser that would say reload only if the cache is out

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 03:03 PM, Kees Cook wrote: > On Thu, Jan 16, 2014 at 02:59:54PM -0800, John Johansen wrote: >> On 01/16/2014 02:57 PM, John Johansen wrote: >>> On 01/16/2014 02:49 PM, Kees Cook wrote: On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: > Le jeudi, 16 janvie

Re: [apparmor] [patch 15/18] utils: remove unneeded imports from a-easyprof and aa-sandbox

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > Found by running pyflakes on these scripts. > > Signed-off-by: Steve Beattie Acked-by: Christian Boltz (assuming pyflakes was right - and even if not, we'll notice the failures quickly ;-) Regards, Christian Boltz -- > Ich dac

Re: [apparmor] [patch 14/18] parser: add additional language tests to get wider test coverage

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > This patch adds several assorted language tests, to exercise various > parts of the parser that were not being covered by the language tests > previously. Areas lacking were found using the coverage compilation > option; coverage from

Re: [apparmor] [patch 13/18] parser: add rttime rlimit support

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > This patch adds support for the rttime rlimit (aka RLIMIT_RTTIME), > available since the 2.6.25 kernel, according to the getrlimit(2) > man page; see that man page for more details on this rlimit. > An acceptance test is also added. >

Re: [apparmor] [patch 12/18] parser: add rlimit language acceptance tests

2014-01-16 Thread Christian Boltz
Hello,, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > The parser was lacking language tests for rlimits. This test adds > several, one for each rlimit type. > > Signed-off-by: Steve Beattie Acked-by: Christian Boltz Regards, Christian Boltz -- Erstes Gesetz WWW: Du mögest trenn

Re: [apparmor] [patch 04/18] parser: remove unneeded goto target in build_mnt_opts() [resend]

2014-01-16 Thread Christian Boltz
Hello, Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie: > As noted by Seth Arnold, there's now only one failure case in the > function and thus does not warrant a goto target (especially since > there's no cleanup to occur). > > Signed-off-by: Steve Beattie > --- > parser/parser_regex.c |

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 03:03 PM, Kees Cook wrote: > On Thu, Jan 16, 2014 at 02:59:54PM -0800, John Johansen wrote: >> On 01/16/2014 02:57 PM, John Johansen wrote: >>> On 01/16/2014 02:49 PM, Kees Cook wrote: On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: > Le jeudi, 16 janvie

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Kees Cook
On Thu, Jan 16, 2014 at 02:59:54PM -0800, John Johansen wrote: > On 01/16/2014 02:57 PM, John Johansen wrote: > > On 01/16/2014 02:49 PM, Kees Cook wrote: > >> On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: > >>> Le jeudi, 16 janvier 2014 10.14:14, vous avez écrit : > On

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 02:57 PM, John Johansen wrote: > On 01/16/2014 02:49 PM, Kees Cook wrote: >> On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: >>> Le jeudi, 16 janvier 2014 10.14:14, vous avez écrit : On Thu, Jan 16, 2014 at 11:11:22AM +0100, Didier 'OdyX' Raboud wrote: >

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread John Johansen
On 01/16/2014 02:49 PM, Kees Cook wrote: > On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: >> Le jeudi, 16 janvier 2014 10.14:14, vous avez écrit : >>> On Thu, Jan 16, 2014 at 11:11:22AM +0100, Didier 'OdyX' Raboud wrote: As far as I understand deb-triggers' manpage, this

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Kees Cook
On Thu, Jan 16, 2014 at 07:37:04PM +0100, Didier 'OdyX' Raboud wrote: > Le jeudi, 16 janvier 2014 10.14:14, vous avez écrit : > > On Thu, Jan 16, 2014 at 11:11:22AM +0100, Didier 'OdyX' Raboud wrote: > > > As far as I understand deb-triggers' manpage, this can be enforced > > > using 'activate /etc

[apparmor] [patch 12/18] parser: add rlimit language acceptance tests

2014-01-16 Thread Steve Beattie
The parser was lacking language tests for rlimits. This test adds several, one for each rlimit type. Signed-off-by: Steve Beattie --- parser/tst/simple_tests/rlimits/ok_rlimit_01.sd |7 +++ parser/tst/simple_tests/rlimits/ok_rlimit_02.sd |7 +++ parser/tst/simple_tests/rlimits/ok

[apparmor] [patch 09/18] parser: fix memory leak on calloc() failure

2014-01-16 Thread Steve Beattie
Fix leaked memory if calloc() fails. Found by cppcheck. Signed-off-by: Steve Beattie --- parser/parser_alias.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: b/parser/parser_alias.c === --- a/parser/parser_alias

[apparmor] [patch 15/18] utils: remove unneeded imports from a-easyprof and aa-sandbox

2014-01-16 Thread Steve Beattie
Found by running pyflakes on these scripts. Signed-off-by: Steve Beattie --- utils/aa-easyprof |1 - utils/aa-sandbox |3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) Index: b/utils/aa-easyprof === --- a/utils/aa-ea

[apparmor] [patch 03/18] parser: remove static sized buffer in process_dbus_entry() [resend]

2014-01-16 Thread Steve Beattie
This patch converts a stack allocated buffer into an std::ostringstream object. The stringstream interface for specifying the equivalent of a printf %02x conversion is a bit of an awkward construction, however. Signed-off-by: Steve Beattie --- parser/parser_regex.c |9 ++--- 1 file chang

[apparmor] [patch 02/18] parser: remove unneeded vars/allocations in regex unit tests [resend]

2014-01-16 Thread Steve Beattie
Based on feedback from Seth Arnold, the convert_aaregex_to_pcre()'s first argument is const char *, and thus the unit test macros don't need to pass a copy of the input string to it, as it's guaranteed to be unmodified by the function. Signed-off-by: Steve Beattie --- parser/parser_regex.c | 1

[apparmor] [patch 04/18] parser: remove unneeded goto target in build_mnt_opts() [resend]

2014-01-16 Thread Steve Beattie
As noted by Seth Arnold, there's now only one failure case in the function and thus does not warrant a goto target (especially since there's no cleanup to occur). Signed-off-by: Steve Beattie --- parser/parser_regex.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) Index: b/parser/

[apparmor] [patch 18/18] po files: eliminate msgfmt missing language header warning

2014-01-16 Thread Steve Beattie
Current builds include many warnings when building translations message files like so: msgfmt -c -o ja.mo ja.po ja.po:5: warning: header field 'Language' missing in header According to what I read in the entry for Language in http://www.gnu.org/software/gettext/manual/gettext.html#Header-Entr

[apparmor] [patch 07/18] parser: pull forward free() calls [resend]

2014-01-16 Thread Steve Beattie
As noted by Seth Arnold, in expand_by_alternations() if our set variable has at least one value, then we're going to rewrite the entry, so rather than sprinkle the free()s near where the reallocation occurs, use one free() once we're guaranteed to need to do so. Signed-off-by: Steve Beattie ---

[apparmor] [patch 11/18] regression tests: minor dbus compilation cleanups

2014-01-16 Thread Steve Beattie
This patch replaces explicitly named output targets with the make variable $@ as well as an instance where dbus_common.h was being added to the compile command line due to the use of $^ rather than $<. Signed-off-by: Steve Beattie --- tests/regression/apparmor/Makefile |8 1 file ch

[apparmor] [patch 10/18] parser: close file handle left opened

2014-01-16 Thread Steve Beattie
Close file handle left opened if parser.cfg is found and read from. Found by cppcheck. Signed-off-by: Steve Beattie --- parser/parser_main.c |1 + 1 file changed, 1 insertion(+) Index: b/parser/parser_main.c === --- a/parser/pa

[apparmor] [patch 14/18] parser: add additional language tests to get wider test coverage

2014-01-16 Thread Steve Beattie
This patch adds several assorted language tests, to exercise various parts of the parser that were not being covered by the language tests previously. Areas lacking were found using the coverage compilation option; coverage from the language tests is still incomplete. Signed-off-by: Steve Beattie

[apparmor] [patch 06/18] parser: replace reverse iterator [resend]

2014-01-16 Thread Steve Beattie
As suggested by Seth Arnold, we can use string::find_last_not_of() instead of using C++'s hideous reverse iterators. Signed-off-by: Steve Beattie --- parser/parser_variable.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Index: b/parser/parser_variable.c ===

[apparmor] [patch 16/18] utils: address pep8 complaints

2014-01-16 Thread Steve Beattie
This patch eliminates the complaints from running: pep8 --ignore=E501 aa-easyprof vim/ (E501 is 'line too long', which I'm not too chuffed about. ) Mostly, it's a lot of whitespace touchups, with a few conversions from '==' to 'is'. Signed-off-by: Steve Beattie --- utils/aa-easyprof

[apparmor] [patch 00/18] miscellaneous fixes, cleanups, and testcases

2014-01-16 Thread Steve Beattie
This patch set is a collection of miscellaneous fixes, cleanups, and testcases that I'd been accumulating. The first few patches are resends of things that I had submitted to the list previously; other things were the result of running tools like pyflakes, pep8, and cppcheck. Additional test cases

[apparmor] [patch 17/18] parser+utils: adjust translation bugs reporting address

2014-01-16 Thread Steve Beattie
This patch updates the Report-Msgid-Bugs-To: to point to the apparmor list instead of the old Novell forge address. It also makes the Project-Id-Version: field consistent. Signed-off-by: Steve Beattie --- parser/po/af.po|4 ++-- parser/po/ar.po|2 +- parser/po/bg.po|4 ++-

[apparmor] [patch 05/18] parser: remove unneeded e_buffer_overflow [resend]

2014-01-16 Thread Steve Beattie
As noted by Seth Arnold, e_buffer_overflow is no longer set in convert_aaregex_to_pcre(), so remove it and the sole check for it. Signed-off-by: Steve Beattie --- parser/parser_regex.c |6 -- 1 file changed, 6 deletions(-) Index: b/parser/parser_regex.c =

[apparmor] [patch 13/18] parser: add rttime rlimit support

2014-01-16 Thread Steve Beattie
This patch adds support for the rttime rlimit (aka RLIMIT_RTTIME), available since the 2.6.25 kernel, according to the getrlimit(2) man page; see that man page for more details on this rlimit. An acceptance test is also added. Signed-off-by: Steve Beattie --- parser/parser_misc.c

[apparmor] [patch 01/18] parser: eliminate bison warning [resend]

2014-01-16 Thread Steve Beattie
This patch eliminates the bison warning about "%name-prefix =" being deprecated. Signed-off-by: Steve Beattie --- parser/libapparmor_re/parse.y |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: b/parser/libapparmor_re/parse.y ===

[apparmor] [patch 08/18] parser: simplify handling of default matching patterns [resend]

2014-01-16 Thread Steve Beattie
Seth Arnold noticed an ugly string.clear(); convert_entry(string, NULL) pattern occurred frequently following the conversion to using std::string. This patch replaces that by using a static pointer to a constant string matching pattern, and also converts other uses of that pattern. It also adds a f

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Didier 'OdyX' Raboud
Le jeudi, 16 janvier 2014 10.14:14, vous avez écrit : > On Thu, Jan 16, 2014 at 11:11:22AM +0100, Didier 'OdyX' Raboud wrote: > > As far as I understand deb-triggers' manpage, this can be enforced > > using 'activate /etc/apparmor.d/', which will then make the trigger > > run "at the start of the c

Re: [apparmor] Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Didier 'OdyX' Raboud
Hi Seth, Le mercredi, 15 janvier 2014, 11.14:07 Seth Arnold a écrit : > On Wed, Jan 15, 2014 at 07:30:52PM +0100, intrigeri wrote: > > From: Didier Raboud > > apparmor could have an 'interest /etc/apparmor.d/' triggers file and > > its postinst would then do the machinery to create (or remove) th

Re: [apparmor] Bug#735470: Fwd: Bug#735470: Could be implemented centrally with a dpkg trigger instead of requiring every package shipping an apparmor file to use dh_apparmor

2014-01-16 Thread Kees Cook
On Thu, Jan 16, 2014 at 11:11:22AM +0100, Didier 'OdyX' Raboud wrote: > Le mercredi, 15 janvier 2014, 11.14:07 Seth Arnold a écrit : > > On Wed, Jan 15, 2014 at 07:30:52PM +0100, intrigeri wrote: > > > From: Didier Raboud > > > apparmor could have an 'interest /etc/apparmor.d/' triggers file and >