Wednesday, October 24, 2007

Too much security

On a security enhanced linux system (selinux enabled OS), when you try to execute an application which links with user created libraries, you will (in all probabilities) end up with an error like below
./myapp : error while loading shared libaries :
/usr/local/lib/libmylib.so :cannot restore segment prot
after reloc permission denied.
. There are two ways to escape this pain.

1. Kill the source of pain once and for all. Disable selinux. Open /etc/selinux/config and either comment out all lines or modify the following line as below
SELINUX=disabled. Save the file and voila, you are a killer.

2. Request selinux.

Dear Selinux,

Since I have to work with user created libraries, I request you to kindly allow me to access the same and run corresponding applications.

Thanking you,
A Poor suffering soul.


Well, not exactly like this, but something like below (for libraries in /usr/local/lib path)
find /usr/local/lib -name '*.so*' -exec chcon -t 
texrel_shlib_t {} \;

No comments: