php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45425 ARM version exec issue
Submitted: 2008-07-03 06:20 UTC Modified: 2008-07-11 01:00 UTC
From: aaron at stormsemi dot com Assigned:
Status: No Feedback Package: Program Execution
PHP Version: 5.2.1 OS: Linux-2.6.15
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aaron at stormsemi dot com
New email:
PHP Version: OS:

 

 [2008-07-03 06:20 UTC] aaron at stormsemi dot com
Description:
------------
localhost> /mnt/data/public/lsof -i :80
COMMAND   PID     USER   FD   TYPE DEVICE SIZE NODE NAME
httpd    1219     root    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1220 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1221 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1222 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1223 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1224 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1225 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
httpd    1226 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
socktest 1235 www_user    5u  IPv4   2941       TCP *:http (LISTEN)
socktest 1235 www_user   10u  IPv4   2956       TCP stornas.com.tw:http->192.168.2.36:2217 (FIN_WAIT2)

socktest listen to port 80



Reproduce code:
---------------
The environment is as below:
CPU: ARM 920
OS: Linux2.6.15 or Linux 2.6.25
Apache2: 2.2.3
PHP: 4.3.8 (libphp4.so) or 5.2.1 (libphp5.so) 
compiler: gcc 3.4.4 for ARM

test.php
<?php
    $output=array();
    $return_var=0;
    exec("/mnt/data/public/socktest > /dev/null &", $output,   $return_var);
?>    

If change to Apache/1.3.33 (Unix) PHP/4.3.8 configured
PHP is statically linked with apache, and execute the same test.php
socktest does not catch port 80.

socktest is a small program which listen to port 1212 and daemonize itself.

PC side using IE
   http://192.168.2.137/test.php

Expected result:
----------------
socktest should not listen to port 80, because it only listen to port 1212

Actual result:
--------------
socktest listen to port 80

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-04 02:52 UTC] aaron at stormsemi dot com
I tried php5.2-200807040030 and got the same result, the problem seems
caused by popen(), when a parent process that bind to a specific port
and spawn a child process then the child process inheres the existent socket opened by parent process.
 [2008-07-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 22:03:39 2021 UTC