On Tue, 2003-01-14 at 19:18, Chris Martino wrote:

> Now, my question is can I setup ftp proxy to automatically forward or
> connect to an ftp server based on the username it is given?

I wanted to do exactly the same thing recently, so did a bit of
patching.  The resulting patch (against 1.1.5) is attached.  Be warned,
I've not had a chance to do much testing on this yet.

The way it works is by changing the way the server command line
parameter is treated.  If the server name begins with a "/" it assumes a
lookup table (otherwise it behaves as before.)  The table is a
BerkeleyDB hash with the username as the key and the server name as the
value (both null terminated strings.)

Rather obviously, since it uses a BerkeleyDB hash, you need to have the
BerkeleyDB libraries to build it (I'm using version 3, but the others
will probably work the same.)

    Chris.

-- 
Chris Stratford  | [EMAIL PROTECTED]
PIPEX Internet   | (01707) 299532

Attachment Converted: 
"D:\Programme\Qualcomm\Eudora\Attach\ftpproxy-1.1.5-db.diff"
From [EMAIL PROTECTED] Mon Jan 20 10:18:12 2003
X-Persona: <ftp.pproxy>
Return-path: <[EMAIL PROTECTED]>
Received: from sj-msg-core-3.cisco.com ([171.70.157.152])
                by compucation.de ([213.185.64.44])
                with SMTP (MDaemon.PRO.v6.5.2.R)
                for <[email protected]>; Mon, 20 Jan 2003 04:16:21 +0100
Subject: [general-l] ftp.proxy access question {03}
From: Damian Ivereigh <[EMAIL PROTECTED]>
To: "ftp.proxy" <[email protected]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
                 <[EMAIL PROTECTED]>
Organization: Cisco Systems Inc
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.1
Date: 20 Jan 2003 14:09:29 +1100
X-Lookup-Warning: MAIL lookup on [EMAIL PROTECTED] does not match 171.70.157.152
X-MDRcpt-To: [EMAIL PROTECTED]
X-MDRemoteIP: 171.70.157.152
Sender: [EMAIL PROTECTED]
X-Return-Path: [EMAIL PROTECTED]
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
X-MDMailing-List: [EMAIL PROTECTED]
X-MDSend-Notifications-To: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
X-MDaemon-Deliver-To: [email protected]
X-Eudora2Unix: 3905-11-05T08:39:35Z converted

I have an alternate implementation which involves a similar mechanism to
the access control and command control scripts. I have called it
"translation program". The principle is that new -t option is added with
an argument to a script to run.

In the same way as the CCP and ACP scripts, various info is passed into
the trp through environment variables. However unlike ACP & CCP, the
results are sent back by send the lines "variable=value" to the stdout.
The four variables accepted are:-

PROXY_SERVERNAME - new server to connect to
PROXY_SERVERLOGIN - new login name to use
PROXY_SERVERPASSWD - new password to use
PROXY_SERVERPORT - new port to use

I enclose a sample trp script and the patch to make this happen. Let me
know if it is of interest.

Damian



On Wed, 2003-01-15 at 20:44, Chris Stratford wrote:
> On Tue, 2003-01-14 at 19:18, Chris Martino wrote:
> 
> > Now, my question is can I setup ftp proxy to automatically forward or
> > connect to an ftp server based on the username it is given?
> 
> I wanted to do exactly the same thing recently, so did a bit of
> patching.  The resulting patch (against 1.1.5) is attached.  Be warned,
> I've not had a chance to do much testing on this yet.
> 
> The way it works is by changing the way the server command line
> parameter is treated.  If the server name begins with a "/" it assumes a
> lookup table (otherwise it behaves as before.)  The table is a
> BerkeleyDB hash with the username as the key and the server name as the
> value (both null terminated strings.)
> 
> Rather obviously, since it uses a BerkeleyDB hash, you need to have the
> BerkeleyDB libraries to build it (I'm using version 3, but the others
> will probably work the same.)
> 
>     Chris.
-- 
Damian Ivereigh
CEPS Team Lead
Desk: +61 2 8446 6344
Mob: +61 418 217 582

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html 

PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x24E7A68F

Attachment Converted: "D:\Programme\Qualcomm\Eudora\Attach\trp"

Attachment Converted: 
"D:\Programme\Qualcomm\Eudora\Attach\ftpproxy-trans.patch2"

Attachment Converted: "D:\Programme\Qualcomm\Eudora\Attach\signature18.asc"
From [EMAIL PROTECTED] Mon Jan 20 13:07:43 2003
X-Persona: <ftp.pproxy>
Return-path: <[EMAIL PROTECTED]>
Received: from mxgw.highway.co.uk ([194.200.10.4])
                by compucation.de ([213.185.64.44])
                with SMTP (MDaemon.PRO.v6.5.2.R)
                for <[email protected]>; Mon, 20 Jan 2003 13:00:18 +0100
Subject: [general-l] ftp.proxy access question {04}
From: Chris Stratford <[EMAIL PROTECTED]>
To: "ftp.proxy" <[email protected]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
                 <[EMAIL PROTECTED]>
                 <[EMAIL PROTECTED]>
Organization: 
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.1
Date: 20 Jan 2003 12:00:14 +0000
Content-Transfer-Encoding: 7bit
X-Lookup-Warning: MAIL lookup on [EMAIL PROTECTED] does not match 194.200.10.4
X-MDRcpt-To: [EMAIL PROTECTED]
X-MDRemoteIP: 194.200.10.4
Sender: [EMAIL PROTECTED]
X-Return-Path: [EMAIL PROTECTED]
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
X-MDMailing-List: [EMAIL PROTECTED]
X-MDSend-Notifications-To: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
X-MDaemon-Deliver-To: [email protected]
X-Eudora2Unix: 3905-11-05T08:39:35Z converted

On Mon, 2003-01-20 at 03:09, Damian Ivereigh wrote:
> I have an alternate implementation which involves a similar mechanism to
> the access control and command control scripts. I have called it
> "translation program". The principle is that new -t option is added with
> an argument to a script to run.

Hmm, I like your approach far better than mine -  much more flexible
(plus anything that doesn't involve linking the BerkeleyDB libraries
into the main program has to be good :-)

I think I may have to give it a try later this week.

    Chris.

Reply via email to