Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
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 '12 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 '12 at 11:56
    
@vasa1: see answer. –  izx Jul 7 '12 at 17:04
add comment

1 Answer 1

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.

share|improve this answer
    
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 '12 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. –  izx Jul 7 '12 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 '12 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 ` –  izx Jul 7 '12 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 '12 at 19:15
show 8 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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