Article delegate-en/3691 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A3690@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Question regarding FTPCONF
29 Mar 2007 18:00:07 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A3690@delegate-en.ML_> on 03/29/07(22:39:51)
you Michael Portz <pnihabdyi-aipiirakgulr.ml@ml.delegate.org> wrote:
 |I am running the following delegated setting:
 |
 | delegated -P21 SERVER=ftp MOUNT="/A/* ftp://srvA/*" MOUNT="/B/* ftp://srvB/*"
 |
 |Thus, delegated proxies two different servers in two differents directories.
 |Alas one of the servers *only* allows passive mode while the other *only* allows
 |active mode. Can I anyhow restrict the validity of a "FTPCONF=nopasv" parameter
 |to one of the MOUNT parameters only?

It is natural to expect that you can specify FTPCONF as an option local to
each MOUNT point, but it has not been implemented (yet).
The enclosed patch is a tentative implementation of it, and with it you can
use FTPCONF in each MOUNT parameter as follows:

  MOUNT="/A/* ftp://srvA/* FTPCONF=noport:sv"
  MOUNT="/B/* ftp://srvB/* FTPCONF=nopasv:sv"

The patch also enables CMAP for FTPCCONF as follows:

  CMAP="{nopasv:sv}:FTPCONF:ftp:servA"
  CMAP="{noport:sv}:FTPCONF:ftp:servB"

The patch will be applied to the next release (9.6.0-pre5).

Cheers,
Yutaka
--
  9 9   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


*** /Users/yutaka/dist/src/delegate9.6.0-pre4/src/ftp.c	Fri Mar 23 04:23:12 2007
--- src/ftp.c	Fri Mar 30 02:54:54 2007
***************
*** 426,431 ****
--- 426,460 ----
  	init_conf();
  	scan_commaListL(conf,0,scanListCall conf1);
  }
+ 
+ #include "param.h"
+ static FtpConf *sfc;
+ static void setupFCF(Connection *Conn){
+ 	IStr(conf,1024);
+ 	int ci;
+ 	const char *mo;
+ 	const char *confv;
+ 
+ 	if( sfc == 0 ){
+ 		sfc = (FtpConf*)malloc(sizeof(FtpConf));
+ 		*sfc = FCF; /* save the common config. */
+ 	}else	FCF = *sfc; /* restore the common config. */
+ 	for( ci=0; 0 <= (ci=find_CMAPi(Conn,P_FTPCONF,ci,AVStr(conf))); ci++ ){
+ 		Verbose("%s=%s (CMAP)\n",P_FTPCONF,conf);
+ 		scan_FTPCONF(Conn,conf);
+ 	}
+ 	if( MountOptions ){
+ 		/* maybe this should be done in eval_mountOptions() */
+ 		for( mo = MountOptions; *mo; ){
+ 			mo = scan_ListElem1(mo,',',AVStr(conf));
+ 			if( confv = parameq(conf,P_FTPCONF) ){
+ 				Verbose("%s=%s (MOUNT)\n",P_FTPCONF,confv);
+ 				scan_FTPCONF(Conn,confv);
+ 			}
+ 		}
+ 	}
+ }
+ 
  static void CCXreq(Connection *Conn,FtpStat *FS,PCStr(in),PVStr(qb),int qz){
  	CCXP ccx;
  
***************
*** 5367,5372 ****
--- 5396,5402 ----
  {	FtpStat FSbuf,*FS = &FSbuf;
  	int mounted;
  
+ 	setupFCF(Conn);
  	PageCountUpURL(Conn,CNT_TOTALINC,"#sessions",NULL);
  	/*
  	if( FCF.fc_init == 0 )

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V