apparmor/utils
Christian Boltz a79453fb1f fix save_profile() by fixing some other code
When creating a child profile while using genprof, I get a backtrace:

Traceback (most recent call last):
  File "aa-genprof", line 160, in <module>
      lp_ret = apparmor.do_logprof_pass(logmark, passno)
    File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/aa.py", line 2291, in do_logprof_pass
      save_profiles()
    File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/aa.py", line 2309, in save_profiles
      for prof_name in changed.keys():
RuntimeError: dictionary changed size during iteration

(See https://bugs.launchpad.net/apparmor/+bug/1014304 for more details.)


After digging into the code, it seems for some reason the child profile 
is added to "changed" - I doubt this is correct (guess why it's removed 
later... ;-)

After digging a bit more, I found out that create_new_profile() is 
(ab)used to create a new stub profile to be used as child profile. 
create_new_profile then adds the new child (which looks like a normal 
profile to it) to "changed".

This patch most probably makes the cleanup round in save_profile() 
superfluous by adding a is_stub parameter to create_new_profile(). If
this parameter is set, the new (child) profile is not added to "created" 
and "changed".

I intentionally added the two print() lines in safe_profile because
a) I think they will never be displayed
b) I want to know if a) is wrong ;-)
c) it's always nice to have a "nice" error message before displaying
   a backtrace ;-)


Acked-by: Steve Beattie <steve@nxnw.org>
2014-06-10 00:44:59 +02:00
..
apparmor fix save_profile() by fixing some other code 2014-06-10 00:44:59 +02:00
easyprof Add aa-easyprof and easyprof.py and related pieces from the Ubuntu 2014-02-13 17:53:40 -08:00
po Launchpad automatic translations update. 2014-03-26 05:41:51 +00:00
test utils: Handle unmount rules 2014-06-03 16:23:30 -05:00
vim utils: remove generated vim manpage on make clean 2014-03-06 10:20:21 -08:00
aa-audit utils: split out aa-audit function 2014-03-06 11:52:00 -08:00
aa-audit.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-autodep utils: split out aa-genprof command 2014-03-06 11:54:38 -08:00
aa-autodep.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-cleanprof utils/aa-*: adjust python shebang lines to ease rewriting to an 2014-02-14 14:42:19 -08:00
aa-cleanprof.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-complain utils: split out aa-complain function 2014-03-06 11:51:00 -08:00
aa-complain.pod utils: split out aa-complain function 2014-03-06 11:51:00 -08:00
aa-decode speed up aa-decode by using a bash regex matching instead of calling egrep for each line. 2013-01-01 20:15:04 +01:00
aa-decode.pod as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
aa-disable utils: remove aa-disable non-functional '-r' option 2014-03-03 13:29:32 -08:00
aa-disable.pod utils: remove aa-enforce '--remove' option 2014-03-03 14:59:47 -08:00
aa-easyprof Add aa-easyprof and easyprof.py and related pieces from the Ubuntu 2014-02-13 17:53:40 -08:00
aa-easyprof.pod Add aa-easyprof and easyprof.py and related pieces from the Ubuntu 2014-02-13 17:53:40 -08:00
aa-enforce utils: split out aa-complain function 2014-03-06 11:51:00 -08:00
aa-enforce.pod utils: split out aa-enforce function 2014-03-06 11:49:43 -08:00
aa-exec remove unneeded perl requires on Time::Local and File::Basename 2013-06-27 12:11:09 -05:00
aa-exec.pod fix broken URLs in various utils/*.pod files. 2013-09-19 21:17:39 +02:00
aa-genprof aa-genprof failed to set /proc/sys/kernel/printk_ratelimit to 0 2014-06-09 23:47:36 +02:00
aa-genprof.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-logprof utils/aa-*: adjust python shebang lines to ease rewriting to an 2014-02-14 14:42:19 -08:00
aa-logprof.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-mergeprof utils/aa-*: adjust python shebang lines to ease rewriting to an 2014-02-14 14:42:19 -08:00
aa-mergeprof.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
aa-notify More helpful error message for "aa-notify -p" if a user is not member of 2011-10-20 00:20:02 +02:00
aa-notify.pod utils/aa-notify.pod: update to clarify '-u' argument when using '-p' 2011-08-17 07:49:00 -05:00
aa-sandbox utils: remove unneeded imports from aa-easyprof and aa-sandbox 2014-01-17 00:09:23 -08:00
aa-sandbox.pod utils/aa-sandbox.pod: note on hotplugging monitors 2012-08-29 08:49:15 -05:00
aa-status utils/aa-*: adjust python shebang lines to ease rewriting to an 2014-02-14 14:42:19 -08:00
aa-status.pod fix broken URLs in various utils/*.pod files. 2013-09-19 21:17:39 +02:00
aa-unconfined Fix module import errors, remove extraneous newlines 2014-02-27 14:53:25 -08:00
aa-unconfined.pod Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
apparmor-utils.spec.in as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
check_po.pl utitlity to look for problems in the po files. 2007-08-15 19:24:49 +00:00
logprof.conf update logprof.conf for UsrMove 2014-02-02 15:12:32 +01:00
logprof.conf.pod fix broken URLs in various utils/*.pod files. 2013-09-19 21:17:39 +02:00
Makefile utils: don't install two copies of aa-easyprof 2014-03-25 15:04:37 -07:00
notify.conf Here is a patch to standardize on all utils using the "aa-" prefix instead 2010-11-03 17:03:52 -07:00
python-tools-setup.py Fix make install to handle new python binaries, as well as informing 2014-02-13 00:04:39 -08:00
README.md Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
severity.db CAP_EPOLLWAKEUP was renamed to CAP_BLOCK_SUSPEND. Update severity.db for that. 2012-08-14 13:46:10 -05:00

Known Bugs: Will allow multiple letters in the () due to translation/unicode issues with regexing the key. User input will probably bug out in a different locale.