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

[DeleGate-En] Re: ftp/sftp gateway not working
14 Sep 2006 12:12:59 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A3491@delegate-en.ML_> on 09/14/06(19:18:47)
you "Gsandtner Michael" <psagqbdyi-po5c3iy6fbvr.ml@ml.delegate.org> wrote:
 |I tried delegate9.2.5-pre2. The connection problem is solved. Thanks.
 |
 |But now the "cd" command seems not to work.
 |After connecting "ls" gives the correct listing of users home.
 |After "cd test" (the test directory exists on the server) I am in the
 |root directory of the server.

I could reproduce the problem on Linux.

 |09/14 12:00:08.93 [10404] 1+0/4: --SFTP << pwd^M
 |09/14 12:00:08.93 [10404] 1+0/4: --SFTP >>(PASS) pwd^M^JRemote working
 |directory: /sftp/wln9adv
 |09/14 12:00:08.95 [10404] 1+0/4: --SFTP >>(PASS/NO-NL)[sftp> ]
 |09/14 12:00:08.97 [10404] 1+0/4: --SFTPGW << [PWD][]
 |09/14 12:00:08.97 [10404] 1+0/4: --SFTP << pwd^M
 |09/14 12:00:08.97 [10404] 1+0/4: --SFTP >>(PWD) pwd^M^JRemote working
 |directory: /sftp/wln9adv
 |09/14 12:00:08.99 [10404] 1+0/4: --SFTP >>(PWD/NO-NL)[sftp> ]
 |09/14 12:00:09.01 [10384] 1+0/4: FTP-SERVER-SAYS: 257 "/"^M

On MacOSX (or on BSD Unixes), it is shown as follows:

 --SFTPGW << [PWD][]
 --SFTP << pwd^M
 --SFTP >>(PWD) Remote working directory: /Users/delegate
 --SFTP >>(PWD/NO-NL)[sftp> ]
 --SFTPGW >> 257 "/Users/delegate"

DeleGate for sftp/SSH gateway uses the sftp command via a Pty which has
its origin in BSD.  BSD Pty seems initiated with "-echo" by default while
non-BSD Pty seems initiated with "echo ctlecho".
So adding "stty -echo" before "sftp" command solves the problem, as the
enclosed patch.

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


*** ../arc/delegate9.2.5-pre2/src/sftp.c	Fri Sep  8 02:13:33 2006
--- src/sftp.c	Thu Sep 14 21:05:01 2006
***************
*** 143,149 ****
--- 143,152 ----
  	int from[2];
  	int rcode;
  
+ 	/*
  	sprintf(com,"%s -oPort=%d %s@%s",sftp_com,port,user,host);
+ 	*/
+ 	sprintf(com,"stty -echo; %s -oPort=%d %s@%s",sftp_com,port,user,host);
  	DEBUG("--SFTP: %s\n",com);
  
  	pid = Forkpty(&pty,name);

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