Subject: [445] ls in wu-ftp

From: "Nelson H. F. Beebe" <[email-masked]>
Date: Wed, 14 Sep 1994 08:57:31 -0600 (MDT)

Jarle Martinsen writes on Wed, 14 Sep 1994 14:59:51 +0100 (CET) to ask
how the ls and dir commands work, so that he can modify them for local
needs.  Here are my comments:

The wu-ftpd ls command is implemented internally if no ls switches are
given; if any are, then an external ls is used.  Since dir is
equivalent to "ls -l", or whatever the ftpaccess file says, it too
results in an external ls program being invoked.

Thus, if you want to modify the behavior of the bare ls command, to
e.g. not show filenames beginning with a dot, then you need to change
the source code.  Look in ftpd.c, about 93% into the file, for the
code section beginning with the call to readdir().

File names are not stored in sorted order in UNIX directories, so the
standard wu-ftpd code in response to an ls command will produce
unordered output, which is quite frustrating for users.  To solve this
problem, I have a transparent replacement for the
readdir()/opendir()/closedir() routines that guarantee a sorted
traversal, while requiring ONLY the addition of a single #include in
the source code, and the addition of another C source file to the
Makefile source file list.  This code is available on request;
however, I won't place it in an ftp directory, to reduce the
possibilities for modification by an intruder.

========================================================================
Nelson H. F. Beebe                      Tel: +1 801 581 5254
Center for Scientific Computing         FAX: +1 801 581 4148
Department of Mathematics, 105 JWB      Internet: [email-masked]
University of Utah
Salt Lake City, UT 84112, USA
========================================================================

---

From: Bill Stapleton <[email-masked]>
Date: Wed, 14 Sep 1994 12:16:16 -0500 (CDT)

Hi.

In the WU-FTPD mailing list, you wrote:

> ...  This code is available on request;

I'd like to recieve a copy of your "sorted directory" code please.

--
Bill Stapleton
     [email-masked]
     uwmcsd4!wls