Bug 887710
| Summary: | SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the tcp_socket . | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mikhail <mikhail.v.gavrilov> | ||||
| Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 18 | CC: | dominick.grift, dwalsh, mgrepl, mikhail.v.gavrilov | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | i686 | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | abrt_hash:6b40485f5678dad81fa4426591ab7752a0aba8f26c1099a1dd4e4a1638a6c201 | ||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-12-17 11:11:22 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Mikhail
2012-12-17 04:15:16 UTC
I am really don't know why Web page just contained "#!/usr/bin/php" string occurs this SELinux alert. Also with Firefox. Are you using NIS? Does everything work? Sorry, what is NIS? Is tcp/7020 port defined in the php-fpm configuration? Created attachment 664727 [details]
www.conf
Ohh very interesting situation:
1. example.com -> resolve host as 127.0.0.1
2. I have at localhost test.php with follow content:
#!/usr/bin/php
<?php
/**
* Create or append log file in log calogue
* @param string $fname file name log file
* @param string $key name of key
* @param string $value
*/
function writelog($fname, $key, $value = NULL) {
global $program_dir;
if(empty($_SESSION['user']['login'])) $user = $GLOBALS['clientip']; else $user = $_SESSION['user']['login'];
if(($handler = fopen($user.'-'.$fname, "a")) !== false) {
$datetime = strtotime("now");
$logMsg = gmdate("r", $datetime)." ".$user." ".$key;
if(isset($value)) $logMsg .= "=".print_r($value,true);
$logMsg .= "\n";
fputs($handler, $logMsg);
fclose($handler);
}
}
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$GLOBALS['clientip'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
else
$GLOBALS['clientip'] = $_SERVER['REMOTE_ADDR'];
writelog('bbb.log','mmm',"http://ipgeobase.ru:7020/geo?ip={$GLOBALS['clientip']}");
$xmlobj = simplexml_load_file("http://ipgeobase.ru:7020/geo?ip=");
?>
And OMG, this script try access to http://ipgeobase.ru:7020
Ok, how correctly alowed this connection?
Good catch. You can do either semanage port -a -t http_port_t -p tcp 7020 or setsebool -P httpd_can_network_connect 1 |