Monday, June 14, 2010

Fedora 12 + SELinux + Firefox 3.6 + Sun Java plugin

Because of a legacy application, I need to install Sun Java plugin in my Fedora 12 system. There is a few tricks worth notice:

1. After Firefox 3.6, it doesn't support the original Java plugin format OJI and only support the standard NPAPI and NPRuntime interfaces that come with Sun Java 6 update 10 or later.

Ref. www.java.com/en/download/faq/firefox_newplugin.xml

You have to remove all libjavaplugin_oji.so link from firefox plugin directories (e.g. /usr/lib/mozilla/plugins, /usr/lib/firefox/plugins, ~/.mozilla/plugins, etc) and create this new link:

# ln -s /usr/java/jdk1.6.0_18/jre/lib/i386/libnpjp2.so libnpjp2.so


And restart firefox to take effect.

2.If you SELinux is disabled, it is all you need. But if SELinux is enabled, you will get this message when you start firefox in shell:

#./firefox
LoadPlugin: failed to initialize shared library /usr/java/jre1.6.0_20/lib/i386/libnpjp2.so [/usr/java/jre1.6.0_20/lib/i386/libnpjp2.so: cannot enable executable stack as shared object requires: Permission denied]

A quick and dirty way is to clear the "executable stack" flag for the libnpjp2.so:

# execstack -c /usr/java/jdk1.6.0_18/jre/lib/i386/libnpjp2.so


(Don't do execstack on your symbolic link or it will copy the real file to replace the symlink.)

But after further research, I found that it may be related to a policy issue of SELinux. And upgrade selinux-policy would solve the problem. Ref.

https://bugzilla.redhat.com/show_bug.cgi?id=533486

No comments: