Subject: wu-ftpd-2.4.2-beta-18 fails on AIX 4.2

From: Mark Francis <[email-masked]>
Date: Wed, 17 Feb 1999 09:45:32 -0000

Hi everyone,
I've been out of the loop for a while, but I've still got a problem 
with get i.e. it fails with :

451 Local resource failure: malloc: No such file or directory.

I read with interest the fixes applied to wu-ftpd.2.4.2-beta-vr13, I 
had a look at the code I've got and found the fixes could not be 
applied. I.e. No variable called blkcnt_size and off_t is not 
defined.

I am by no means a C programmer (but I can work my way through the 
code), is there any other suggestions out there to fix my problem ? or 
should I change to wu-ftpd.2.4.2-beta-vr13 ? What does the vr13 stand 
for ? Do I get any additional benefits ?
Cheers,
Mark Francis
Analyst/Programmer
Teamwork Solutions Ltd
Phone:	+44(0) 161 228 2286
Fax:	+44(o) 161 228 2900
Email: [email-masked]
Web: http://teamwork-solutions.com

---

From: Oleg Semenyuk <[email-masked]>
Date: Wed, 17 Feb 1999 13:10:57 +0300 (MSK)

Hi everyone,

1. Can wu-ftpd-2.4.2-beta-18 make chroot (restrict access above home
   directory for some user)? How I can do it?

2. Does wu-ftpd-2.4.2-beta-18 vulnerable on *BSD systems?

thanks a lot,
Oleg.

---

From: Stefan Vogel <[email-masked]>
Date: Wed, 17 Feb 1999 15:24:13 +0100 (MET)

Hello Netters,

> 451 Local resource failure: malloc: No such file or directory.

This error message is generated in send_data because a call to malloc
is attempting to request a block of size zero. The size zero is a
consequence of a type mismatch of the parameter blksize (declared as
off_t, or long long on AIX 4.2 if _LARGE_FILES is #defined) when send_data is 
called from retrieve. If You use the default settings for the compiler in 
"build aix" You get /bin/cc, which is a non-ANSI compiler on AIX, so no 
prototypes are compiled. The expression for the parameter blksize in the call 
thus is of type int resulting in a very large value for the long long blksize, 
but accidentally a zero in the least significant 32 bits, which then get casted

to the size_t (int on AIX 4.2) parameter of malloc.

The solution is not to use /bin/cc as compiler but /bin/xlc, which is the AIX 
ANSI compiler:

  build aix CC=xlc

There is another problem on AIX 4.2: the announcement of the file size at the
beginning of the transfer always reports 0 bytes when using /bin/cc as 
compiler. The reason is that the correct printf format for off_t (%lld if 
_LARGE_FILES is defined) is only selected if _AIX42 is defined. If the 
-D_AIX42 in the CFLAGS definition in src/makefiles/Makefile.aix is uncommented
a bug in src/config/config.aix is triggered: _LARGE_FILES only gets defined
if _AIX42 is undefined. This of course makes off_t int instead of long long
and the printf format is incorrect again, announcing very large file sizes.
The included patch corrects src/config/config.aix.

Btw would it be possible to document the -D_AIX42 CFLAGS addition somewhere
(outside Makefile.aix), e.g. NOTES or FIXES-*?

Following the patch for src/config/config.aix:

----8<--- snip --->8----
--- src/config/config.aix       Sat Oct 31 16:58:15 1998
+++ src/config/config.aix.new   Wed Feb 17 12:05:24 1999
@@ -9,7 +9,7 @@
 #define VIRTUAL
 #endif
 #endif
-#ifndef _AIX42
+#ifdef _AIX42
 #define _LARGE_FILES 
 #ifndef VIRTUAL
 #define VIRTUAL
----8<--- snip --->8----

Regards

   0"0      Stefan Vogel                   Tel: ++41 1 635 67 74
  ( V )     Rechenzentrum der Universitaet FAX: ++41 1 635 45 05
   | |      CH-8057 Zuerich, Switzerland   inet: [email-masked]
---m-m------------------------------------
IBM: Solutions for a small planet! Too small!! Much too small!!!