6.0.0-alpha14
7/2/25

[#7403] VFS ssh2 doesnt work correctly
Summary VFS ssh2 doesnt work correctly
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State No Feedback
Priority 2. Medium
Owners
Requester holger.wegner (at) hamburg (dot) de
Created 09/27/2008 (6122 days ago)
Due
Updated 10/28/2008 (6091 days ago)
Assigned 09/28/2008 (6121 days ago)
Resolved 10/23/2008 (6096 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/28/2008 10:53:59 PM holger (dot) wegner (at) hamburg (dot) de Comment #7 Reply to this comment
I know, late response, no time to look her for the system. But you are 
right, my debian system should take the LC_TIME Variable, as it worked 
for me with LC_ALL, its okay. I have to look for a reason why it 
doesnt accept LC_TIME.

Thanks for your help.
10/23/2008 11:15:02 PM Jan Schneider State ⇒ No Feedback
 
10/07/2008 01:02:23 PM Jan Schneider Comment #6 Reply to this comment
I'm not sure if it makes sense to work around broken servers that 
don't apply LC_TIME correctly. The log you provided is *not* using 
LC_TIME=C.
09/29/2008 04:58:42 PM holger (dot) wegner (at) hamburg (dot) de Comment #5 Reply to this comment
Now I got a little bit further on. I changed in the original ssh2.php 
the LC_TIME to LC_ALL and it works now for me.
09/29/2008 04:25:12 PM holger (dot) wegner (at) hamburg (dot) de Comment #4 Reply to this comment
Here some more informations about the environment of the ssh stream:



SHELL=/bin/bash

SSH_CLIENT=127.0.0.1 55615 5622

LC_ALL=de_DE.utf8

USER=holweg

MAIL=/var/mail/holweg

PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

LANG=de_DE.UTF-8

GDM_LANG=de_DE.utf8

SHLVL=1

LANGUAGE=de_DE:de:en_GB:en



and the complete language environment:

LANG=de_DE.UTF-8

LANGUAGE=de_DE:de:en_GB:en

LC_CTYPE="de_DE.utf8"

LC_NUMERIC="de_DE.utf8"

LC_TIME="de_DE.utf8"

LC_COLLATE="de_DE.utf8"

LC_MONETARY="de_DE.utf8"

LC_MESSAGES="de_DE.utf8"

LC_PAPER="de_DE.utf8"

LC_NAME="de_DE.utf8"

LC_ADDRESS="de_DE.utf8"

LC_TELEPHONE="de_DE.utf8"

LC_MEASUREMENT="de_DE.utf8"

LC_IDENTIFICATION="de_DE.utf8"

LC_ALL=de_DE.utf8
09/29/2008 02:52:47 PM holger (dot) wegner (at) hamburg (dot) de Comment #3
New Attachment: test.txt Download
Reply to this comment
The current code works correctly for me, and I get incorrect entries
with your changes. The driver isn't really set up to be unit tested
for this, but maybe we can reorganize it. Can you log the result of
ssh2_exec and upload it, so we can compare?
I am not sure what you want as log file, as I dont know to have a log 
from ssh2_exec. I changed ssh2.php to write the stream of ssh2_exec 
line by line to a file. Here it is.
09/28/2008 05:31:37 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
The current code works correctly for me, and I get incorrect entries 
with your changes. The driver isn't really set up to be unit tested 
for this, but maybe we can reorganize it. Can you log the result of 
ssh2_exec and upload it, so we can compare?
09/27/2008 01:59:53 PM holger (dot) wegner (at) hamburg (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ VFS ssh2 doesnt work correctly
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
I tried to use in gollem the ssh2 driver. But in the list of files 
returned the filename was wrong:

"1000   50      112 30. Okt 2004  ldap"

But other names were correct, except that there was an space in front 
of the name.

The ones that worked, had an time in the year field.

I looked in the ssh2.php of the VFS and noticed that it was connected 
to the following line 542:

$file['name'] = substr($line, strpos($line, sprintf("%s %2s %5s", 
$item[5], $item[6], $item[7])) + 13);

When I changed it to

$file['name'] = substr($line, strpos($line, sprintf("%3s %3s %-5s", 
$item[5], $item[6], $item[7])) + 14);

That worked for the mayority of files but not for all. It seems to be 
connected to my locale, for this user it is LC_ALL=de_DE.utf8.

At the end I had the best result with follwoing solution, and seems to 
be the most stable:

Line 488 old:

$stream = @ssh2_exec($this->_stream, 'LC_TIME=C ls -' . $ls_args . ' ' 
. escapeshellarg($path));

to

$stream = @ssh2_exec($this->_stream, 'LC_TIME=C ls --time-style=+"%d 
%m %Y" -' . $ls_args . ' ' . escapeshellarg($path));



Line 542 to

$file['name'] = substr($line, strpos($line, sprintf("%2s %2s %4s", 
$item[5], $item[6], $item[7])) + 11);



Line 601

$file['date'] = strtotime('00:00:00' . $item[5] . ' ' . $item[6] . ' ' 
. $item[7]);

to

$file['date'] = strtotime('00:00:00' . $item[5] . '.' . $item[6] . '.' 
. $item[7]);



Thanks

Saved Queries