[horde] [PATCH] Bug in lib/VFS/ssh2.php and ingo/lib/Driver/vfs.php?
Lawrence Stewart
lstewart at room52.net
Tue Oct 27 23:44:18 UTC 2009
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',
)
)
);
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: horde_sshfilesizefix.diff
URL: <http://lists.horde.org/archives/horde/attachments/20091027/2ee0a396/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ingo_fixread.diff
URL: <http://lists.horde.org/archives/horde/attachments/20091027/2ee0a396/attachment-0001.ksh>
More information about the horde
mailing list