w wg | 3 Aug 06:07 2008
Picon

mget bug ?

Hi,

I  found a problem, perhaps it is a bug. My lftp 's version is 3.5.14.

if you use lftp in -c or -f mode, and put mget at the last line, when
some errors occupied, the mget command report 'no files found', and
LFTP return code 0 to OS shell.

Example:

lftp -c 'open bad_host.com; \
   ls ;\
  mget *db; \
 '
Because the host is not existed, I think mget should report error, and
return error code to shell. But shell get result as 0.

Thank you.

 --
WenGe Wang

Alexander V. Lukyanov | 5 Aug 12:53 2008
Picon

Re: Thanks For a Wonderful Program

On Tue, Aug 05, 2008 at 05:32:29AM -0400, Ed Abbott wrote:
> ---> AUTH TLS
> <--- 234 AUTH TLS OK.                                               
...
> ---> PASV
> <--- 227 Entering Passive Mode (74,220,219,58,165,243)
> ---- Connecting data socket to (74.220.219.58) port 42483
> Interrupt                                 

Probably you use a firewall and when control connection is encrypted
it cannot dynamically open ports for data connection. Turn off encryption
with this command:

	set ftp:ssl-allow no

--

-- 
   Alexander.

Ed Abbott | 5 Aug 16:20 2008

Re: Thanks For a Wonderful Program

On Tuesday 05 August 2008 06:53:28 am Alexander V. Lukyanov wrote:
> Turn off encryption
> with this command:
>
>         set ftp:ssl-allow no
>
> --
>    Alexander.

Yes!  That did the trick!

Mind if I write an article recommending
lftp to other people?  I'd love to do that.

It would an article I place on my website.

I love lftp.

Ed

Paul Wickham | 17 Aug 12:47 2008
Picon

SFTP to freeftpd on windows

Hi

I'm trying to write a unix script to pull files from an SFTP server called freeftpd on windows. As you can guess the server is freee as in beer so perhaps other people are using it as well. However, I am having issues with lftp being able to see files on the server. I can see folders but not files. When I use other sftp clients I can see files where I should but not in lftp. Is there anything that could cause incompatibilites between clients that can be changed? Could this be a bug in  freeftpd or lftp?

Paul

Paul Wickham | 18 Aug 06:44 2008
Picon

Re: SFTP to freeftpd on windows



On Mon, Aug 18, 2008 at 11:00 AM, Bill Dorsey <bdorsey63 <at> gmail.com> wrote:
Hi,

There is not enough information with your request. Please turn debug
up to say 11, and look closely at the errors. The post the errors
here.

lftp to host, debug 11:

