Article delegate-en/2238 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:<_A2237@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Username with @ into
06 May 2003 09:37:20 GMT feedback@delegate.org (Yutaka Sato)


In message <_A2237@delegate-en.ML_> on 05/06/03(16:37:07)
you Stefano Mason <pw4eabdyi-5sbstgauaoxr.ml@ml.delegate.org> wrote:
 |> On 05/05/03(22:28) you Stefano Mason <pw4eabdyi-5sbstgauaoxr.ml@ml.delegate.org> wrote
 |> in <_A2231@delegate-en.ML_>
 |>  |Delegate in ftpproxy mode:
 |
 |> USER pippo%disney.it@disney..it
 |> PASS ciao
 |> 
 |> willd do.
 |
 |Yes, but may be I've found a bug.
 |
 |Landscape:
 |
 |2 delegated (8.5.3): 1 in DMZ generalist, 1 in LAN specialist (FTPproxy 
 |configured with MASTER to DMZ delegated)
 |
 |In this way work ftpproxy only with user without @ char.

In this case, given "user%xxxx@server", the client-side FTP-DeleGate
interprets the right most atmark as the delimiter between user name
and server name.  The server name part is used to connect the target
server via server-side MASTER-DeleGate.  Then after a connection is
established, the user name part is rewritten to "user@xxxx" and forwarded
to the MASTER.  The MASTER-DeleGate interprets it as "user" at a server
"xxxx", then the problem occurs.  Thus a way to avoid the problem is
specifying a parameter to disable the rewriting at client-side FTP-DeleGate
like follows:

 FTPCONF="usdelim:#"

 |Viceversa, if I configured like example in the end of the reference 
 |manual (cascade FTP proxy, PROXY parameter) work fine also username with 
 |@ char.

In this case, given user name is forwarded as a whole to the upstream
PROXY FTP-DeleGate because the connecting to the target server is the
job of upstream FTP-DeleGate, thus the problem does not occurs.

 |Is this the right expected behaviour?

It is expected that DeleGate works consistently independent of whether
it is chained or not, or how it is chained, thus it should be fixed.
At least there are two ways for fix.  Firstly, stop rewriting in FTP-DeleGate
when it is connecting to MASTER-DeleGate, but it is a little complicated
in the current implementation.  Secondly, stop interpretation of '@' in
user name (switching by "user@server") at MASTER-DeleGate. This will
enable using '@' in user name as is like "USER user@xxxx@server" too.
So I made a patch to do it as enclosed.

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

*** ../dist/delegate8.5.3/src/ftp.c	Mon Mar 17 09:25:44 2003
--- ftp.c	Tue May  6 18:35:14 2003
***************
*** 4211,4216 ****
--- 4211,4217 ----
  	int noSTOR;
  	int enable_mount;
  	int login_done = 0;
+ 	int nosvsw;
  
  	sv1log("FTP server ftp://%s:%d/%s\n",DFLT_HOST,DFLT_PORT,D_SELECTOR);
  	if( isMYSELF(DFLT_HOST) ){
***************
*** 4592,4597 ****
--- 4593,4605 ----
  		enable_mount = 0;
  	}
  
+ 	/*
+ 	 * disable server switching by "USER user@host" when acting as a
+ 	 * MASTER-DeleGate which should be passive (or circuit level) in
+ 	 * connection establishment to server.
+ 	 */
+ 	nosvsw = ImMaster;
+ 
  	com[0] = 0;
  	reqQi = 0;
  	for(;;){
***************
*** 4757,4763 ****
--- 4765,4774 ----
  				else	continue;
  			}
  		}else
+ /*
  		if( strcasecmp(com,"USER") == 0 && strchr(req,'@') ){
+ */
+ 		if( strcasecmp(com,"USER") == 0 && strchr(req,'@') && !nosvsw ){
  			lineScan(req+5,cserv);
  			if( check_server(cserv,com,tc) == 0 )
  				goto SWSERV;

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