[horde] VFS ssh2 _listFolder() buglet?
Benedetto Vassallo
vassallo at unipa.it
Thu Jan 6 22:44:18 UTC 2011
Def. Quota Lawrence Stewart <lstewart at room52.net>:
> Hi all,
>
> Whilst switching my Gollem config over to using the ssh2 backend, I
> think I've found a bug in the ssh2 VFS code. I got the Gollem config to
> the point where I could successfully upload files, but the directory
> listing would always claim the directory to be empty without any sort of
> error logged in the horde log file.
>
> After a bit of sleuthing, I tracked the offending line of code to:
>
> $stream = @ssh2_exec($this->_stream, 'LC_TIME=C ls -' . $ls_args . ' ' .
> escapeshellarg($path));
>
> (Horde v3.3.11, line 489 of lib/VFS/ssh2.php)
>
> I use FreeBSD as the server OS and tcsh as my shell. Prefixing the
> command with an ENV=VAR assignment only works on Bourne type shells. It
> seems the sftp server on FreeBSD runs the command in the context of the
> user's selected shell as opposed to /bin/sh, because the offending line
> produces no output as a result of the command failing.
>
> My solution fixes the problem for me and I believe is more correct than
> the current code. By prefixing the ls command with "env", all shells
> including tcsh are happy i.e.:
>
> $stream = @ssh2_exec($this->_stream, 'env LC_TIME=C ls -' . $ls_args . '
> ' . escapeshellarg($path));
>
> Prefixing with env allows everything to work perfectly for me.
>
> Does the above seem reasonable or have I misunderstood something? I'll
> file a bug report with the patch if people think my analysis is correct.
>
> Cheers,
> Lawrence
>
> PS: I haven't looked, but I suspect there could be instances of other
> such problems in the tree. It would be useful to do an audit of command
> lines run by horde to look for others which set env vars in the same
> manner as the above code.
> --
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
Hello,
As a feedback I use Horde 3.3.11 and gollem 1.1.2 on CentOs 5.5, php
5.1.6, bash shell and ssh2 backend works fine for me.
Regards
--
Benedetto Vassallo
Sistema Informativo di Ateneo
Settore Gestione Reti Hardware e Software
U.O. Sviluppo e manutenzione dei sistemi
Università degli studi di Palermo
Red Hat Certified Engineer Certificate Number: 804007793324656
Phone: +3909123860056
Fax: +390916529124
-------------------------------------------------------------------------
This message was sent using the University of Palermo web mail interface.
More information about the horde
mailing list