diff options
author | Nikita Popov <nikic@php.net> | 2016-08-30 13:45:49 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-08-30 13:45:49 +0200 |
commit | c361020f04548d4b0c3dd162828836a283fed68e (patch) | |
tree | 5bebd20e75da39c2a2e38612de2b9dc2aec66814 | |
parent | d49024c6ded6eea1f73bed895716b8494ea7b440 (diff) | |
parent | 2c12a5f0a87f1524bf7dae7ef0eca2878b7b9fdc (diff) | |
download | php-git-c361020f04548d4b0c3dd162828836a283fed68e.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
-rw-r--r-- | ext/ftp/tests/server.inc | 9 | ||||
-rw-r--r-- | ext/standard/tests/streams/bug72771.phpt | 23 |
2 files changed, 31 insertions, 1 deletions
diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index 5629c2e312..1a04cd179b 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -139,7 +139,10 @@ if ($pid) { $buf = fread($s, 2048); } - if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) { + if ($buf == "AUTH TLS\r\n") { + fputs($s, "500 not supported.\r\n"); + return ; + } else if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) { fputs($s, "500 Syntax error, command unrecognized.\r\n"); dump_and_exit($buf); } @@ -208,6 +211,10 @@ if ($pid) { $ascii = true; fputs($s, "200 OK\r\n"); + } elseif ($buf === "AUTH SSL\r\n") { + $ascii = true; + fputs($s, "500 not supported\r\n"); + } elseif ($buf === "TYPE I\r\n") { $ascii = false; fputs($s, "200 OK\r\n"); diff --git a/ext/standard/tests/streams/bug72771.phpt b/ext/standard/tests/streams/bug72771.phpt new file mode 100644 index 0000000000..b38ccbdda8 --- /dev/null +++ b/ext/standard/tests/streams/bug72771.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #72771. FTPS to FTP downgrade not allowed when server doesn't support AUTH TLS or AUTH SSL. +--SKIPIF-- +<?php +if (array_search('ftp',stream_get_wrappers()) === FALSE) die("skip ftp wrapper not available."); +if (!function_exists('pcntl_fork')) die("skip pcntl_fork() not available."); +if (!extension_loaded('openssl')) die ("skip openssl not available."); +?> +--FILE-- +<?php + +require __DIR__ . "/../../../ftp/tests/server.inc"; + +$path="ftps://127.0.0.1:" . $port."/"; + +$ds=opendir($path, $context); +var_dump($ds); +?> +==DONE== +--EXPECTF-- +Warning: opendir(ftps://127.0.0.1:%d/): failed to open dir: Server doesn't support FTPS. in %s on line %d +bool(false) +==DONE== |