[horde] VFS ssh2 _listFolder() buglet?

Benedetto Vassallo vassallo at unipa.it
Fri Jan 7 08:35:11 UTC 2011


Def. Quota "John H. Bennett III" <bennettj at thebennetthome.com>:

> Hello Benedetto,
>
> Would you mind sending me the details of how you got Gollen to work  
> with SSH2, on CentOS 5.5 please?  I tried doing this about 6 months  
> ago, but couldn't get things working.  I'd like to know what  
> additional files you had to download and what your backends.php and  
> conf.php for gollem looks like.
>
> I would greatly appreciate it.
>
> Thank you,
>
> John Bennett
>
> Quoting Benedetto Vassallo <vassallo at unipa.it>:
>
>>
>> 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.
>>
>> -- 
>> Horde mailing list
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>
>
>
>
>

Hello John,
I had to manually install the ssh2 extension for pear:

pear install ssh2

After this I configured my backend as follow:

$backends['ssh2'] = array(
     'name' => 'SSH2 Server',
     'driver' => 'ssh2',
     'preferred' => '',
     'hordeauth' => true,
     'params' => array(
         'hostspec' => 'my.ssh.server.fqdn',
         'port' => 22,
     ),

     'loginparams' => array(
         // Allow the user to change the SSH server
         // 'hostspec' => 'Hostname',
         // Allow the user to change the SSH port
         // 'port' => 'Port'
     ),


     ),
     'root' => '/home/' . Auth::getAuth(), //this sets the vfs root to  
'/home/user'
     'clipboard' => true,
     'attributes' => array('type', 'name', 'edit', 'download',  
'modified', 'size', 'permission', 'owner', 'group')
);

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