From:             a dot yamanoi at gmail dot com
Operating system: Linux
PHP version:      5.4.12
Package:          Streams related
Bug Type:         Bug
Bug description:stream_socket_server() creates wrong Abstract Namespace UNIX 
sockets

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 bug report at https://bugs.php.net/bug.php?id=64330&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64330&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64330&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64330&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64330&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64330&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64330&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64330&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64330&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64330&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64330&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64330&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64330&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64330&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64330&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64330&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64330&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64330&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64330&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64330&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64330&r=mysqlcfg

Reply via email to