Re: wu 2.6.2 compiled on RH 7.3 has B in dir listing

Bob Luckin <[email protected]> Wed, 28 Jul 2004 21:40:36 -0500
Newsgroups gmane.network.ftp.wuftpd.user
Message-ID <[email protected]>
My guess is that it is using the internal ls instead of the external binary.
There's an off-by-one error in the rpad function in ftpd.c, which can cause
spurious characters to be written to a couple of the fields, right where
you're seeing the B's.

If this is the problem, you can either recompile so that it no longer uses the
internal ls, or you can make a trivial edit to the source code and recompile.

The rpad function in ftpd.c includes the following lines

        a = (char *) malloc(len + 1);
        memset(a, ' ', len-1);
        a[len] = 0;

You need to change the middle one to

        memset(a, ' ', len);

to fix the problem in the internal ls.

Cheers, Bob

On Wed, Jul 28, 2004 at 08:39:17AM -0500, John Helms wrote:
> Does anybody know why a directory listing has a "B"
> in front of the group and size?
> 
> [helmsjw@rru1 helmsjw]$ ftp ftp.rr.photomask.com
> Connected to ftp.rr.photomask.com (208.222.129.90).
> 220 rrux03 FTP server (Version wu-2.6.2(2) Thu Jul 24 13:54:37 CDT 2003) 
> ready.
> Name (ftp.rr.photomask.com:helmsjw): transfer
> 331 Password required for transfer.
> Password:
> 230 User transfer logged in.  Access restrictions apply.
> Remote system type is UNIX.
> Using binary mode to transfer files.
> ftp> dir
> 227 Entering Passive Mode (208,222,129,90,141,154)
> 150 Opening ASCII mode data connection for directory listing.
> total 72
> drwxr-xr-x   3 root   B 3      B     4096 Feb 24  2002 bin
> drwxr-xr-x   3 root   B 3      B     4096 Feb 24  2002 etc
> drwxrwxr-x   9 117    B 20     B    20480 Jul 27 09:00 incoming
> lrwxrwxrwx   1 root   B 3      B        7 Feb 25  2002 lib -> usr/lib
> drwxrwxr-x   2 117    B 20     B     4096 Apr 19  2004 outgoing
> drwxr-xr-x   3 root   B 3      B     4096 Feb 25  2002 usr
> 226 Transfer complete.
> ftp>
> 
> This has not been a problem until recently when someone
> was attempting to do filesize checks.
> 
> Thanks in advance,
> John Helms

-- 
Bob Luckin      [email protected]      "Coder, adapt; FTP Ada, redo C"