[horde] [PATCH] Bug in lib/VFS/ssh2.php and ingo/lib/Driver/vfs.php?

Lawrence Stewart lstewart at room52.net
Thu Oct 29 18:21:03 UTC 2009


Jan Schneider wrote:
> Zitat von Lawrence Stewart <lstewart at room52.net>:
> 
>> Hi All,
>>
>> Updating and reading of my .procmailrc file via Ingo stopped working 
>> after a recent system update to Horde 3.3.5/Ingo 1.2.2. After 
>> realising the "vfs_path" param was now required in Ingo's 
>> config/backends.php file (used to work without it), there were still 
>> issues retrieving the active script.
>>
>> I tracked the problem to the 2 files mentioned in the subject. The 
>> attached "ingo_fixread.diff" patch updates the vfs->read() call Ingo 
>> makes to try and retrieve the active script file. The patch makes the 
>> read() call pass parameters in the way the VFS code seems to expect 
>> them (gleaned from observing how the write code path works). I believe 
>> things may work without this patch but it seems to be more correct 
>> this way to me.
>>
>> The attached "horde_sshfilesizefix.diff" patch addresses the fact that 
>> even though the active script file was being successfully pulled via 
>> ssh and created as a local tmpfile, the filesize() check on the local 
>> tmpfile would always return 0, even though the tmpfile actually 
>> contained data (verified by hacking source code to dump contents of 
>> tmpfile into a separate file). It seems some prior calls to PHP 
>> functions that call the underlying OS stat() routine were caching the 
>> filesize at 0 (before it had been populated), and this in turn meant 
>> the script would not be successfully displayed to the user. Clearing 
>> the stat cache fully mitigates the issue for me.
>>
>> With these two patches applied, everything is peachy again. For 
>> posterity's sake, my working Ingo backends.php config is included at 
>> the end of the email.
>>
>> Cheers,
>> Lawrence
>>
>>
>>
>>
>>
>> $backends['procmail'] = array(
>>     'driver' => 'vfs',
>>     'preferred' => '',
>>     'hordeauth' => true,
>>     'params' => array(
>>         'hostspec' => '127.0.0.1',
>>         'filename' => '.procmailrc',
>>         'port' => 22,
>>         'vfs_path' => '/home/%U',
>>         'vfstype' => 'ssh2'
>>     ),
>>     'script' => 'procmail',
>>     'scriptparams' => array(
>>         'path_style' => 'mbox',
>>         'variables' => array(
>>             'MAILDIR' => '$HOME/.mail',
>>         )
>>     )
>> );
>>
> 
> 
> Please create a ticket on http://bugs.horde.org/.

Tickets 8669 for the Horde patch and 8670 for the Ingo patch are now in 
the bug tracker.

Cheers,
Lawrence


More information about the horde mailing list