Bug #74598 [Csd]: unlink ignores stream context
| From: | pollita@php.net | Date: | Sun, 28 May 2017 04:26:33 +0000 |
| Subject: | Bug #74598 [Csd]: unlink ignores stream context | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209291@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74598&edit=1
ID: 74598
Updated by: pollita@php.net
Reported by: ma at temponizer dot dk
Summary: unlink ignores stream context
Status: Closed
Type: Bug
Package: FTP related
Operating System: CentOS
PHP Version: 7.0.19
-Assigned To:
+Assigned To: pollita
Block user comment: N
Private report: N
New Comment:
Fixed for PHP 7.0.21, 7.1.7, and 7.2.0 by https://github.com/php/php-src/commit/05849a242a878d5513e3e3be78a0c89fb9fa342b
Previous Comments:
------------------------------------------------------------------------
[2017-05-28 04:24:07] pollita@php.net
Automatic comment on behalf of pollita
Revision: http://git.php.net/?p=php-src.git;a=commit;h=05849a242a878d5513e3e3be78a0c89fb9fa342b
Log: Bugfix #74598 ftp:// ignores context
------------------------------------------------------------------------
[2017-05-16 07:09:45] requinix@php.net
Indeed, it is ignored.
https://github.com/php/php-src/blob/PHP-7.0.19/ext/standard/ftp_fopen_wrapper.c#L911
Same for rename, mkdir, and rmdir. opendir and stat do use it.
------------------------------------------------------------------------
[2017-05-16 06:57:53] ma at temponizer dot dk
Just tested further and it seems like it ignores the stream context completely.
------------------------------------------------------------------------
[2017-05-15 14:10:40] ma at temponizer dot dk
Description:
------------
When using unlink for a FTPS filename with a stream context where verify_peer is set to false, it
still tries to verify the certificate.
This results in two warnings
- "SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"
- "Unable to connect to ftps://servername/path"
Test script:
---------------
$sslContext = stream_context_create(['ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]]);
unlink('ftps://servername/path', $sslContext);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74598&edit=1