Subject: RE: FTP anonymous account structure - MINIMUM

From: Magdalena Hewryk <[email-masked]>
Date: Thu, 6 May 1999 16:49:23 -0400

Gregory, 
Thank you for explanation about minimum requirements of ~ftp home directory.
Now I have a better understanding of it.  
I heard from others that old versions of wu-ftp didn't have features
built-in and they had to copy all the directories to ~ftp anonymous account,
including certain libraries and /dev, /etc.

Talking about minimum, I don't keep /etc/group, /etc/passwd in ~ftp
anonymous account.
And I can log on as anonymous and as ftpusers (guests).  I don't know how it
works?

I deleted ~ftp/bin/ls program  from my ~ftp directory and ls command is
still working.
However, ls -ls, ls -al or any ls with flag is not working. Just a basic ls
is probably build in, as you explained: "daemon itself does not care about
that stuff.  this includes the built-in NLST command".

ls command:
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
script_slowaris
littletime
county
incoming
mnh_usr
226 Transfer complete.
52 bytes received in 0.019 seconds (2.71 Kbytes/s)

ls -al command doesn't show anything:  ( I don't have ~ftp/bin/ls)
ftp> ls -a
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.

Regards,
...Magda

-----Original Message-----
From: Gregory A Lundberg [mailto:[email-masked]]
Sent: Thursday, May 06, 1999 2:14 PM
To: Magdalena Hewryk
Cc: [email-masked]
Subject: Re: FTP anonymous account structure

On Thu, 6 May 1999, Magdalena Hewryk wrote:

> I created home for ~ftp anonymous user with all required directories
> and it works fine.  No problems, what so ever.
> 
> However, when I deleted ALL libraries from ~ftp/usr/lib and I deleted
> all files from ~ftp/dev/ and I remove the /usr directory the anonymous
> account is still working.... I can get any file I want with no errors
> and ~ftp is seen as a '/'.
> 
> Can somebody give me the short explanation why is that happening ?  
> Why all the /usr/lib are needed in ~ftp directory?
> 
> Basically I screwed the whole ~ftp directory and anonymous is working
> the way it worked before.

The daemon itself does not care about that stuff.  this includes the
built-in NLST command.

**BUT** to list the directory contents (LIST command) the daemon needs to
run the external program ~ftp/bin/ls.  Now, on a lot of systems, you need
a lot of other stuff besides just the program file to make it all work.
At a minimum, though, you need bin/ls etc/passwd etc/group and dev/null.

-- 

Gregory A Lundberg              Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

---

From: Gregory A Lundberg <[email-masked]>
Date: Thu, 6 May 1999 22:05:21 -0400 (EDT)

On Thu, 6 May 1999, Magdalena Hewryk wrote:

> anonymous account. And I can log on as anonymous and as ftpusers
> (guests).  I don't know how it works?

Login is not effected by any files in the chroot'd area (~ftp, for
example).

> still working. However, ls -ls, ls -al or any ls with flag is not
> working. Just a basic ls is probably build in, as you explained:
> "daemon itself does not care about that stuff.  this includes the
> built-in NLST command".
> 
> ls command:
> ftp> ls

This was NLST.  It's built into the daemon.  Originally it was the only
way to get a Name LiST.

> 150 Opening ASCII mode data connection for /bin/ls.

This was LIST.  Your client chose it because you gave a filename parameter
(-a was taken as a filename, not an option, by the client .. NLST does not
allow filenames).  The daemon tried to run ~ftp/bin/ls.  Since there was
no program to run no output was generated.  BTW, even though the client
thought it was asking for a LIST of files named '-a' the daemon looks for
the leading - as a special case and interprets it as an option since
that's probably what you meant.

--