Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Issue with Tcllib FTP Package - changing users with ::ftp::Quote.

2 views
Skip to first unread message

Patrick Finnegan

unread,
May 3, 2007, 6:09:46 AM5/3/07
to
Using Active State Tcl on Windows XP. FTP server is AIX.

(bin) 75 % info patchlevel
8.4.14

bin) 79 % package require ftp
2.4.6

I need to log on to the remote FTP server with user "anonymous" then
change
users to access the target diretories.

In raw FTP this is:

User (12345678:(none)): anonymous
331 Guest login ok, send ident as password.
Password:
230 Guest login ok, access restrictions apply.
ftp>

ftp> user newUser newPassword
331 Password required for newUser.
230 User newUser logged in.
ftp>

You can see that the when the user command is issued with the userid
and
password the 331 command is returned but that is followed by 230 and
the
user is logged in.

Using the FTP package:

ftp::Open $host $logon $password -output ftpOut

ftp::Quote $session user $logon2 $password2

The trace shows:

-> rc=" "
-> msgtext=""
-> state="quote"
---> user logon2 password2
-> rc="331"
-> msgtext="Password required for logon2 password2"
-> state="quote_sent"
C: 331 Password required for logon2 password2.
result is 331 Password required for logon2 password2.

The FTP package picks up the first 331 message and returns a login
failed
message and subsequent commands generate a login prompt from the FTP
server.


::ftp::NList $session *

-> rc="530"
-> msgtext="Please login with USER and PASS."
-> state="nlist_open"
C: 530 Please login with USER and PASS.

Is there an easy way around this or should I just use Expect?

Thanks in advance.


Patrick.

0 new messages