Edit report at https://bugs.php.net/bug.php?id=60106&edit=1
ID: 60106 Updated by: il...@php.net Reported by: tyr...@php.net Summary: stream_socket_server + long unix socket path = 'Unknown error' -Status: Open +Status: Closed Type: Bug Package: Streams related Operating System: linux debian squeeze 64 bit PHP Version: 5.4.0beta2 -Assigned To: +Assigned To: iliaa Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-03-03 20:36:07] il...@php.net Automatic comment from SVN on behalf of iliaa Revision: http://svn.php.net/viewvc/?view=revision&revision=323852 Log: Fixed bug #60106 (stream_socket_server silently truncates long unix socket paths) ------------------------------------------------------------------------ [2011-10-22 10:49:25] larue...@php.net the limition is in socket self, not php, yes PHP can increase the limition, but I am afraid it dosen't work too. but maybe we can throw warning when truncation occurring. ------------------------------------------------------------------------ [2011-10-21 08:21:38] tyr...@php.net I'm fine with the idea to mark this as a documentation problem, but maybe we should change the length limit to something more common, like 127 or 255. what do you think? ------------------------------------------------------------------------ [2011-10-21 03:51:13] larue...@php.net actullay, there is a limition, sys/un.h /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ struct sockaddr_un { __SOCKADDR_COMMON (sun_); char sun_path[108]; /* Path name. */ }; I think this issue could mark as doc problem. ------------------------------------------------------------------------ [2011-10-20 19:11:44] tyr...@php.net Description: ------------ this works: ./sapi/cli/php -r '$file = "/tmp/".str_repeat("a", 101);stream_socket_server("unix://".$file) && unlink($file);' this isn't: ./sapi/cli/php -r '$file = "/tmp/".str_repeat("a", 102);stream_socket_server("unix://".$file) && unlink($file);' gives me an: Warning: stream_socket_server(): unable to connect to unix:///tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (Unknown error) in Command line code on line 1 I didn't found any mention in the documentation about restrictions on the length of the socket file. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60106&edit=1