On Thu, Mar 13, 2014 at 12:17:29PM +0400, Alexander V. Lukyanov wrote:
> On Tue, Mar 11, 2014 at 03:20:53PM +0100, Michael Ross wrote:
> > read(8,"xxxxx...@www.ross.cx's password:"...,65536) = 33 (0x21)
> 
> > read(8,"Password for root@lftp:",65536)              = 23 (0x17)
> 
> So the prompt is different. I suspect that lftp did not recognize the second
> prompt for password. I'll have to fix it.

Please review or test this patch.

-- 
   Alexander.
diff --git a/src/SSH_Access.cc b/src/SSH_Access.cc
index 7ae3e6b..68e64de 100644
--- a/src/SSH_Access.cc
+++ b/src/SSH_Access.cc
@@ -43,13 +43,16 @@ int SSH_Access::HandleSSHMessage()
    if(!eol)
    {
       const char *p="password:";
+      const char *p_for="password for ";
       const char *y="(yes/no)?";
       int p_len=strlen(p);
+      int p_for_len=strlen(p_for);
       int y_len=strlen(y);
       if(s>0 && b[s-1]==' ')
         s--;
       if((s>=p_len && !strncasecmp(b+s-p_len,p,p_len))
-      || (s>10 && !strncmp(b+s-2,"':",2)))
+      || (s>10 && !strncmp(b+s-2,"':",2))
+      || (s>p_for_len && b[s-1]==':' && !strncasecmp(b,p_for,p_for_len)))
       {
         if(!pass)
         {
_______________________________________________
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Reply via email to