mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fix bug #64330
stream_socket_server() creates wrong Abstract Namespace UNIX sockets
This commit is contained in:
parent
f244513fc0
commit
91a9d24aa3
5
NEWS
5
NEWS
@ -1,6 +1,11 @@
|
|||||||
PHP NEWS
|
PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? 2014, PHP 5.4.28
|
?? ??? 2014, PHP 5.4.28
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
|
||||||
|
UNIX sockets). (Mike)
|
||||||
|
|
||||||
- Embed:
|
- Embed:
|
||||||
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol)
|
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol)
|
||||||
|
|
||||||
|
20
ext/standard/tests/network/bug64330.phpt
Normal file
20
ext/standard/tests/network/bug64330.phpt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!in_array("unix", stream_get_transports())) die("SKIP unix domain sockets unavailable");
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
echo "Test\n";
|
||||||
|
$server = stream_socket_server("unix://\x00/MyBindName");
|
||||||
|
$client = stream_socket_client("unix://\x00/MyBindName");
|
||||||
|
if ($client) {
|
||||||
|
echo "ok\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
===DONE===
|
||||||
|
--EXPECT--
|
||||||
|
Test
|
||||||
|
ok
|
||||||
|
===DONE===
|
@ -588,7 +588,8 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
|
|||||||
|
|
||||||
parse_unix_address(xparam, &unix_addr TSRMLS_CC);
|
parse_unix_address(xparam, &unix_addr TSRMLS_CC);
|
||||||
|
|
||||||
return bind(sock->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr));
|
return bind(sock->socket, (const struct sockaddr *)&unix_addr,
|
||||||
|
(socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user