ls
FileCopy(0x8654210) enters state INITIAL
FileCopy(0x8654210) enters state DO_COPY
---- path on wire is `/test'
---> sending a packet, length=14, type=11(OPENDIR), id=7
PackUINT32BE(0x0000000E)
PackUINT8(0x0B)
PackUINT32BE(0x00000007)
PackUINT32BE(0x00000005)
<--- got a packet, length=22, type=102(HANDLE), id=7
---- got file handle 4F70656E44697248616E646C65 (13)
---> sending a packet, length=22, type=12(READDIR), id=8
PackUINT32BE(0x00000016)
PackUINT8(0x0C)
PackUINT32BE(0x00000008)
PackUINT32BE(0x0000000D)
<--- got a packet, length=1676, type=104(NAME), id=8
---- file name count=15
---> sending a packet, length=22, type=12(READDIR), id=9
PackUINT32BE(0x00000016)
PackUINT8(0x0C)
PackUINT32BE(0x00000009)
PackUINT32BE(0x0000000D)
---> sending a packet, length=22, type=12(READDIR), id=10
PackUINT32BE(0x00000016)
PackUINT8(0x0C)
PackUINT32BE(0x0000000A)
PackUINT32BE(0x0000000D)
<--- got a packet, length=28, type=101(STATUS), id=9
---- status code=1(EOF), message=End of file
---- eof
copy: get hit eof
copy: waiting for put confirmation
FileCopy(0x8654210) enters state CONFIRM_WAIT
drw-rw-rw   1 root       root             0 Aug 18 11:48 .
drw-rw-rw   1 root       root             0 Aug 18 11:48 ..
copy: put confirmed store
FileCopy(0x8654210) enters state GET_DONE_WAIT
copy: get is finished - all done
FileCopy(0x8654210) enters state ALL_DONE
---> sending a packet, length=22, type=4(CLOSE), id=11
PackUINT32BE(0x00000016)
PackUINT8(0x04)
PackUINT32BE(0x0000000B)
PackUINT32BE(0x0000000D)
<--- got a packet, length=28, type=101(STATUS), id=10
---- status code=1(EOF), message=End of file
<--- got a packet, length=24, type=101(STATUS), id=11
---- status code=0(OK), message=Success

 

Arkadiusz Miskiewicz | 17 Aug 22:35 2008
Picon

[PATCH]: fix terminal stuff detection


Ncurses library can be built with terminal function ending in separate libtinfo.so.X library. 

Fix detection of terminal functions in such case.

diff -urN lftp-3.7.4.org/m4/terminfo.m4 lftp-3.7.4/m4/terminfo.m4
--- lftp-3.7.4.org/m4/terminfo.m4	2004-02-12 14:37:26.000000000 +0100
+++ lftp-3.7.4/m4/terminfo.m4	2008-08-17 22:25:38.149166773 +0200
 <at>  <at>  -3,7 +3,7  <at>  <at> 
    AC_CHECK_HEADERS(curses.h term.h ncurses/curses.h ncurses/term.h)

    # Get a library with terminal caps if needed; prefer one with tigetstr.
-   AC_SEARCH_LIBS(tigetstr, [curses ncurses], [
+   AC_SEARCH_LIBS(tigetstr, [tinfo curses ncurses], [
 	 AC_DEFINE(HAVE_TIGETSTR, 1, [Define to 1 if you have the `tigetstr' function.])
 	 AC_CHECK_FUNCS(tgetstr)
       ], [AC_SEARCH_LIBS(tgetstr, termcap,

--

-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/

Alexander V. Lukyanov | 19 Aug 10:24 2008
Picon

Re: SFTP to freeftpd on windows

On Mon, Aug 18, 2008 at 02:44:31PM +1000, Paul Wickham wrote:
> <--- got a packet, length=1676, type=104(NAME), id=8
> ---- file name count=15
> drw-rw-rw   1 root       root             0 Aug 18 11:48 .
> drw-rw-rw   1 root       root             0 Aug 18 11:48 ..

I suspect the rest of 15 file entries were invalid in some way.
Please apply this patch and redo the ls with debug 10.

--
   Alexander.
Index: SFtp.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/SFtp.cc,v
retrieving revision 1.80
diff -u -p -r1.80 SFtp.cc
--- SFtp.cc	16 May 2008 08:45:01 -0000	1.80
+++ SFtp.cc	19 Aug 2008 08:18:35 -0000
 <at>  <at>  -1912,7 +1912,7  <at>  <at>  void SFtp::Request_RENAME::Pack(Buffer *

 const char *SFtp::utf8_to_lc(const char *s)
 {
-   if(!recv_translate)
+   if(!recv_translate || !s)
       return s;

    recv_translate->ResetTranslation();
 <at>  <at>  -1925,7 +1925,7  <at>  <at>  const char *SFtp::utf8_to_lc(const char 
 }
 const char *SFtp::lc_to_utf8(const char *s)
 {
-   if(!send_translate)
+   if(!send_translate || !s)
       return s;

    send_translate->ResetTranslation();
 <at>  <at>  -1947,6 +1947,10  <at>  <at>  FileInfo *SFtp::MakeFileInfo(const NameA
 {
    const FileAttrs *a=&na->attrs;
    const char *name=utf8_to_lc(na->name);
+   const char *longname=utf8_to_lc(na->longname);
+
+   LogNote(10,"NameAttrs(name=\"%s\",type=%d,longname=\"%s\")\n",name?name:"",a->type,longname?longname:"");
+
    if(!name || !name[0])
       return 0;
    if(strchr(name,'/'))
 <at>  <at>  -1961,8 +1965,8  <at>  <at>  FileInfo *SFtp::MakeFileInfo(const NameA
    case SSH_FILEXFER_TYPE_SYMLINK:  fi->SetType(fi->SYMLINK);   break;
    default: return 0;
    }
-   if(na->longname)
-      fi->SetLongName(utf8_to_lc(na->longname));
+   if(longname)
+      fi->SetLongName(longname);
    if(a->flags&SSH_FILEXFER_ATTR_SIZE)
       fi->SetSize(a->size);
    if(a->flags&SSH_FILEXFER_ATTR_UIDGID)
Alexander V. Lukyanov | 19 Aug 11:14 2008
Picon

Re: [PATCH]: fix terminal stuff detection

On Sun, Aug 17, 2008 at 10:35:11PM +0200, Arkadiusz Miskiewicz wrote:
> Ncurses library can be built with terminal function ending in separate libtinfo.so.X library.
>
> Fix detection of terminal functions in such case.

I have applied the patch. Thanks!

--
   Alexander.

Paul Wickham | 19 Aug 13:26 2008
Picon

Re: SFTP to freeftpd on windows

Sorry guys should have given my version it's 3.7.4 lftp running under Arch Linux.
Anyways have applied the patch and here is what it gives:

lftp paul <at> 192.168.10.5:/foobar> ls
---- path on wire is `/foobar'
---> sending a packet, length=16, type=11(OPENDIR), id=7
<--- got a packet, length=22, type=102(HANDLE), id=7
---- got file handle 4F70656E44697248616E646C65 (13)
---> sending a packet, length=22, type=12(READDIR), id=8
<--- got a packet, length=575, type=104(NAME), id=8
---- file name count=5
---- NameAttrs(name=".",type=2,longname="drw-rw-rw   1 root       root             0 Aug 17 11:56 .")
---- NameAttrs(name="..",type=2,longname="drw-rw-rw   1 root       root             0 Aug 17 11:56 ..")
---- NameAttrs(name="7z445.exe",type=5,longname="-rw-rw-rw   1 root       root        842384 May 1 20:20 7z445.exe")
---- NameAttrs(name="putty.exe",type=5,longname="-rw-rw-rw   1 root       root        438272 Aug 12 23:28 putty.exe")
---- NameAttrs(name="UnRegisterRafExt.BAT",type=5,longname="-rw-rw-rw   1 root       root            24 Aug 17 11:56 UnRegisterRafExt.BAT")
---> sending a packet, length=22, type=12(READDIR), id=9
---> sending a packet, length=22, type=12(READDIR), id=10
<--- got a packet, length=9, type=101(STATUS), id=9
---- status code=1(EOF), message=NULL
---- eof
copy: get hit eof
copy: waiting for put confirmation
drw-rw-rw   1 root       root             0 Aug 17 11:56 .
drw-rw-rw   1 root       root             0 Aug 17 11:56 ..
copy: put confirmed store
copy: get is finished - all done
---> sending a packet, length=22, type=4(CLOSE), id=11
<--- got a packet, length=9, type=101(STATUS), id=10
---- status code=1(EOF), message=NULL
<--- got a packet, length=9, type=101(STATUS), id=11
---- status code=0(OK), message=NULL
lftp paul <at> 192.168.10.5:/foobar>

If I run with sftp or filezilla or any other sftp clien



On Tue, Aug 19, 2008 at 6:24 PM, Alexander V. Lukyanov <lav <at> netis.ru> wrote:
On Mon, Aug 18, 2008 at 02:44:31PM +1000, Paul Wickham wrote:
> <--- got a packet, length=1676, type=104(NAME), id=8
> ---- file name count=15
> drw-rw-rw   1 root       root             0 Aug 18 11:48 .
> drw-rw-rw   1 root       root             0 Aug 18 11:48 ..

I suspect the rest of 15 file entries were invalid in some way.
Please apply this patch and redo the ls with debug 10.

--
  Alexander.

Alexander V. Lukyanov | 19 Aug 14:26 2008
Picon

Re: SFTP to freeftpd on windows

On Tue, Aug 19, 2008 at 09:26:36PM +1000, Paul Wickham wrote:
> ---- NameAttrs(name="7z445.exe",type=5,longname="-rw-rw-rw   1 root root        842384 May 1 20:20 7z445.exe")

Ok, now I see. The server sends type=5, which means UNKNOWN. Currently lftp
ignores such entries. I'll fix it.

--

-- 
   Alexander.


Gmane