[Tickets #7403] VFS ssh2 doesnt work correctly

bugs at horde.org bugs at horde.org
Sat Sep 27 13:59:53 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/7403
------------------------------------------------------------------------------
  Ticket             | 7403
  Created By         | holger.wegner at hamburg.de
  Summary            | VFS ssh2 doesnt work correctly
  Queue              | Horde Framework Packages
  Version            | FRAMEWORK_3
  Type               | Bug
  State              | Unconfirmed
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


holger.wegner at hamburg.de (2008-09-27 09:59) wrote:

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





More information about the bugs mailing list