[comp.sys.ibm.pc.rt] help with ftpd

irvin@northstar7 (Tim Irvin) (02/12/91)

I am trying to fix a bug with the ftpd on an RT running AOS. 

Background:

The daemon drops the connection to a user when they issue the "dir" command
to their ftp (which issues the LIST ftpd command).  But, if they use
"ls" (NLST) then all goes well.  LIST tries to do a "/bin/ls -lg", while
NLST does a "/bin/ls".

My solution was to make LIST act just like NLST, to see if the problem would
clear up.  So I edited the ftpcmd.y command in the sources and tried to make
ftpd.

Now the fun part started:  the compiler complained (horribly) that many
function where being used with either too many args or too few args.  These
were all warnings, so it finished compiling, but the program would
not work (as one might expect).  The binary was about half as big as the
current binary, leading me to believe that the binary IBM furnished didn't
come from the source code.

So what I need is:

1) a fix to our initial problem

or

2) source code that will compile 

If anyone has any ideas, solutions, etc.  please give me a holler.

Thanks,
Tim Irvin
Project NORTHSTAR
Dartmouth College

webb@ibmpa.awdpa.ibm.com (Bill Webb) (02/13/91)

In article <1991Feb11.210553.553@dartvax.dartmouth.edu>, irvin@northstar7 (Tim Irvin) writes:
|> I am trying to fix a bug with the ftpd on an RT running AOS. 
|> 
|> Background:
|> 
|> The daemon drops the connection to a user when they issue the "dir" command
|> to their ftp (which issues the LIST ftpd command).  But, if they use
|> "ls" (NLST) then all goes well.  LIST tries to do a "/bin/ls -lg", while
|> NLST does a "/bin/ls".

I tried this on the current ftpd and on the shipped source for ftpd recompiled
and didn't see the problem.

|> 
|> My solution was to make LIST act just like NLST, to see if the problem would
|> clear up.  So I edited the ftpcmd.y command in the sources and tried to make
|> ftpd.
|> 
|> Now the fun part started:  the compiler complained (horribly) that many
|> function where being used with either too many args or too few args.  These
|> were all warnings, so it finished compiling, but the program would
|> not work (as one might expect).  The binary was about half as big as the
|> current binary, leading me to believe that the binary IBM furnished didn't
|> come from the source code.
|> 

I recompiled the source and indeed got lots of warnings and the binary is
smaller (I got 122880 when I compiled /usr/src/etc/ftpd, vrs 243712 for
the /etc/ftpd on my system. However the resulting binary worked just fine. 
Most of the warnings are for a varargs-style function (reply) that isn't
declared as such. If you get rid of the warnings with a -w on the compiler
(set CFLAGS=-w -O in the Makefile) you don't get any complaints.
If you look at a later version of ftpd (e.g. BSD reno) you will see that
reply has been reworked with lots of dummy arguments.

The reason for different versions of ftpd is that if you have AFS (Andrew
File System) installed on your system it replaces the standard ftpd with
a version that authenticates with AFS (the latest versions of AFS use
kerberos for that, but I think the version shipped with AFS in DEC 88 
didn't). 

|> So what I need is:
|> 
|> 1) a fix to our initial problem
|> 

Since I couldn't recreate it it's hard to diagnose what the problem was. I 
suggest you recompile the ORIGINAL sources and see if the problem still
exists. Here's an ls -l on the sources I used:

total 55
drwxrwxr-x  2 webb     audit         512 Feb 12 12:30 .
drwxrwxr-x  7 webb     audit        1024 Feb 12 11:56 ..
-rw-r--r--  1 root     system        716 Dec  9  1988 Makefile
-rw-r--r--  1 root     system      16219 Dec  9  1988 ftpcmd.y
-rw-r--r--  1 root     system      24168 Dec  9  1988 ftpd.c
-rw-r--r--  1 root     system       9843 Dec  9  1988 glob.c
-rw-r--r--  1 root     system        665 Dec  9  1988 newvers.sh
-rw-r--r--  1 webb     audit          63 Feb 12 12:00 vers.c
-rw-r--r--  1 webb     audit           4 Feb 12 12:00 version

|> or
|> 
|> 2) source code that will compile 
|> 

If you are using AFS then look in the AFS code for the source of ftpd
that should give you the original binary that you had, then work from there.
If you don't use AFS then the shipped source should be fine.

|> Tim Irvin

----------------------------------------------------------------
The above views are my own, not necessarily those of my employer.
Bill Webb (IBM AWD Palo Alto, Ca.), (415) 855-4457.
UUCP: ...!uunet!ibmsupt!webb INTERNET: webb@ibminet.awdpa.ibm.com

dennis@gpu.utcs.utoronto.ca (Dennis Ferguson) (02/14/91)

In article <1991Feb12.122613@ibmpa.awdpa.ibm.com> webb@ibmpa.awdpa.ibm.com (Bill Webb) writes:
>In article <1991Feb11.210553.553@dartvax.dartmouth.edu>, irvin@northstar7 (Tim Irvin) writes:
>|> I am trying to fix a bug with the ftpd on an RT running AOS. 
[...]
>Since I couldn't recreate it it's hard to diagnose what the problem was. I 
>suggest you recompile the ORIGINAL sources and see if the problem still
>exists. Here's an ls -l on the sources I used:
>
>total 55
>drwxrwxr-x  2 webb     audit         512 Feb 12 12:30 .
>drwxrwxr-x  7 webb     audit        1024 Feb 12 11:56 ..
>-rw-r--r--  1 root     system        716 Dec  9  1988 Makefile
>-rw-r--r--  1 root     system      16219 Dec  9  1988 ftpcmd.y
>-rw-r--r--  1 root     system      24168 Dec  9  1988 ftpd.c
>-rw-r--r--  1 root     system       9843 Dec  9  1988 glob.c
>-rw-r--r--  1 root     system        665 Dec  9  1988 newvers.sh
>-rw-r--r--  1 webb     audit          63 Feb 12 12:00 vers.c
>-rw-r--r--  1 webb     audit           4 Feb 12 12:00 version

This ftpd is actually quite crufty and old, and if I'm not mistaken
suffers from a bug which is a lot more infamous than the one mentioned.
If one were spending time recompiling the ftp daemon anyway, it might be
better to obtain a newer version of the software and work with that
instead.

Dennis Ferguson
University of Toronto