Bug #64330 [Opn->Csd]: stream_socket_server() creates wrong Abstract Namespace UNIX sockets
| From: | mike@php.net | Date: | Wed, 02 Apr 2014 09:16:04 +0000 |
| Subject: | Bug #64330 [Opn->Csd]: stream_socket_server() creates wrong Abstract Namespace UNIX sockets | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185027@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64330&edit=1
ID: 64330
Updated by: mike@php.net
Reported by: a dot yamanoi at gmail dot com
Summary: stream_socket_server() creates wrong Abstract
Namespace UNIX sockets
-Status: Open
+Status: Closed
Type: Bug
Package: Streams related
Operating System: Linux
PHP Version: 5.4.12
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=91a9d24aa30507e6c7d8937db2de24394f0ce121
Log: Fix bug #64330
Previous Comments:
------------------------------------------------------------------------
[2013-03-01 08:20:10] a dot yamanoi at gmail dot com
Description:
------------
stream_socket_server("unix://\x00/foo/bar") doesn't bind
a UNIX domain socket to the abstract namespace correctly.
The actual namespace string seems to be padded right with "\x00"s.
e.g.
"\x00/foo/bar\x00\x00...\x00"
So the stream_socket_client("unix://\x00/foo/bar") test below fails.
According to Bug #44127, stream_socket_client() works fine now.
The problem occurs in PHP 5.4.12 and the latest 5.4 snap(Built on: Mar 01, 2013
02:30 UTC).
Test script:
---------------
<?php
$server = stream_socket_server("unix://\x00/MyBindName");
$client = stream_socket_client("unix://\x00/MyBindName");
if ($client) {
echo "ok\n";
}
?>
Expected result:
----------------
ok
Actual result:
--------------
PHP Warning: stream_socket_client(): unable to connect to unix://\0/MyBindName
(Connection refused) in ...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64330&edit=1