<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>VFS ssh2 doesnt work correctly</title> 
  <pubDate>Wed, 08 Apr 2026 08:59:00 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7403</link> 
  <atom:link rel="self" type="application/rss+xml" title="VFS ssh2 doesnt work correctly" href="https://bugs.horde.org/ticket/7403/rss" /> 
  <description>VFS ssh2 doesnt work correctly</description> 
 
   
   
  <item> 
   <title>I tried to use in gollem the ssh2 driver. But in the list of</title> 
   <description>I tried to use in gollem the ssh2 driver. But in the list of files returned the filename was wrong:

&quot;1000   50      112 30. Okt 2004  ldap&quot;

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[&#039;name&#039;] = substr($line, strpos($line, sprintf(&quot;%s %2s %5s&quot;, $item[5], $item[6], $item[7])) + 13);

When I changed it to 

$file[&#039;name&#039;] = substr($line, strpos($line, sprintf(&quot;%3s %3s %-5s&quot;, $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-&gt;_stream, &#039;LC_TIME=C ls -&#039; . $ls_args . &#039; &#039; . escapeshellarg($path));

to

$stream = @ssh2_exec($this-&gt;_stream, &#039;LC_TIME=C ls --time-style=+&quot;%d %m %Y&quot; -&#039; . $ls_args . &#039; &#039; . escapeshellarg($path));



Line 542 to

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



Line 601

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

to

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



Thanks</description> 
   <pubDate>Sat, 27 Sep 2008 13:59:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49262</link> 
  </item> 
   
  <item> 
   <title>The current code works correctly for me, and I get incorrect</title> 
   <description>The current code works correctly for me, and I get incorrect entries with your changes. The driver isn&#039;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?</description> 
   <pubDate>Sun, 28 Sep 2008 17:31:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49278</link> 
  </item> 
   
  <item> 
   <title>&gt; The current code works correctly for me, and I get incorre</title> 
   <description>&gt; The current code works correctly for me, and I get incorrect entries 

&gt; with your changes. The driver isn&#039;t really set up to be unit tested 

&gt; for this, but maybe we can reorganize it. Can you log the result of 

&gt; 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.</description> 
   <pubDate>Mon, 29 Sep 2008 14:52:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49282</link> 
  </item> 
   
  <item> 
   <title>Here some more informations about the environment of the ssh</title> 
   <description>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=&quot;de_DE.utf8&quot;

LC_NUMERIC=&quot;de_DE.utf8&quot;

LC_TIME=&quot;de_DE.utf8&quot;

LC_COLLATE=&quot;de_DE.utf8&quot;

LC_MONETARY=&quot;de_DE.utf8&quot;

LC_MESSAGES=&quot;de_DE.utf8&quot;

LC_PAPER=&quot;de_DE.utf8&quot;

LC_NAME=&quot;de_DE.utf8&quot;

LC_ADDRESS=&quot;de_DE.utf8&quot;

LC_TELEPHONE=&quot;de_DE.utf8&quot;

LC_MEASUREMENT=&quot;de_DE.utf8&quot;

LC_IDENTIFICATION=&quot;de_DE.utf8&quot;

LC_ALL=de_DE.utf8</description> 
   <pubDate>Mon, 29 Sep 2008 16:25:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49285</link> 
  </item> 
   
  <item> 
   <title>Now I got a little bit further on. I changed in the original</title> 
   <description>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.</description> 
   <pubDate>Mon, 29 Sep 2008 16:58:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49286</link> 
  </item> 
   
  <item> 
   <title>I&#039;m not sure if it makes sense to work around broken servers</title> 
   <description>I&#039;m not sure if it makes sense to work around broken servers that don&#039;t apply LC_TIME correctly. The log you provided is *not* using LC_TIME=C.</description> 
   <pubDate>Tue, 07 Oct 2008 13:02:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t49442</link> 
  </item> 
   
  <item> 
   <title>I know, late response, no time to look her for the system. B</title> 
   <description>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.</description> 
   <pubDate>Tue, 28 Oct 2008 22:53:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7403#t50132</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
