<?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>ssh2 VFS module stat() cache needs to be flushed in read() before checking file size</title> 
  <pubDate>Fri, 10 Apr 2026 09:20:59 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/8669</link> 
  <atom:link rel="self" type="application/rss+xml" title="ssh2 VFS module stat() cache needs to be flushed in read() before checking file size" href="https://bugs.horde.org/ticket/8669/rss" /> 
  <description>ssh2 VFS module stat() cache needs to be flushed in read() before checking file size</description> 
 
   
   
  <item> 
   <title>The remote file is able to be successfully retrieved by the </title> 
   <description>The remote file is able to be successfully retrieved by the ssh2 VFS module and stored in a local temp file. However, the  &quot;$size = filesize($file);&quot; line in the read() function returns the size of the local temp file as 0 which in turn results in no file content being returned.



This is caused by calling certain other PHP function(s) (which rely on the underlying OS stat() function) on the temp file prior to it actually being populated with remote content. The details of the first stat() on the temp file are cached in the PHP stat cache, so even though the temp file subsequently gets populated with content, the cache returns data for the temp file which is stale.



On a more general note, this type of bug seems like it may be relevant to any filesystem-based VFS modules, so it may be wise to audit the use of the functions listed here in the &quot;Affected functions&quot; list:

http://us2.php.net/manual/en/function.clearstatcache.php

and check if calls to clearstatcache() are required in other places within Horde as well.</description> 
   <pubDate>Thu, 29 Oct 2009 18:12:15 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8669#t56477</link> 
  </item> 
   
  <item> 
   <title>Seems my patch didn&#039;t make it.</title> 
   <description>Seems my patch didn&#039;t make it.</description> 
   <pubDate>Thu, 29 Oct 2009 18:20:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8669#t56479</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

Clear the st</title> 
   <description>Changes have been made in CVS for this ticket:

Clear the stat cache before reading the filesize of a temp file that may already
be cached.
Bug: 8669
Submitted by: lstewart (at) room52 (dot) net
http://cvs.horde.org/diff.php/framework/VFS/lib/VFS/ssh2.php?rt=horde&amp;r1=1.15&amp;r2=1.16&amp;ty=u</description> 
   <pubDate>Sun, 01 Nov 2009 02:28:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8669#t56489</link> 
  </item> 
   
  <item> 
   <title>Committed - nice catch!</title> 
   <description>Committed - nice catch!</description> 
   <pubDate>Sun, 01 Nov 2009 02:29:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8669#t56490</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
