detecting if someone has selinux installed / httpd_can_network_connect enabled

When SELinux is installed there’s a setting – httpd_can_network_connect – that often prevents PHP’s fsockopen() from making outbound connections when it was instantiated by a request coming in via HTTP.

I would like to be able to see, via PHP, if a system has SELinux / httpd_can_network_connect enabled. If so I’d present the user with a warning saying that this setting could interfere with the page.

I installed SELinux on an Ubuntu machine and altho httpd_can_network_connect doesn’t even appear to be an option that’s available to me SELinux none-the-less does appear to be installed and I’m not seeing any indications of it installed even in the phpinfo() output..

Any ideas?


Source: ubuntu

Leave a Reply