Unexpected Errorr running aa-genprof

Bug #1814099 reported by Jim Stadtfeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
New
Undecided
Unassigned

Bug Description

I created a test script and ran it. I then ran the aa-genprof utility and received the following error:

aa7cl@atlas:~/Data$ aa-genprof example.sh
Writing updated profile for /home/aa7cl/Data/example.sh.
Traceback (most recent call last):
  File "/usr/sbin/aa-genprof", line 110, in <module>
    apparmor.autodep(program)
  File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 604, in autodep
    write_profile_ui_feedback(pname)
  File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 3335, in write_profile_ui_feedback
    write_profile(profile)
  File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 3344, in write_profile
    newprof = tempfile.NamedTemporaryFile('w', suffix='~', delete=False, dir=profile_dir)
  File "/usr/lib/python3.6/tempfile.py", line 690, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/lib/python3.6/tempfile.py", line 401, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
PermissionError: [Errno 13] Permission denied: '/etc/apparmor.d/tmpzldtxs6y~'

An unexpected error occoured!

For details, see /tmp/apparmor-bugreport-_h2anv7j.txt
Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
and attach this file.

This is a server running Ubuntu 18.04 LTS. I new to linux so I'm not sure this is really a bug. This is also my first time reporting. Please let me know if you need additional info.

Tags: aa-tools
Revision history for this message
Christian Boltz (cboltz) wrote :

It looks like you started aa-genprof as user, which isn't supported. I admit the error message should be more helpful ;-)

Can you please try again as root?

tags: added: aa-tools
Revision history for this message
Jim Stadtfeld (aa7cl) wrote : Re: [Bug 1814099] Re: Unexpected Errorr running aa-genprof

Well, I really thought I had tried that. I'm sorry about wasting your time. That did work. Thank you for the quick response.

I will try to me more through in the future.

Thanks, Christian.

________________________________
From: <email address hidden> <email address hidden> on behalf of Christian Boltz <email address hidden>
Sent: Thursday, January 31, 2019 11:16 AM
To: <email address hidden>
Subject: [Bug 1814099] Re: Unexpected Errorr running aa-genprof

It looks like you started aa-genprof as user, which isn't supported. I
admit the error message should be more helpful ;-)

Can you please try again as root?

** Tags added: aa-tools

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1814099

Title:
  Unexpected Errorr running aa-genprof

Status in AppArmor:
  New

Bug description:
  I created a test script and ran it. I then ran the aa-genprof utility
  and received the following error:

  aa7cl@atlas:~/Data$ aa-genprof example.sh
  Writing updated profile for /home/aa7cl/Data/example.sh.
  Traceback (most recent call last):
    File "/usr/sbin/aa-genprof", line 110, in <module>
      apparmor.autodep(program)
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 604, in autodep
      write_profile_ui_feedback(pname)
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 3335, in write_profile_ui_feedback
      write_profile(profile)
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 3344, in write_profile
      newprof = tempfile.NamedTemporaryFile('w', suffix='~', delete=False, dir=profile_dir)
    File "/usr/lib/python3.6/tempfile.py", line 690, in NamedTemporaryFile
      (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
    File "/usr/lib/python3.6/tempfile.py", line 401, in _mkstemp_inner
      fd = _os.open(file, flags, 0o600)
  PermissionError: [Errno 13] Permission denied: '/etc/apparmor.d/tmpzldtxs6y~'

  An unexpected error occoured!

  For details, see /tmp/apparmor-bugreport-_h2anv7j.txt
  Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
  and attach this file.

  This is a server running Ubuntu 18.04 LTS. I new to linux so I'm not sure this is really a bug. This is also my first time reporting. Please let me know if you need additional info.

To manage notifications about this bug go to:
https://bugs.launchpad.net/apparmor/+bug/1814099/+subscriptions

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.