php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63480 Warning on using the resource inline in the uri.
Submitted: 2012-11-10 13:24 UTC Modified: -
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: langemeijer@php.net Assigned:
Status: Open Package: ssh2 (PECL)
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-11-10 13:24 UTC] langemeijer@php.net
Description:
------------
Using the resource inline in the uri works, (ie, 
ssh2.sftp://$session/path/to/file) but will throw a "supplied resource is not a 
valid SSH2 SFTP resource in .." warning on things like file_get_contents.


--
I found this bugreport in a note in the manual, original by stm555 at hotmail dot 
com

Test script:
---------------
$session = ssh2_connect('shell.example.com', 22);
ssh2_auth_agent($session, 'username');

$passwd = file_get_contents("ssh2.sftp://$session/etc/passwd");


Expected result:
----------------
There should be no warning when everything is peachy

Actual result:
--------------
Warning: file_get_contents(): supplied resource is not a valid SSH2 SFTP resource 
in /home/casper/projects/aaa/ssh2.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat May 25 01:01:26 2019 UTC