If you intend to use 'configure', after applying this patch you MUST
run the 'autoconf' command to generate a new 'configure' command.



diff -u CHANGES.orig CHANGES
--- CHANGES.orig	Sat Jul  1 15:03:45 2000
+++ CHANGES	Thu Jul 20 09:56:18 2000
@@ -23,6 +23,10 @@
   $Id: CHANGES,v 1.44 2000/07/01 19:03:45 wuftpd Exp $
 
 
+Changes in 2.6.2: <Net yet released>
+
+ o  Provide a comile-time option to revert NLST to showing directories.
+
 Changes in 2.6.1: Released 2 Jul, 2000
 
  o  Fix security leaks that could result in a root shell compromise.

diff -u config.h.in.orig config.h.in
--- config.h.in.orig	Sat Jul  1 13:42:15 2000
+++ config.h.in	Thu Jul 20 09:57:39 2000
@@ -343,3 +343,13 @@
  * Define this to support quota mechanisms...
  */
 #undef QUOTA
+
+/*
+ * Define this to revert the NLST command to showing directories.
+ *
+ * This will cause mget to have errors when it attempts to RETR the
+ * directory name (which is not a RETRievable object) but will revert
+ * the NLST command enough to quell complains from Solaris command-
+ * line FTP client users.
+ */
+#undef NLST_SHOWS_DIRS

diff -u config.h.noac.orig config.h.noac
--- config.h.noac.orig	Sat Jul  1 13:42:15 2000
+++ config.h.noac	Thu Jul 20 09:54:46 2000
@@ -378,3 +378,13 @@
  * CONSUMES ALL AVAILABLE MEMORY.
  */
 #undef SITE_NEWER
+
+/*
+ * Define this to revert the NLST command to showing directories.
+ *
+ * This will cause mget to have errors when it attempts to RETR the
+ * directory name (which is not a RETRievable object) but will revert
+ * the NLST command enough to quell complains from Solaris command-
+ * line FTP client users.
+ */
+#undef NLST_SHOWS_DIRS

diff -u configure.in.orig configure.in
--- configure.in.orig	Sat Jul  1 13:42:15 2000
+++ configure.in	Thu Jul 20 10:05:08 2000
@@ -202,6 +202,8 @@
 	[ bufsize=$withval ], [ bufsize=no ])
 AC_ARG_WITH(backlog,	 [  --with-backlog=x        number of incoming processes to backlog in daemon mode],
 	[ backlog=$withval ], [ backlog=100 ])
+AC_ARG_ENABLE(nlst-dirs, [  --enable-nlst-dirs      allow NLST to show directories, can break mget],
+	[ nlstdirs=$enableval ], [ nlstdirs=no ])
 
 LIBS=""
 
@@ -954,6 +956,9 @@
 fi
 if test $badclients = yes; then
 	AC_DEFINE(SUPPORT_BROKEN_CLIENTS)
+fi
+if test $nlstdirs = yes; then
+	AC_DEFINE(NLST_SHOWS_DIRS)
 fi
 
 dnl TODO:is there a better check whether or not an argument is numeric???

diff -u src/ftpd.c.orig src/ftpd.c
--- src/ftpd.c.orig	Sat Jul  1 14:17:39 2000
+++ src/ftpd.c	Thu Jul 20 09:52:17 2000
@@ -6486,7 +6486,10 @@
 	    }
 	    goto globfree;
 	}
-	if ((st.st_mode & S_IFMT) != S_IFDIR) {
+#ifndef NLST_SHOWS_DIRS
+	if ((st.st_mode & S_IFMT) != S_IFDIR)
+#endif
+	{
 	    if (dout == NULL) {
 		dout = dataconn("file list", (off_t) - 1, "w");
 		if (dout == NULL)
