6.0.0-git
2019-10-14

[#6435] jail for multiple homes
Summary jail for multiple homes
Queue Gollem
Queue Version HEAD
Type Enhancement
State Accepted
Priority 1. Low
Owners
Requester horde-tr (at) metu (dot) edu (dot) tr
Created 2008-03-12 (4233 days ago)
Due
Updated 2008-04-04 (4210 days ago)
Assigned
Resolved
Milestone
Patch No

History
2008-04-04 12:25:05 Jan Schneider State ⇒ Accepted
 
2008-03-13 11:47:42 horde-tr (at) metu (dot) edu (dot) tr Comment #3 Reply to this comment
Yes. It leads to the error: "Backend Configuration Error: Home 
directory not below root."



Emre.
Did you try root = '~' and home = ''? home = './' doesn't look correct to me.
2008-03-13 11:14:35 Jan Schneider State ⇒ Feedback
 
2008-03-13 11:14:27 Jan Schneider Comment #2 Reply to this comment
Did you try root = '~' and home = ''? home = './' doesn't look correct to me.
2008-03-12 16:56:17 horde-tr (at) metu (dot) edu (dot) tr Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ jail for multiple homes
Queue ⇒ Gollem
Milestone ⇒
Patch ⇒ No
Reply to this comment
Hi,



If you have multiple home directories on the ftp server like;



/home_1/user_a

/home_2/user_b



you cannot define a static 'root' => '/home' and a 'home' => 
Auth::getAuth() line to jail a user to the home (in conf/backends.php).



The only choice left (that I could figure out :) is to use something 
like 'root' => '~' and 'home' => './' which seems to be working until 
you try to "cd" to a sub-directory (error: ~/~/sub-directory not found).



This did the trick for me;



Added the lines below to horde/gollem/lib/Sessions.php just above the comment:

"Make sure the home parameter lives under root ...." on line 127;



if (!empty($ptr['multihomejail'])) {

      if ($ptr['multihomejail'] == true) {

          $ptr['home'] =  $GLOBALS['gollem_vfs']->getCurrentDirectory();

          $ptr['root'] =  $ptr['home'];

      }

  }



and added the parameter 'multihomejail' => true to 
horde/gollem/config/backends.php . A sample ftp entry looks like this;



$backends['hordeftp'] = array(

     'name' => 'WebFTP',

     'driver' => 'ftp',

     'preferred' => '',

     'hordeauth' => true,

     'params' => array(

         'hostspec' => 'servername',

         'port' => 21,

         'pasv' => true,

         'vfsroot' => '',

        'permissions' => '700'

     ),

     'loginparams' => array(

     ),

     'root' => '',

     'home' => '',

     'multihomejail' => true,

     'clipboard' => true,

     'attributes' => array('type', 'name', 'edit', 'download', 
'modified', 'size', 'permission', 'owner', 'group')

);



Best regards,



Emre Sezginer

horde-tr team

horde-tr.at.metu.edu.tr

Saved Queries