5

Recently there an article in about configuring FF with AppArmor.

When I ran the below command

cat /etc/apparmor.d/usr.bin.firefox | sudo apparmor_parser –a

I get the following error

Error: Could not read profile –a: No such file or directory.

How to get rid of this error?

Also, I don’t use the FF which comes with Ubuntu, but I download latest FF and start using it. What changes to the command are required?

3
  • This: "I don’t use the FF which comes with Ubuntu". If you used the one that comes with Ubuntu, you shouldn't have a problem. Could you edit your question to include why you aren't using the supplied Firefox? Or do you mean you are using nightly builds? What do you mean by "I download latest FF"?
    – user25656
    Jul 7, 2012 at 11:51
  • Also, can someone who knows better confirm whether "It isn’t enabled by default, as it may restrict Firefox too much and cause problems" from the link cited by OP is correct for the Firefox supplied by Ubuntu? I know that my Firefox is protected but I can't remember if I had to enable the AppArmor profile or not.
    – user25656
    Jul 7, 2012 at 11:56
  • @vasa1: see answer.
    – ish
    Jul 7, 2012 at 17:04

1 Answer 1

2

Simply run this instead of using cat:

sudo apparmor_parser /etc/apparmor.d/usr.bin.firefox

-a or add is the default operation apparmor_parser performs.

Why? the command as you tried it will work if you are logged in as root or you recently used sudo; the sudo password entry is causing the problem you experienced. In general, for pipes use this syntax: sudo sh -c "command1 | command2"


Note: the /usr/bin/firefox AppArmor profile is disabled by default in Ubuntu. As long as the version of Firefox you download installs in /usr/bin (e.g. not your home directory), the default AppArmore profile can be enabled and will work.

13
  • Thanks! Could you also clarify whether getting Firefox direct will require the user to edit the AppArmor profile whenever there's a version change in Fx? I'm using Firefox beta and I think that mozillateam adjusts the Apparmor profile accordingly so I don't have to do anything.
    – user25656
    Jul 7, 2012 at 17:26
  • 1
    @vasa1, no, version changes do not require any changes in the profile. That's because AppArmor works based on file paths only, so as long as the executable is /usr/bin/firefox, the policy will be applied to it regardless of version or source.
    – ish
    Jul 7, 2012 at 17:35
  • My confusion is because when I first started off, I saw this as part of the output when I ran sudo aa-status: /usr/lib/firefox-**7.0.1**/firefox{,*[^s][^h]}. But now I'm seeing just this with the same command: /usr/lib/firefox/firefox{,*[^s][^h]}. That's why I thought that version number was important. (My version is now Fx 14.)
    – user25656
    Jul 7, 2012 at 18:23
  • @vasa1, I see, that's odd -- must have been a custom profile from somewhere (PPA/beta?), because the default is, as you indicated, ` /usr/lib/firefox/firefox{,*[^s][^h]}, /usr/lib/firefox/firefox{,*[^s][^h]}//browser_java, /usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk, /usr/lib/firefox/firefox{,*[^s][^h]}//sanitized_helper `
    – ish
    Jul 7, 2012 at 18:24
  • The full output of what I saw when I was on Firefox 7 (Ubuntu 11.10) is here. And I'm pretty sure it was the default profile or possibly that of the mozillateam because I did go back and forth between beta and stable. Anyway, the way it is now is nice.
    – user25656
    Jul 7, 2012 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.