6.0.0-beta1
7/7/25

[#6227] ssh2 implementation of VFS should quote whitespace pathnames with ssh2_exec
Summary ssh2 implementation of VFS should quote whitespace pathnames with ssh2_exec
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester herde (at) tu-harburg (dot) de
Created 02/07/2008 (6360 days ago)
Due
Updated 02/16/2008 (6351 days ago)
Assigned 02/09/2008 (6358 days ago)
Resolved 02/16/2008 (6351 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/16/2008 03:51:57 PM Jan Schneider Comment #8
State ⇒ Resolved
Reply to this comment
Fixed in CVS.
02/12/2008 10:35:49 AM herde (at) tu-harburg (dot) de Comment #7 Reply to this comment
This patch works for my installation



425c425

<                 $stream = @ssh2_exec($this->_stream, "ls -al $path");

---
                 $stream = @ssh2_exec($this->_stream, "ls -al 
".escapeshellarg($path));
428c428

<                 $stream = @ssh2_exec($this->_stream, "ls -l $path");

---
                 $stream = @ssh2_exec($this->_stream, "ls -l 
".escapeshellarg($path));
02/11/2008 12:36:02 PM herde (at) tu-harburg (dot) de Comment #6
New Attachment: debugging.png Download
Reply to this comment
i miss the graphics i tryed to attach. So here it is once mal a little 
smaler in size - i hope this will help
02/11/2008 10:16:57 AM herde (at) tu-harburg (dot) de Comment #5 Reply to this comment
one screenshot of a recent debugging session concerning VFS/ssh2.php 
shows the output of the error substream while trying to list the 
contents of a path named '/smb/rztmh/h/1b/rztmh/windows/My Documents'.
02/09/2008 09:55:38 AM Jan Schneider Comment #4
Assigned to Jan Schneider
State ⇒ Assigned
Reply to this comment
Works here.
02/09/2008 01:05:08 AM Michael Rubinsky Comment #3 Reply to this comment
Nope.  Building failed for me as well on two seperate boxes and a VM.


02/08/2008 07:25:10 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
I haven't been able to get the ssh2 extension to build on my dev boxes 
yet - do any other developers have it available to look at this?
02/07/2008 12:57:46 PM herde (at) tu-harburg (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ ssh2 implementation of VFS should quote whitespace pathnames with ssh2_exec
Queue ⇒ Horde Framework Packages
State ⇒ Unconfirmed
Reply to this comment
When we try to list the contents of an imported windows folder from a 
SSH2-Server (unix) and its pathname contains any whitespace characters 
we get an exhausted session memory and a blank page as result.



As far as i could figure out this is due to these lines of code:

VFS/ssh2.php Line 425 (ls -al) or 428 (ls -l)



$stream = @ssh2_exec($this->_stream, 'ls -al');



I wrote a little test script and looked onto the error substream which 
told me:



"No such file or directory: /path !"



if i try to execute a 'ls -l /path with whitespace'



if i do the same but quoting whitespace ('\ ') the code works fine  -

but it really should check for error messages and quote pathnames if 
nessessary ....



The exhausted session memory is produced afterwards when trying to 
read (blocked) from this stream and waiting for an EOF which results 
in an endless loop until the memory limit is reached.




Saved Queries