On Jul 2, 2008, at 21:49, Aethon wrote:

prior to 'get'ing a file, you have to issue a site command with a file specific password (this is on top of the normal login authentication stuff).
[...]
open sitename
login user pass
site rpwd second_pwd
get file1 -o outdir/file1
get file2 -o outdir/file2

I see there are already two similar options in lftp to send certain extra commands after logging in:

ftp:acct (string)
Send this string in ACCT command after login. The result is ignored. The closure for this setting has format [EMAIL PROTECTED]

ftp:site-group (string)
Send this string in SITE GROUP command after login. The result is ignored. The closure for this setting has format [EMAIL PROTECTED]

Except of course they are not sending the command you need.
As an ugly but easy hack you could change the source code in src/ ftpclass.cc to send the command you want "SITE RPWD" instead of "SITE GROUP".

Look for:
void Ftp::SendSiteGroup()
{
   const char *group=QueryStringWithUserAtHost("site-group");
   if(!group)
      return;
   conn->SendCmd2("SITE GROUP",group);
   expect->Push(Expect::IGNORE);
}

Modify it to send SITE RPWD or whatever you want instead of SITE GROUP.
Then just add
set ftp:site-group 'blahblah'
to the start of your script.

Reply via email to